SA-MP Forums Archive
Problem with GetPlayerWantedLevel and GetPlayerTeam or OnPlayerUpdate - 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: Problem with GetPlayerWantedLevel and GetPlayerTeam or OnPlayerUpdate (/showthread.php?tid=91901)



Problem with GetPlayerWantedLevel and GetPlayerTeam or OnPlayerUpdate - ronyx69 - 17.08.2009

Код:
public OnPlayerUpdate(playerid)
	{
	GetPlayerPos(playerid, UpdateX, UpdateY, UpdateZ);
	if(GetPlayerWantedLevel(playerid)>0&&GetPlayerTeam(playerid)==TEAM_CIV)
		{
		print("is wanted and civ");
		for(new i = 0; i < GetMaxPlayers(); i++)
		{
			if(GetPlayerTeam(i)==TEAM_COP)
				{
				print("is cop somewhere");
				if(PlayerToPoint(2, i, UpdateX, UpdateY, UpdateZ))
					{
					print("someone busted");
					SpawnPlayer(playerid);
					ResetPlayerWeapons(playerid);
					SetPlayerHealth(playerid, 100);
					SetPlayerPos(playerid, -2631.6670, 1360.6400, 7.1086);
					}
				}
			}
		}
	return 1;
	}
Even
Код:
print("is wanted and civ");
is not called, but the TEAM_CIV is set on spawn and i set my TEAM_COP with a command but i don't know why it's not working.


Re: Problem with GetPlayerWantedLevel and GetPlayerTeam or OnPlayerUpdate - kc - 17.08.2009

http://forum.sa-mp.com/index.php?topic=115828.0


Re: Problem with GetPlayerWantedLevel and GetPlayerTeam or OnPlayerUpdate - dice7 - 17.08.2009

GetPlayerTeam and SetPlayerTeam are bugged. Create your own team variable, like gTeam[playerid] or something


Re: Problem with GetPlayerWantedLevel and GetPlayerTeam or OnPlayerUpdate - ronyx69 - 17.08.2009

Quote:
Originally Posted by dice7
GetPlayerTeam and SetPlayerTeam are bugged. Create your own team variable, like gTeam[playerid] or something
Thanks.