How do I make a command require a specific skin?
#1

I am trying to make a command require a certain skin.
Basically, I want a command that gives you guns but you need to be a certain skin.
How would I do it?
I have ******d to the ends of the earth and found nothing helpful.
Reply
#2

Only skin ID 50 can use that command:
pawn Код:
COMMAND:guns(playerid, params[])
{
    if(GetPlayerSkin(playerid) != 50) return SendClientMessage(playerid, 0xFF0000AA, "You only skin id 50 can use this command!");
    {
        //Code
    }
    return true;
}
Reply
#3

No, before I made a command that required a specific skin but I forget it now. And I use the default command format.
Reply
#4

It would be along the lines of the below.

pawn Код:
if(strcmp(cmdtext,"/armour",true) == 0){
        if(GetPlayerSkin(playerid) == 101)
        {
            SetPlayerArmour(playerid,100);
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You don't have the required skin to use this command!");
            return 1;
        }
        return 1;
    }
Reply
#5

Thanks!!
+1 rep

EDIT: How can I make it for multiple skins?
Reply
#6

pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        if(GetPlayerSkin(playerid) == SKINID_1 || GetPlayerSkin(playerid) == SKINID_2)
        {
            // Do something here
        }
        return 1;
    }
.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)