help in sscanf
#7

Quote:
Originally Posted by Gazmull
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
    if(!IsPlayerAdmin(playerid)) return 1;
    new ID,Reason[128], string[128];
    if(sscanf(params, "us[128]", ID, Reason)) return SendClientMessage(playerid,WHITE,"USAGE: /Kick [ID] [Reason]");
    if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,"Player not found.");  
    format(string, sizeof(string),"*** %s Has been kicked by: %s. (%s)",GetName(ID),GetName(playerid),Reason);
    SendClientMessageToAll(RED,string);
    TogglePlayerControllable(ID,false);
    Kick(ID);
    return 1;
}
But i suggest to use ZCMD or DCMD.
Considering that code wouldn't work at all, it would be a good idea. Normal commands in OnPlayerCommandText do not have the 'params' variable.
Reply


Messages In This Thread
help in sscanf - by EviLpRo - 03.07.2011, 04:57
Re: help in sscanf - by PrawkC - 03.07.2011, 05:04
Re: help in sscanf - by EviLpRo - 03.07.2011, 05:22
Re: help in sscanf - by Mrminecraft202 - 03.07.2011, 06:00
Re: help in sscanf - by cessil - 03.07.2011, 06:33
Re: help in sscanf - by Gazmull - 03.07.2011, 06:42
Re: help in sscanf - by [HiC]TheKiller - 03.07.2011, 06:46
Re: help in sscanf - by EviLpRo - 03.07.2011, 08:43

Forum Jump:


Users browsing this thread: 1 Guest(s)