Just answer me a thing about STRTOK:
#1

Everyone should know that on dcmd you basically do it for 1 parament:
pawn Код:
dcmd_kick(playerid,params[])
{
    new id = strval(params); // Basic example
    if(IsPlayerConnected(id)) Kick(id);
    return 1;
}
And with 2 or more paraments, you have to do it:
pawn Код:
dcmd_kick(playerid,params[])
{
    new id, reason,tmp[256],tmp2[256],Index;  
    tmp = strtok(params,Index);
    tmp2 = strtok(params, Index);
    if(!strval(tmp) && !strval(tmp2)) return false;
    else return Kick(id);
    return 1;
}

And on strtok/strcmp, for 1 parament:
pawn Код:
if(strcmp("/kick",cmdtext,true,10) == 0)
{
    new tmp[256],idx; tmp = strtok(cmdtext, idx);
    new id = strval(tmp);
    Kick(id);
    return 1;
}
But the question is: how do I do with over 1 parament using strcmp?
Reply


Messages In This Thread
Just answer me a thing about STRTOK: - by blackwave - 21.12.2010, 12:49
Re: Just answer me a thing about STRTOK: - by MadeMan - 21.12.2010, 12:51
Re: Just answer me a thing about STRTOK: - by JaTochNietDan - 21.12.2010, 12:51
Re: Just answer me a thing about STRTOK: - by blackwave - 21.12.2010, 12:58
Re: Just answer me a thing about STRTOK: - by JaTochNietDan - 21.12.2010, 13:01
Re: Just answer me a thing about STRTOK: - by Rachael - 21.12.2010, 13:04
Re: Just answer me a thing about STRTOK: - by blackwave - 21.12.2010, 13:09

Forum Jump:


Users browsing this thread: 2 Guest(s)