Originally posted by Dragoons MasterIn a normal admin menu you have only a comand to set your sprite... This makes that you can set another player sprite, =) Client Side: in frmMirage in your admin menu make a nem ComandButton named btnPlayerSprite and caption seted to Set Player Sprite Add this sub in the form:
Private Sub btnPlayerSprite_Click() If GetPlayerAccess(MyIndex) >= ADMIN_MAPPER Then If Trim(txtPlayer.Text) <> "" Then If Trim(txtSprite.Text) <> "" Then Call SendSetPlayerSprite(Trim(txtPlayer.Text), Trim(txtSprite.Text)) End If End If Else: Call AddText("You are not authorized to carry out that action", BrightRed) End If End Sub
In modClientTCP add this sub:
Sub SendSetPlayerSprite(ByVal Name As String, ByVal SpriteNum As Byte) Dim packet As String
packet = "SETPLAYERSPRITE" & SEP_CHAR & Name & SEP_CHAR & SpriteNum & SEP_CHAR & END_CHAR Call SendData(packet) End Sub
In modGamelogic, find:
' Setting sprite
under that add:
' Setting player sprite If LCase(Mid(MyText, 1, 16)) = "/setplayersprite" Then If Len(MyText) > 19 Then i = Val(Mid(MyText, 17, 1)) MyText = Mid(MyText, 18, Len(MyText) - 17) Call SendSetPlayerSprite(i, Val(MyText)) End If MyText = "" Exit Sub End If
Server Side: In modServerTCP find:
' :: Set sprite packet ::
under that add:
' :::::::::::::::::::::::::::::: ' :: Set player sprite packet :: ' :::::::::::::::::::::::::::::: If LCase(Parse(0)) = "setplayersprite" Then ' Prevent hacking If GetPlayerAccess(Index) < ADMIN_MAPPER Then Call HackingAttempt(Index, "Admin Cloning") Exit Sub End If ' The sprite i = FindPlayer(Parse(1)) n = Val(Parse(2)) Call SetPlayerSprite(i, n) Call SendPlayerData(i) Exit Sub End If
DONE! =D
|