How do I make a command require a specific skin? - 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: How do I make a command require a specific skin? (
/showthread.php?tid=286452)
How do I make a command require a specific skin? -
Hiukuss - 28.09.2011
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.
Re: How do I make a command require a specific skin? -
Laronic - 28.09.2011
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;
}
Re: How do I make a command require a specific skin? -
Hiukuss - 28.09.2011
No, before I made a command that required a specific skin but I forget it now. And I use the default command format.
Re: How do I make a command require a specific skin? -
bob_dillan - 28.09.2011
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;
}
Re: How do I make a command require a specific skin? -
Hiukuss - 29.09.2011
Thanks!!
+1 rep
EDIT: How can I make it for multiple skins?
Re: How do I make a command require a specific skin? -
Scenario - 29.09.2011
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) == SKINID_1 || GetPlayerSkin(playerid) == SKINID_2)
{
// Do something here
}
return 1;
}
.....