14.06.2011, 15:23
So I've made a /skin command but I'm trying to restrict skins unless your an admin, it works but I can only do one skin at a time, I'm trying to do multiple skins at a time..
this is the code:
So if someone who isn't an admin types /skin 280 is says you're not allowed to choose that skin, but I want say 280, 281, 282 etc. to be restricted, but I'm not sure what method to use. I thought about "enums" but wasn't sure how I would.
this is the code:
Код:
if(strcmp(cmd, "/skin", true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0x919191FF, "Usage: /skin [SKINID]"); return 1; } if(PlayerInfo[playerid][pAdmin] < 1 && strval(tmp) == 280) { SendClientMessage(playerid,COLOR_YELLOW," You're not allowed to choose that skin!"); return 1; } else if(IsAtClothShop(playerid) || PlayerInfo[playerid][pDonateRank] >= 1) { new chosenskin = strval(tmp); SetPlayerSkin(playerid, chosenskin); PlayerInfo[playerid][pModel] = chosenskin; return 1; } else { SendClientMessage(playerid, COLOR_YELLOW, " You are not inside a clothing store!"); } }