Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Right click warping
#1
Dunno if this is already up but here ya go, really simple

Clientside
frmMirage, Replace:
Code:
Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
    Call EditorMouseDown(Button, Shift, X, y)
    Call PlayerSearch(Button, Shift, X, y)
End Sub

With
Code:
Private Sub picScreen_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    Call EditorMouseDown(Button, Shift, x, y)
    Call PlayerSearch(Button, Shift, x, y)
    
' Right Click Warping
If InEditor = False Then
         If Button = 2 Then
          Dim Packet As String
          x = Int(x / 32)
          y = Int(y / 32)
          Packet = "RIGHTWARP" & SEP_CHAR & x & SEP_CHAR & y & END_CHAR
          Call SendData(Packet)
     End If
Else
     Exit Sub
End If
End Sub

You could also add
Code:
If Player(MyIndex).Access >= 1 Then
          
    End if
which makes it only available to level 1 admins and up, which you would wanna do.




Serverside
HandleData, Add anywhere
Code:
' ::::::::::::::::::::::::::::::::
    ' :: Right Click Warping Packet ::
    ' ::::::::::::::::::::::::::::::::
    If LCase(Parse(0)) = "Rwarping" Then
        ' Prevent hacking
        If GetPlayerAccess(index) < ADMIN_MONITOR Then
            Call HackingAttempt(index, "Admin Cloning")
            Exit Sub
        End If
        X = Parse(1)
        y = Parse(2)
    Call PlayerWarp(index, GetPlayerMap(index), X, y)
    End If

Now it's easy to add but your gonna wanna edit it not to work whilst in the Mapeditor. Since while editing maps, right clicking deletes the tile. If you try to Rwarp while editing the map it'll warp you and close the editor.
EDIT: Added statement to cancel out when editor is open Wink
Reply
#2
Does this work with MS4? I'm assuming no.
Reply
#3
Probably not, but it shouldn't be that hard to convert it by looking at ms4. Just turn the serverside into a Sub and trim the mousedown. If anyone requests i'll be sure to put up the ms4 version as well
Reply
#4
Just wanted to throw in that you should check access server side, other than that, it's gravy.
Reply
#5
added serverside check on original post, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)