30.12.2012, 20:03
The problem is that you are using integers, while coordinates are floats.
It should be like this:
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]");