two commands in one [sscanf]
#9

Quote:
Originally Posted by wups
Посмотреть сообщение
People! So much examples, but you forget that sscanf returns 0 when used INCORRECTLY
So this:
pawn Код:
CMD:stuff(playerid,params[])
{
    new otherid;
    if(!isnull(params))
    {
        if(sscanf(params,"'kick'd",otherid))
        {
            Kick(otherid);
        }
       
        if(sscanf(params,"'ban'd",otherid))
        {
            Ban(otherid);
        }
    }
    return 1;
}
Should be
pawn Код:
CMD:stuff(playerid,params[])
{
    new otherid;
    if(!isnull(params))
    {
        if(!sscanf(params,"'kick'd",otherid))
        {
            Kick(otherid);
        }
       
        if(!sscanf(params,"'ban'd",otherid))
        {
            Ban(otherid);
        }
    }
    return 1;
}
Meh, my bad.
I owe you cokiees.

EDIT: I think there's no need isnull check.
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)