Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Creating a Refresh button


Sowether
 Share

Recommended Posts

Sometimes, when you are passing from a map to another, we get trapped with the message: "Receiving map…" So to try to fix this problem I created a Refresh button that will make you teleport to the same place and get out of this terrible message. I hope you like it and be usefull for you.  :embarrassed:

**In the Client Side:**
_Go to _frmMirage_ and create a Picture Box exactly on the place you want the button_
**Click once in the Picture box**
And under the options go to Picture and select the picture that you want to be the button
**Click twice on the button**
This will open the code window

Under the code:

> Private Sub "NAME OF YOUR PICTURE BOX"_Click()

Add This:

> Call SendData("refresh" & END_CHAR)
>     MyText = vbNullString

Then search for this:

> ' Refresh Player
> If LCase$(Mid$(MyText, 1, 8)) = "/refresh" Then
>             Call SendData("refresh" & END_CHAR)
>             MyText = vbNullString
>             Exit Sub
>         End If

And delete everything

**Now in Server Side**

Search for:

> Public Sub Packet_Refresh(ByVal Index As Long)

Change for this:

> Public Sub Packet_Refresh(ByVal index As Long)
>     Call PlayerMsg(index, "Your map has been reloaded!", 14)
>     Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
>     Call SendPlayerData(index)
> End Sub)

Ok….. That's it
Sorry about my bad English...  I'm Brazilian
Hope you like it
Link to comment
Share on other sites

actually that wouldnt work.

Refresh doesnt refresh the players mapn it does its co-ordinates in 2.7

solution:

Change:
```
Public Sub Packet_Refresh(ByVal Index As Long)
    Call SendDataToMap(GetPlayerMap(Index), "playerxy" & SEP_CHAR & Index & SEP_CHAR & GetPlayerX(Index) & SEP_CHAR & GetPlayerY(Index) & END_CHAR)
End Sub

```
To:
```
Public Sub Packet_Refresh(ByVal Index As long)
    Call PlayerWarp(index, GetPlayerMap(index), GetPlayerX(Index), GetPlayerY(Index))
End Sub

```
Link to comment
Share on other sites

@[THE-KRIS:

> link=topic=51594.msg542299#msg542299 date=1252492465]
> Offtopic: Sigait why the prince of light? everyone knows darkness is better. they have the cooler weapons and demons :P

Lol I like it the way it is.@[God:

> Owen link=topic=51594.msg542301#msg542301 date=1252492688]
> i make a hotkey command that just uses the playerwarp which is handled server side. The server holds your correct coordinates..so..yeah, it works.

I just made a command /maprefresh and warped the player the way i said before.

Sigait.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...