Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Server Loop Help
#3
I'm not sure about the index, I was trying to find a way to do it, and as far as I can tell, the code throughout the server side always pops up similar to
Code:
Int(GetPlayerStat(Index, Stats.defense)

I tried removing the index (forget the error code I got for that), and i tried putting in I instead of index (not sure why I tried that, some stupid part of my mind slipped out when I tried that one I guess). I figured the error involved the index.

I got the second part of the code
Code:
Call SetPlayerStat(index, Stats.canfish, GetPlayerStat(index, Stats.canfish) - fishness)
from the stat update part of the server, and it worked when I created another sub that was called when a player used an item. I try to understand everything I add, but alot of it I do not understand, I just know what works and what doesn't work.

Edit*** I got it working. It may have been a problem with dimming it as a byte (I'm not sure) but the final working code was

Code:
Private Sub UpdatePlayerFishing()
Dim i As Long, fishness As Long

    For i = 1 To MAX_PLAYERS
        If IsPlaying(i) Then
        fishness = GetPlayerStat(i, Stats.canfish)
            If fishness >= 1 Then
                Call SetPlayerStat(i, Stats.canfish, GetPlayerStat(i, Stats.canfish) - fishness)
            Else
            End If
        End If
    Next i
End Sub

Thanks for your help Dugor.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)