Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cheat System[UNTESTED]
#1
Credits to GIAKEN
Mod on Elysium Source Forums.
Not sure if he's on these forums
I don't much look around.
This is all that he provided me
And
As soon as my coders reply to me on Elysium
I'm gonna add it to my game and test it :S
------------------------
Client-side:

Code:
Code:
Private Sub cmdSend_Click()
    Call SendData("cheatpacket" & SEP_CHAR & txtCheat.Text & END_CHAR))
End Sub


Server-side:

Code:
Code:
If Parse$(0) = "cheatpacket" Then
Dim Successful As Byte

    Successful = NO

    For I = 1 to MAX_CHEATS
        If Parse$(1) = Cheats(I).Name Then
            Call RunCheat(I)
            Successful = YES
            Exit For
        End If
    Next I

    If Not Successful Then
        Call AlertMsg("That's not a cheat!", Red)
        Exit Sub
    End If

Exit Sub
End If


That should work...just not sure about the AlertMsg, I don't have my source open. For the RunCheat it could be:

Code:
Code:
Public Sub RunCheat(ByVal Cheat_Index As Long)

    Select Case Cheat(Cheat_Index).Name
        Case "goldwhatever"
        ' give them gold?
    End Select

End Sub


Also don't forget:

Code:
Code:
Public Const MAX_CHEATS As Byte = 2
Cheat(1 To MAX_CHEATS) As CheatRec

Type CheatRec
    Name As String
End Type


Untested.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)