Dm 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dm Team (
/showthread.php?tid=255166)
Dm Team -
Sid_Alexander - 14.05.2011
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?
Re: Dm Team -
Biesmen - 14.05.2011
Yes, ofcourse.
E.g you have a AddPlayerClass with the skin 285 (SWAT).
You could add this to your "OnPlayerRequestClass" callback:
pawn Код:
if(GetPlayerSkin(playerid) == 285)
{
GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
SetPlayerTeam(playerid, 0);
return 1;
}
Etc
Re: Dm Team -
Sid_Alexander - 14.05.2011
Thank you so much! But how can i then make all the cops the same?
Quote:
Originally Posted by Biesmen
Yes, ofcourse.
E.g you have a AddPlayerClass with the skin 285 (SWAT).
You could add this to your "OnPlayerRequestClass" callback:
pawn Код:
if(GetPlayerSkin(playerid) == 285) { GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3); SetPlayerTeam(playerid, 0); return 1; }
Etc
|
Re: Dm Team -
Biesmen - 14.05.2011
I do not understand your question, same what?
Re: Dm Team -
Sid_Alexander - 14.05.2011
Quote:
Originally Posted by Biesmen
I do not understand your question, same what?
|
the code you provided worked fine, but the problem is it only makes the skin 285 in cop team, i want from 280-289 skins to be in a cop team, so how will i do that?
Re: Dm Team -
Biesmen - 14.05.2011
Add more skins.
You could try this:
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;
}
Re: Dm Team -
Seven_of_Nine - 14.05.2011
Quote:
Originally Posted by Biesmen
Yes, ofcourse.
pawn Код:
GameTextForPlayer(playerid, "~b~S.W.A.T", 5000, 3);
|
I recommend a TextDraw instead. :]
Re: Dm Team -
PotH3Ad - 14.05.2011
Edited Biesmen's code a bit
pawn Код:
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;
}
Re: Dm Team -
Biesmen - 14.05.2011
PotH3Ad, thanks for that. But I just tried to do it on an easy way, because he's a beginner.
Seven_of_Nine:
I don't, creating unecessarily variables for a textdraw is just... unecessarily.
Re: Dm Team -
Sid_Alexander - 14.05.2011
Quote:
Originally Posted by Biesmen
PotH3Ad, thanks for that. But I just tried to do it on an easy way, because he's a beginner.
Seven_of_Nine:
I don't, creating unecessarily variables for a textdraw is just... unecessarily.
|
listen can i also make cops spawn on lspd stairs? i have a gRandomspawns and gCopplayerspawns