SA-MP Forums Archive
[HELP] How to lock a certain skin id to a player's name? - 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: [HELP] How to lock a certain skin id to a player's name? (/showthread.php?tid=285745)



[HELP] How to lock a certain skin id to a player's name? - ChaosLad - 25.09.2011

As the title says. I've been looking around for this but I can't find anything.

Thanks!


Re: [HELP] How to lock a certain skin id to a player's name? - Redgie - 25.09.2011

When the player tries to request a skin, run a loop through all online players to see if somebody else is using that skin.


Re: [HELP] How to lock a certain skin id to a player's name? - grand.Theft.Otto - 25.09.2011

Give this a try, change my name to your name or someone elses name

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new skin = GetPlayerSkin(playerid);
   
    new name[24];
    GetPlayerName(playerid,name,24);
   
    if(skin == 294) // if they request to spawn with skin 294 (woozie)
    {
        if(strcmp(name, "grandTheftOtto", true) == 1) // checking if grandTheftOtto is the name
        {
            return SendClientMessage(playerid,-1,"Welcome Back grandTheftOtto, Enjoy Your Skin!");
        }
        else // if the name isn't grandTheftOtto , the spawn will fail
        {
            return SendClientMessage(playerid,-1,"Spawn Failed. This Skin Is Reserved For grandTheftOtto!");
        }
    }
    return 1;
}