SA-MP Forums Archive
/setskin only for Human Team - 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: /setskin only for Human Team (/showthread.php?tid=380267)



/setskin only for Human Team - Blackazur - 24.09.2012

How can i make that Zombies can't change Skin? He are the /setskin Command:

Quote:

COMMAND:setskin(playerid, params[])
{
new skin,string[60];
if(sscanf(params,"i", skin)) return SendClientMessage(playerid, -1,"[ADMIN] /setskin [SkinModel]");
if(invalidskin(skin,0,-0,-1,,-,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,99,92,74,-23,-24,-25,-26,-27,-28,)) return SendClientMessage(playerid,-1,"You can't use that skin, choose another.");
if(0 > skin > 299) return SendClientMessage(playerid, -1, "You've inserted a wrong skin ID. Choose from 0-299");
format(string, sizeof(string),"%s your Skin ID now is %d.", getname(playerid), skin);
SendClientMessage(playerid, 0x47568497, string);
SetPlayerSkin(playerid, skin);
return true;
}
invalidskin(skin,...)
{
static i,u;
u = numargs();
i = 0;
for(; i < u; ++i)
if(skin == getarg(i)) return true;
return false;
}
getname(playerid)
{
static name[24];
GetPlayerName(playerid,name,sizeof name);
return name;
}




Re: /setskin only for Human Team - trapstar2020 - 24.09.2012

if(gTeam[playerid != Human Team) return SendClientMessage(stuff);


Re: /setskin only for Human Team - Jarnu - 24.09.2012

next time use your code in [ pawn ] [ /pawn ] (*without space)

OT: Tip:
The following code must be used to block a command for a particular team
(*you need to edit following according to your vars.. its just an example.. else you have to do it on your own*)
pawn Код:
if(gTeam[playerid] != TEAM_HUMAN) //You need to edit it according to your team variable!
{
   SendClientMessage(playerid, 0xFF0000FF,"You cannot use this command");
}



AW: /setskin only for Human Team - Blackazur - 24.09.2012

@trapstar And under what I must paste it?

@Jarnu Thx, i will test it.


AW: /setskin only for Human Team - Blackazur - 24.09.2012

Work thx, but i have a other Question but i ask it in this Topic, how can i make that nobody can use the CJ Skin? I have remove the Skin 0, but Players can make -500000 or -200 and he have then the CJ SKin. How can i it completly remove?


Re: /setskin only for Human Team - xMCx - 24.09.2012

pawn Код:
if(skin < 1||skin > 299) return(~~~)//try this



AW: /setskin only for Human Team - Blackazur - 24.09.2012

Work now all, thanks for Help all.