18-04-2009, 12:19 AM
Ok, as I said, I have everything set up just like set access command. The SetPlayerRep is below.
So I think I got it working correctly. Here is my Set Rep Packet. It works how I want it to, but my question, is this the best way to do it, or is there a different way?
Code:
Public Sub SetPlayerRep(ByVal Index As Long, ByVal Rep As Long)
Player(Index).Char(TempPlayer(Index).CharNum).Skills(Skills.Rep) = Rep
End SubSo I think I got it working correctly. Here is my Set Rep Packet. It works how I want it to, but my question, is this the best way to do it, or is there a different way?
Code:
' ::::::::::::::::::::
' :: Set Rep Packet ::
' ::::::::::::::::::::
Private Sub HandleSetRep(ByVal Index As Long, ByRef Parse() As String)
Dim n As Long
Dim i As Long
Dim r As Long
n = FindPlayer(Parse(1))
' The access
i = CLng(Parse(2))
r = Player(n).Char(TempPlayer(n).CharNum).Skills(Skills.Rep)
Call SetPlayerRep(n, (r + 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