SA-MP Forums Archive
SKin help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SKin help (/showthread.php?tid=387380)



SKin help - Mustafa6155 - 24.10.2012

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


Re: SKin help - Mustafa6155 - 24.10.2012

please help


Re: SKin help - AaronKillz - 24.10.2012

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");



Re: SKin help - Youice - 24.10.2012

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;




Re: SKin help - Mustafa6155 - 24.10.2012

no only lock the skin where add that ongamemodeinit


Re: SKin help - Mecie_Jam - 24.10.2012

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