18.07.2012, 14:08
pawn Код:
if(strcmp(cmd, "/clothes", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtClothShop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE,"USAGE: /clothes [Skin ID]");
return 1;
}
new level = strval(tmp);
if(PlayerInfo[playerid][pSex] == 1)
{
if(level == femaleskin1 || level == femaleskin2) // add more female skins in femalesskin1/2 or add more || level
{
SendClientMessage(COLOR_CREAM, "Your gender cannot buy those skins.");
return 1;
}
}
else if(PlayerInfo[playerid][pSex] == 2)
{
if(level == maleskin1 || level == maleskin2) // add more male skins in malesskin1/2 or add more || level
{
SendClientMessage(COLOR_CREAM, "Your gender cannot buy those skins.");
return 1;
}
}
else if(level == 0 || level == 70 || level == 71 || level == 147 || level == 163 || level == 164 || level == 165 || level == 211 || level == 252 || level == 265 || level == 266 || level == 266 || level == 267 || level >= 274 && level <= 288)
{
SendClientMessage(playerid , COLOR_GRAD2, "That skin is not allowed !");
return 1;
}
GivePlayerMoney(playerid,-150);
SafeGivePlayerMoney(playerid, - 150);
if(!IsValidSkin(level))
return SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!");
PlayerInfo[playerid][pModel] = level;
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
}
}
return 1;
}