Print Page | Close Window

Set Player Sprite (Dragoons Master)

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=123
Printed Date: 20 December 2006 at 5:52pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Set Player Sprite (Dragoons Master)
Posted By: Sync
Subject: Set Player Sprite (Dragoons Master)
Date Posted: 11 February 2006 at 2:37pm
Originally posted by Dragoons Master

In 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




Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info