28.01.2012, 14:11
i made this command:
but when you type -1 or 300+ number it doesnt show the message and playercrashes(Invalid skin id).
Код:
Код:dcmd_setskin(playerid, params[]) { if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[VIP] && gPlayerInfo[playerid][PLAYER_LEVEL] > gCommands[VIP]) { SendClientMessage(playerid, COLOR_ORANGE, "You must be an VIP to use that command!"); } else { new tmp[256], index, id; tmp = strtok(params, index); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ORANGE, "[SETSKIN] Usage: /setskin [SKIN ID]"); } else { id = strval(tmp); if(id >= 300 && id <= -1) { SendClientMessage(playerid,COLOR_LIGHTBLUE,"Invalid ID, Valid IDS: 0-299"); } else { SetPlayerSkin(playerid, id); } } } return 1; }