SA-MP Forums Archive
How to get it to check if in certain 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: How to get it to check if in certain team (/showthread.php?tid=121951)



How to get it to check if in certain team - JoeDaDude - 19.01.2010

Just like on a /goto or /gethere command for exmaple, You have:
pawn Код:
if(id == playerid)
To check if the player is trying to goto/gethere himself,
Well i want to do that, But to check if someones trying to arrest a fellow cop,
So i want the same code, But instead of checking on playerid, It checks for team,
How would i do that


Re: How to get it to check if in certain team - kamilbam - 19.01.2010

Just try it like that

Код:
if(gTeam[id] != gTeam[playerid])
{
  //do some stuff here
}
It's only an example.

or

Код:
if(gTeam[id] == gTeam[playerid])
{
  SendClientMessage(playerid,COLOR,"You bitch you are trying to arrest you fellah cop! no COOKIES"
}