Sscanf help!
#3

Quote:
Originally Posted by cloudysky
Посмотреть сообщение
pawn Код:
command(goto, playerid, params[])
{
    new admin[25];
    new pid;
    new player[25];
    new string[128];
   
    GetPlayerName(playerid, admin, 25);
    GetPlayerName(pid, player, 25);
    if(sscanf(params, "u", pid)) return SendClientMessage(playerid, COLOUR_WHITE, "Hint: /goto [Playerid/Name]");
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOUR_WHITE, "That player is not connected.");
    new Float:px, Float:py, Float:pz;
    GetPlayerPos(pid, px, py, pz );
    SetPlayerPos(playerid, px, py, pz );
    format(string, sizeof(string),"**You have successfully teleported to %s!**",player);
    SendClientMessage(playerid, COLOUR_TAN,string);
    return 1;
}
Thats my command everything works apart from it says "You've teleported to Cloudysky" even if you teleport to someone else.
Delete "GetPlayerName(pid, player, 25);" and put it before "format(string, sizeof(string),"**You have successfully teleported to %s!**",player);".
Reply


Messages In This Thread
Sscanf help! - by cloudysky - 12.07.2011, 12:34
Re: Sscanf help! - by Edvin - 12.07.2011, 12:47
Re: Sscanf help! - by Roko_foko - 12.07.2011, 12:54
Re: Sscanf help! - by cloudysky - 12.07.2011, 13:03
Re: Sscanf help! - by Vince - 12.07.2011, 13:08

Forum Jump:


Users browsing this thread: 1 Guest(s)