14.05.2011, 16:04
Hi, im making a new server which is going to dm, i want to know how can i put the player in the cop team if he uses the copskins, Can anyone help/reply?
if(GetPlayerSkin(playerid) == 285)
{
GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
SetPlayerTeam(playerid, 0);
return 1;
}
Yes, ofcourse.
E.g you have a AddPlayerClass with the skin 285 (SWAT). You could add this to your "OnPlayerRequestClass" callback: pawn Код:
|
stock CopSkins(playerid)
{
new skin = GetPlayerSkin(playerid);
switch(skin)
{
case 285:
{
return true;
}
case 280:
{
return true;
}
case 281:
{
return true;
}
default:
{
return false;
}
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(HasCopSkin(playerid))
{
GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
SetPlayerTeam(playerid, 0);
}
return 1;
}
stock HasCopSkin(playerid)
{
switch(GetPlayerSkin(playerid))
{
case 280..281, 285: return 1;
default: return 0;
}
return 0;
}