24.10.2012, 15:05
Can someone help me with how lock skins if he want to choose the skin but then comes an sendclient message
if(lockskin[playerid] == 1) return SendClientMessage(playerid, -1, "You cannot select skins.");
new skin; //to your command
if(skin //id) return SendClientMessage(playerid, -1, "Cannot use this skin");
new RestrictedSkins[2][1] =//we are setting the locked skins (by placing them in one array)
{
{294},
{189} //for examples
};
CMD:changeskin(playerid, params[])
{
new rSkins = sizeof(RestrictedSkins), str[18];
if(sscanf(params, "d", params)) return SendClientMessage(playerid, -1, "Usage: /changeskin [skinid]");//usage message(if he misused the command)
if(strval(params) == RestrictedSkins[rSkins][0])//if locked skins it will return a message
{
return SendClientMessage(playerid, -1, "The skin id you typed is restricted, choose another one");
}
else {//else if not a locked one
SetPlayerSkin(playerid, strval(params));
format(str, 18, "Your Skin id: %d", strval(params));
SendClientMessage(playerid, -1, str);
}
return 1;
}
public OnPlayerRequestSpawn(playerid) { new skin = GetPlayerSkin(playerid); new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if((skin == 240) && (strcmp(name, "NAME FOR DUDE", true) == 1)) { SendClientMessage(playerid,COLOR_RED,"This Skin Is Locked For Fool........"); SetPlayerHealth(playerid,0); return 0; }