SKin help
#1

Can someone help me with how lock skins if he want to choose the skin but then comes an sendclient message
Reply
#2

please help
Reply
#3

Add a variable like: new lockskin;

In your skin command add
Код:
if(lockskin[playerid] == 1) return SendClientMessage(playerid, -1, "You cannot select skins.");
Do you want the player to not be able to use specific skins? If so, add
Код:
new skin; //to your command
Код:
if(skin //id) return SendClientMessage(playerid, -1, "Cannot use this skin");
Reply
#4

PHP код:
new RestrictedSkins[2][1] =//we are setting the locked skins (by placing them in one array)
{
{
294},
{
189}    //for examples
};

CMD:changeskin(playeridparams[])
{
    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(playeridstrval(params));
        
format(str18"Your Skin id: %d"strval(params));
        
SendClientMessage(playerid, -1str);
    }
    return 
1;

Reply
#5

no only lock the skin where add that ongamemodeinit
Reply
#6

Код:
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;
    }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)