Sscanf help!
#4

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
Delete "GetPlayerName(pid, player, 25);" and put it before "format(string, sizeof(string),"**You have successfully teleported to %s!**",player);".
Thanks it worked.

One more question is my server.exe I get this message when using my Kick Command.

"Strings without a length are depreciated please add a destination size."

pawn Код:
command(kick, playerid, params[])
{
    new admin[25];
    new pid;
    new player[25];
    new reason[128];
    new string[128];
   
    GetPlayerName(playerid, admin, 25);
    if(sscanf(params, "us", pid, reason)) return SendClientMessage(playerid, COLOUR_WHITE, "Hint: /kick [Playerid/Name] [Reason]");
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOUR_WHITE, "That player ID is not connected.");
    GetPlayerName(pid, player, 25);
    format(string, sizeof(string),"**Server Admin %s has kicked %s. Reason: %s.**",admin, player, reason);
    SendClientMessageToAll(COLOUR_ALERT,string);
    SendClientMessage(pid, COLOUR_WHITE, "You have been kicked!" );
    Kick(pid);
    return 1;
}
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: 3 Guest(s)