Teleporting using coordinates
#2

The problem is that you are using integers, while coordinates are floats.

It should be like this:

pawn Код:
CMD:tp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 99998) {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
        return 1;
    }

    new string[128], giveplayerid, Float:X, Float:Y, Float:Z;
    if(sscanf(params, "ufff", giveplayerid, X, Y, Z)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tp [playerid] [X] [Y] [Z]");
   
    if(IsPlayerConnected(giveplayerid))
    {
        format(string, sizeof(string), "Administrator %s has teleported you.", GetPlayerNameEx(playerid));
        SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
        format(string, sizeof(string), "You have teleported %s.", GetPlayerNameEx(giveplayerid));
        SendClientMessageEx(playerid, COLOR_WHITE, string);
        SendClientMessageEx(giveplayerid, COLOR_GRAD1, "   You have been teleported!");
        SetPlayerPos(giveplayerid, X, Y, Z);
    }
    return 1;
}
pawn Код:
new string[128], giveplayerid, Float:X, Float:Y, Float:Z;
if(sscanf(params, "ufff", giveplayerid, X, Y, Z)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tp [playerid] [X] [Y] [Z]");
Reply


Messages In This Thread
Teleporting using coordinates - by Xlithan - 30.12.2012, 20:02
Re: Teleporting using coordinates - by Chriham3 - 30.12.2012, 20:03
Re: Teleporting using coordinates - by Xlithan - 31.12.2012, 13:37

Forum Jump:


Users browsing this thread: 1 Guest(s)