GoToPoint: Help?
#1

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.
Reply
#2

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;
}
Reply
#3

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 ^^^
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)