Quote:
Originally Posted by pds2k12
No idea why you needed strtok in there when you could simply use this code *command below*
pawn Код:
CMD:skin(playerid, params[]) { new skinid, string[128]; if(sscanf(params, "d", skinid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /s(kin) [skinID].");
if(0 >= skinid >= 300) return SendClientMessage(playerid, -1,"{FF0000}You can't use skin above 299 or lower than0.");//if the string bigger than 299 "strval(tmp) > 299" the skin won't set and send them error message
SetPlayerSkin(playerid, skinid); format(string, sizeof(string), "You have set your skinID to %d.", skinid); SendClientMessage(playerid, COLOR_GREEN, string); return true; }
|
That's exactly what I thought it should have been.
I'll try this now.
Edit: Works, +Rep'd you both for your effort, thanks lads.