06.10.2013, 12:03
The following would be a working /goto command using ZCMD and sscanf...:
I'm not saying use it, I'm saying look how we get the player's position and then set the player's position.
pawn Код:
CMD:goto(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /goto [playerid/name]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected.");
new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid, x, y, z);
SetPlayerPos(playerid, x, y+2, z);
SendClientMessage(playerid, 0xFFFFFFFF, "{AFAFAF}You've been teleported to the requested ID.");
return 1;
}