11.09.2011, 03:05
(
Последний раз редактировалось NaS; 11.09.2011 в 15:10.
)
OnPlayerMarkMap
Hey everyone!I'll keep it short..
I made a simple script for a system, which will let players mark a position on the map and transmit this to the server ("transmit" ...).
As I was bored, I created an include of this.
I wondered that nobody did (or released) something like this, since it's very very simple and easy to to.
This is the function for setting a player ready to mark:
Код:
SetPlayerMarkingMap(playerid,MarkID);
MarkID - A number used later to know, for what the position should be used.
And this is the callback which gets called when a player marked:
Код:
public OnPlayerMarkMap(playerid, MarkID, Float:X, Float:Y, Float:Z) { }
MarkID - This variable is filled with the number given in SetPlayerMarkingMap().
X, Y, Z - The coords of the marked position
How does this work exactly?!
It's is very simple:
First, you get frozen. Then you have to go to the Map (ESC->Map) and right click anywhere.
If you go back to the game, you'll see you get teleported to the selected position and this is the way it works!
The server will notice that your position changed and save the position. Then it will teleport you back to your last position and you'll be able to move again

Then the callback above will be called!
I don't know much uses for this, but I'm sure there are some!
Installation
Very easy, first download it below, then extract the mapmark.inc into your pawno/include directory.
Then put "#include <mapmark>" into your GM/FS.
(Btw, if you want to control "AllowAdminTeleport()" by yourself, then put "#define MAPMARK_ADMINTELEPORT" ABOVE the include line. Note: AllowAdminTeleport must be turned on to make this thing work!)
Copy the callback from above to your GM/FS, and your done using it!
Download
Megaupload - Click HERE
Pastebin - Click HERE
EXAMPLE for a GPS system.
Type /gps and then select a position at the map!
Pastebin - http://pastebin.com/8e3sWpYJ
I hope you'll find it useful!
Regards,
NaS