/setskin only for Human Team
#1

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

Reply
#2

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

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");
}
Reply
#4

@trapstar And under what I must paste it?

@Jarnu Thx, i will test it.
Reply
#5

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

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

Work now all, thanks for Help all.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)