[FilterScript] Stunt/Freeroam - Save 3 positions and teleport back to them!
#1

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:


Код:
 /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;
}
Download through Pastebin: http://pastebin.com/bsMkLVzr
Reply
#2

Good job simple and cool,Maybe in next version you could use dialogs or TDs
Reply
#3

Thanks.
Reply
#4

Quote:
Originally Posted by shadowstorm
Посмотреть сообщение
Good job simple and cool,Maybe in next version you could use dialogs or TDs
Thanks for your feedback. I will use dialogs in the next version of this script.
Reply
#5

good job
Reply
#6

Goodwork
Reply
#7

would be better if you could minimize it to 2 commands, save the facing angle too and minimize the arrays to 4, each with numerous slot for positions.

HINT: use sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)