| Mirage Source http://web.miragesource.net/forums/ |
|
| Right click warping http://web.miragesource.net/forums/viewtopic.php?f=210&t=4462 |
Page 1 of 1 |
| Author: | Forte [ Fri Sep 26, 2008 1:05 am ] |
| Post subject: | Right click warping |
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 |
|
| Author: | Nean [ Fri Sep 26, 2008 2:42 am ] |
| Post subject: | Re: Right click warping |
Does this work with MS4? I'm assuming no. |
|
| Author: | Forte [ Fri Sep 26, 2008 3:07 am ] |
| Post subject: | Re: Right click warping |
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 |
|
| Author: | Rian [ Fri Sep 26, 2008 4:14 am ] |
| Post subject: | Re: Right click warping |
Just wanted to throw in that you should check access server side, other than that, it's gravy. |
|
| Author: | Forte [ Fri Sep 26, 2008 10:43 am ] |
| Post subject: | Re: Right click warping |
added serverside check on original post, thanks |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|