SA-MP Forums Archive
GoToPoint: Help? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GoToPoint: Help? (/showthread.php?tid=253673)



GoToPoint: Help? - Dokins - 07.05.2011

Im trying to get to a specific location by co-ordinates in-game on my script, it doesnt have such a command would anyone be able to tell me if there is a FS available or the code.

Thanks in advance

Grant.


Re: GoToPoint: Help? - Laronic - 07.05.2011

Like this? using zcmd and sscanf
pawn Код:
COMMAND:gotopos(playerid, params[])
{
    new Float:PosX, Float:PosY, Float:PosZ;
    if(sscanf(params, "fff", PosX, PosY, PosZ)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /gotopos (x) (y) (z)");
    {
        new string[128];
        format(string, sizeof(string), "You have teleported to X: %f Y: %f Z: %f", , PosX, PosY, PosZ);
        SendClientMessage(playerid, 0xFFFFFFAA, string);
        SetPlayerPos(playerid, PosX, PosY, PosZ);
    }
    return 1;
}



Re: GoToPoint: Help? - randomkid88 - 07.05.2011

If I understood correctly, you can use this command using ZCMD and sscanf:
pawn Код:
CMD:gotopoint(playerid, params[])
{
     new Float:X, Float:Y, Float:Z;
     if(sscanf(params, "fff", X, Y, Z)) return SendClientMessage(playerid, 0xFF0000, "Usage: /gotopoint X Y Z");
     else {
            SetPlayerPos(playerid, X, Y, Z);
            SendClientMessage(playerid, 0x00FF00, "You have successfully teleported");
     }
     return 1;
}

Too Slow... Or That one ^^^


Re: GoToPoint: Help? - Dokins - 07.05.2011

Thanks very much, so do I need to add to the script?