09.04.2015, 19:35
Stunt/Freeroam - Save 3 positions and teleport back to them!
One thing that I always found when I joined a few servers is that you can save a teleport and then later teleport back to it. However, players like myself find to be very limited with just one single teleport.
This small filterscript will allow you to save 3 positions and then teleport back to them later! This is a simple piece of code, but I do see it as a necessary addon to many servers!
Any questions? Feel free to post them below. Thanks for reading!
Commands:
Download through Pastebin: http://pastebin.com/bsMkLVzr
One thing that I always found when I joined a few servers is that you can save a teleport and then later teleport back to it. However, players like myself find to be very limited with just one single teleport.
This small filterscript will allow you to save 3 positions and then teleport back to them later! This is a simple piece of code, but I do see it as a necessary addon to many servers!
Any questions? Feel free to post them below. Thanks for reading!
Commands:
Код:
/poshelp /savepos1 /savepos2 /savepos3 /gotopos1 /gotopos2 /gotopos3
pawn Код:
#include <a_samp>
#include <ZCMD>
new Float:PlayerPosX1[MAX_PLAYERS], Float:PlayerPosY1[MAX_PLAYERS], Float:PlayerPosZ1[MAX_PLAYERS];
new Float:PlayerPosX2[MAX_PLAYERS], Float:PlayerPosY2[MAX_PLAYERS], Float:PlayerPosZ2[MAX_PLAYERS];
new Float:PlayerPosX3[MAX_PLAYERS], Float:PlayerPosY3[MAX_PLAYERS], Float:PlayerPosZ3[MAX_PLAYERS];
CMD:poshelp(playerid, params[])
{
SendClientMessage(playerid, -1, "[Saved Positions] /savepos1 /savepos2 /savepos3");
SendClientMessage(playerid, -1, "[Saved Positions] /gotopos1 /gotopos2 /gotopos3");
return 1;
}
CMD:savepos1(playerid, params[])
{
GetPlayerPos(playerid, PlayerPosX1[playerid], PlayerPosY1[playerid], PlayerPosZ1[playerid]);
SendClientMessage(playerid, -1, "You have saved your position. You can get back here by using /gotopos1");
return 1;
}
CMD:gotopos1(playerid, params[])
{
SetPlayerPos(playerid, PlayerPosX1[playerid], PlayerPosY1[playerid], PlayerPosZ1[playerid]);
SendClientMessage(playerid, -1, "You have successfully teleported to this position!");
return 1;
}
CMD:savepos2(playerid, params[])
{
GetPlayerPos(playerid, PlayerPosX2[playerid], PlayerPosY2[playerid], PlayerPosZ2[playerid]);
SendClientMessage(playerid, -1, "You have saved your position. You can get back here by using /gotopos2");
return 1;
}
CMD:gotopos2(playerid, params[])
{
SetPlayerPos(playerid, PlayerPosX2[playerid], PlayerPosY2[playerid], PlayerPosZ2[playerid]);
SendClientMessage(playerid, -1, "You have successfully teleported to this position!");
return 1;
}
CMD:savepos3(playerid, params[])
{
GetPlayerPos(playerid, PlayerPosX3[playerid], PlayerPosY3[playerid], PlayerPosZ3[playerid]);
SendClientMessage(playerid, -1, "You have saved your position. You can get back here by using /gotopos3");
return 1;
}
CMD:gotopos3(playerid, params[])
{
SetPlayerPos(playerid, PlayerPosX3[playerid], PlayerPosY3[playerid], PlayerPosZ3[playerid]);
SendClientMessage(playerid, -1, "You have successfully teleported to this position!");
return 1;
}