Quote:
Originally Posted by belhot1992
I tested it like this and it compiled fine in my script
pawn Код:
if(strcmp(cmd, "/setskin", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [Playerid/PartOfName] [skin id]"); return 1; } new string[128]; //remove this line if it gives errors about shadowed variables, etc new para1 = ReturnUser(tmp); new level = strval(tmp); new giveplayer[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(level > 299 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "You have set %s's skin to %d.", giveplayer,level); SendClientMessage(playerid, COLOR_GRAD2, string); SetPlayerSkin(para1, level); } } } else { SendClientMessage(playerid, COLOR_GRAD1, "You are not authorised to use that command."); } } return 1; }
|
I already got the cmd done from Kostas!! Thanks alot for the help mate.
Which cmd system should i use? zcmd/y_cmd/sscanf? which is easy to use?