PDA

View Full Version : How do I make a command require a specific skin?


Hiukuss
28/09/2011, 09:56 PM
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.
http://www.geekosophical.net/wp-content/uploads/2007/05/halp-cat.jpeg

Laronic
28/09/2011, 10:01 PM
Only skin ID 50 can use that command:

COMMAND:guns(playerid, params[])
{
if(GetPlayerSkin(playerid) != 50) return SendClientMessage(playerid, 0xFF0000AA, "You only skin id 50 can use this command!");
{
//Code
}
return true;
}

Hiukuss
28/09/2011, 10:13 PM
No, before I made a command that required a specific skin but I forget it now. And I use the default command format.

bob_dillan
28/09/2011, 11:13 PM
It would be along the lines of the below.

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

Hiukuss
29/09/2011, 12:09 AM
Thanks!!
+1 rep :D

EDIT: How can I make it for multiple skins?

Scenario
29/09/2011, 12:14 AM
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) == SKINID_1 || GetPlayerSkin(playerid) == SKINID_2)
{
// Do something here
}
return 1;
}

.....