17.06.2013, 21:55
Try this:
pawn Код:
// Credits to whoever made this
stock IsValidSkin(skinid)
{
new badSkins[22] =
{ 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289 };
if(skinid > 299 || skinid < 0) return 0;
for(new i = 0; i < 22; i++)
{
if(skinid == badSkins[i]) return 0;
}
return 1;
}
pawn Код:
case DIALOG_SKIN:
{
if(response)
{
new skinid;
skinid = strval(inputtext);
if(IsValidSkin(skinid))
{
if(skinid == 280 || skinid == 281 || skinid == 282 || skinid ==283 || skinid ==288 || skinid ==284 || skinid ==285 || skinid ==286 || skinid ==287)return SendClientMessage(playerid, GREY, "This skin is restricted, therefore you can't use it.");
if(skinid ==277 || skinid == 278 || skinid ==279 || skinid ==274 || skinid ==275 || skinid == 276)return SendClientMessage(playerid, GREY, "This skin is restricted, therefore you can't use it.");
Player[playerid][Clothes1] = skinid;
SetPlayerSkin(playerid, skinid);
SendClientMessage(playerid, WHITE, ""GREEN_EMBED"Character Creation ~ "WHITE_EMBED"Completed");
}
else
{
SendClientMessage(playerid, WHITE, ""GREEN_EMBED"Character Creation ~ "WHITE_EMBED"INVALID SKIN ID");
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, ""GREEN_EMBED"Skin selection",""WHITE_EMBED"Input the ID of the skin you wish to use.\n\nIf you do not know, please input ID 0 for default","Choose","");
}
}
}