SA-MP Forums Archive
Limit a skin for 1 player to use only. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Limit a skin for 1 player to use only. (/showthread.php?tid=227071)



Limit a skin for 1 player to use only. - Ultima - 16.02.2011

I'm not quite sure that i explained this properly but how to make it so only 1 player can take a specific skin?
Not lock it to a name or anything, make it a regular skin but make it usable by only 1 player, such as protectthepresident has.


Re: Limit a skin for 1 player to use only. - Jefff - 16.02.2011

Try
pawn Код:
new SkinIsUsed[MAX_PLAYERS]={-1, ...};

//connect/disconnect
SkinIsUsed[playerid] = (-1);

public OnPlayerRequestClass(playerid, classid)
{
    SkinIsUsed[playerid] = classid;
    return 1;
}
public OnPlayerRequestSpawn(playerid)
{
    for(new d,g=GetMaxPlayers(); d < g; d++)
    {
        if((IsPlayerConnected(d)) && (d != playerid) && (SkinIsUsed[d] == SkinIsUsed[playerid])) return SendClientMessage(playerid,0xFFFFFFFF,"SERVER: That skin is used by someone") & 0;
    }
    return 1;
}



Re: Limit a skin for 1 player to use only. - Ultima - 16.02.2011

I'll check it out later, busy atm.


Re: Limit a skin for 1 player to use only. - admantis - 17.02.2011

That code will not work.


Re: Limit a skin for 1 player to use only. - Ultima - 21.02.2011

Tested it, didnt work for some reason.
Can anybody else offer a hand?