27.03.2012, 18:33
i'm just new to zcmd and sscanf and i was wondering on how to do something similar to strtok.
example:
the command is /setstat and there are several options, like money, level, skin, etc.
on the comment, it says "what should i do here?" and i mean what code should i put in to check the next parameter after the option which is level?
example:
the command is /setstat and there are several options, like money, level, skin, etc.
pawn Код:
command(setstat, playerid, params[])
{
new id, option[15];
sscanf(params, "us[15]", id, option);
if(isnull(id)) return SendClientMessage(playerid, -1, "usage: /setstat [playerid] [option]");
if(isnull(id) && isnull(option)) return SendClientMessage(playerid, -1, "usage: /setstat [playerid] [option]");
if(!strcmp(option, "level", true))
{
// what should i do here?
}
return 1;
}