17-04-2009, 06:03 AM
Ok, I'm creating a player rep system that allows for players to give rep to other players. I've based this on the /setaccess command. Here is what I have for the handlesetrep
My problem is with this part here
it sets the player rep to i, i need it to add to the player rep, so it needs to look something like this
If it were setting the players own rep, it wouldn't be a problem, but I don't know how to code it to affect someone else's rep. The rep is located in the stat enum. Any help?
Code:
' ::::::::::::::::::::::::::
' :: Set access packet ::
' ::::::::::::::::::::::::::
Private Sub HandleSetRep(ByVal Index As Long, ByRef Parse() As String)
Dim n As Long
Dim i As Long
n = FindPlayer(Parse(1))
i = CLng(Parse(2))
End If
Call SetPlayerRep(n, i)
Call SendPlayerData(n)
Call AddLog(GetPlayerName(Index) & " has modified " & GetPlayerName(n) & "'s reputation.", ADMIN_LOG)
Else
Call PlayerMsg(Index, "Player is not online.", White)
End If
End Sub
My problem is with this part here
Code:
Call SetPlayerRep(n, i)
it sets the player rep to i, i need it to add to the player rep, so it needs to look something like this
Code:
CallSetPlayerRep(n, (code for players rep) + i)
If it were setting the players own rep, it wouldn't be a problem, but I don't know how to code it to affect someone else's rep. The rep is located in the stat enum. Any help?