SA-MP Forums Archive
Allow only specific Skins - 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: Allow only specific Skins (/showthread.php?tid=89343)



Allow only specific Skins - Memoryz - 01.08.2009

Hi,

I've been coding a gate system, but the only thing left is that only specific skins are allowed to use the /open command.

I know it has something to do with GetPlayerSkin, but I just can't figure out what it is.

Im trying to only allow these skin IDs to use the /open command: 280,281,282,283,288,284,and 285.

How can I do this?



Re: Allow only specific Skins - Memoryz - 01.08.2009

*Bump*

Was already on the third page...

Come'on guys! Im trying to learn Pawn, but im having a problem...


Re: Allow only specific Skins - Hecky - 01.08.2009

Код:
new tmp[3];
tmp=GetPlayerSkin(playerid);
if( (tmp == 280) || (tmp == 281) || (tmp == 282) || (tmp == 283) || (tmp == 288) || (tmp == 284) || (tmp == 285) )
{
(open gate stuff)
}
else
{
SendClientMessage(playerid,COLOR,"Error : You are not allowed to use this command");
}
Something like this? I havent done this is a long time



Re: Allow only specific Skins - member - 01.08.2009

yes something like that. Or like that:
pawn Код:
if(!strcmp(cmdtext,"/opengate",true,9))
    {
        if(GetPlayerSkin(playerid) == 271) // IF PLAYER'S SKIN IS 271
        {
        if(GetPlayerSkin(playerid) == 271)
        SendClientMessage(playerid,0xAA3333AA,"Gate Opening...");
        /// Gate Open Code here
        }
        else SendClientMessage(playerid,AAD_COLOR_WHITE,"You do not have the correct skin to open the gate!");
        return 1;
    }