#4

The following would be a working /goto command using ZCMD and sscanf...:

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;
}
I'm not saying use it, I'm saying look how we get the player's position and then set the player's position.
Reply


Messages In This Thread
Wtf? - by Wizza - 06.10.2013, 11:58
Re: Wtf? - by Konstantinos - 06.10.2013, 12:00
Re: Wtf? - by Danialdano - 06.10.2013, 12:02
Re: Wtf? - by DanishHaq - 06.10.2013, 12:03
Re: Wtf? - by Danialdano - 06.10.2013, 12:08
Re: Wtf? - by Wizza - 06.10.2013, 12:09
Re: Wtf? - by Wizza - 06.10.2013, 12:11

Forum Jump:


Users browsing this thread: 2 Guest(s)