Allow only specific Skins
#1

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?
Reply
#2

*Bump*

Was already on the third page...

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

Код:
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
Reply
#4

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;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)