i grabbed this from somewhere off of the forums i don't know who made it but credits to them
Код:
// Skins
#define MIN_SKIN_ID 0
#define MAX_SKIN_ID 299
IsInvalidSkin(skinid)
{
#define MAX_BAD_SKINS 14
new badSkins[MAX_BAD_SKINS] = {
3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 273, 289
};
for (new i = 0; i < MAX_BAD_SKINS; i++) {
if (skinid == badSkins[i]) return true;
}
return false;
}
just shove that in your script somewhere and an example of it in use is :
Код:
if (IsInvalidSkin(moneys[playerid]) || moneys[playerid] < MIN_SKIN_ID || moneys[playerid] > MAX_SKIN_ID)
{
GetPlayerName(ClickedPlayerID[playerid], clickedplayer, sizeof(clickedplayer));
format(string, sizeof(string), "Set Skin - %s (ID:%d)",clickedplayer,ClickedPlayerID[playerid]);
format(string2, sizeof(string2), "Current Skin: %d\n\nInvalid Skin ID\n\nEnter Skin ID:",GetPlayerSkin(ClickedPlayerID[playerid]));
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_INPUT,string,string2,"Set Skin", "Back");
return 1;
}
this is for my dialogs to check that the player hasn't input a bad skin
i hope this helps
EDIT: i didnt read the post properly if you want to split try using case: ?