pawn Код:
if(strcmp("/skin", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10,198.9780,-127.8640,1003.5152))
{
new tmp[128];
tmp = strtok (cmdtext, idx);
if(!strlen(tmp)) SendClientMessage(playerid, COLOR_RED, "USAGE: /skin [ID]");
else if(!IsValidSkin(strval(tmp))) SendClientMessage(playerid, COLOR_RED, "Invalid Skin ID.");
else SetPlayerSkin(playerid, strval(tmp));
}
else SendClientMessage(playerid, COLOR_RED, "You must be in the clothing store.");
return 1;
}
stock IsValidSkin(skinid) // place this somewhere in your script, make sure it's not in any other code brackets {}
{
#define MAX_BAD_SKINS 22
new badSkins[MAX_BAD_SKINS] =
{
3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 265, 266, 267,
268, 269, 270, 271, 272, 273, 289
};
if(skinid < 0 || skinid > 299) return false;
for(new i = 0; i < MAX_BAD_SKINS; i++)
{
if(skinid == badSkins[i]) return false;
}
#undef MAX_BAD_SKINS
return true;
}