two commands in one [sscanf]
#1

why dont this work

i want it like

/stuff <ban> <id> <reason>
/stuff <kick> <id>

here is code
pawn Код:
CMD:stuff(playerid,params[])
{
    new cmd[128], otherid, reason[128];
    if(sscanf(params,"s[128]",cmd))
    {
        if(strcmp(cmd, "kick", true))
        {
            if(sscanf(params,"u",otherid))
            {
                Kick(otherid);
            }
        }
       
        if(strcmp(cmd, "ban", true))
        {
            if(sscanf(params,"us[128]",otherid,reason))
            {
                BanEx(otherid,reason);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
two commands in one [sscanf] - by Unknown123 - 19.09.2011, 16:35
Re: two commands in one [sscanf] - by =WoR=Varth - 19.09.2011, 16:41
Re: two commands in one [sscanf] - by Unknown123 - 19.09.2011, 16:43
Re: two commands in one [sscanf] - by =WoR=Varth - 19.09.2011, 16:46
Re: two commands in one [sscanf] - by Unknown123 - 19.09.2011, 16:51
Re: two commands in one [sscanf] - by =WoR=Varth - 19.09.2011, 16:59
Re: two commands in one [sscanf] - by [MWR]Blood - 19.09.2011, 17:04
Re: two commands in one [sscanf] - by wups - 19.09.2011, 18:46
Re: two commands in one [sscanf] - by =WoR=Varth - 19.09.2011, 18:50
Re: two commands in one [sscanf] - by DRIFT_HUNTER - 19.09.2011, 19:06

Forum Jump:


Users browsing this thread: 1 Guest(s)