Quote:
Originally Posted by Rachael
strcmp is better when you have a command which has only one ( string ) parameter
and strtok is better when you have a command with an indeterminate number of parameters
pawn Код:
CMD:gethere(playerid,params[]) { new tmp[25],idx,targetid new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); tmp = strtok(params, idx); while(strlen(tmp) > 0) { targetid = ReturnUser(tmp); if(IsPlayerConnected(targetid)) { SetPlayerPos(targetid,x,y+1,z); } tmp = strtok(params,idx); } return 1; }
ps: this is just a rough example
|
Zcmd + sscanf(2) is best no matter how many params you have.
And never, ever, ever, ever, ever! use strtok together with zcmd.
That's like putting a Lada engine in a Ferrari, just ridiculous.