need help with automatic gates!
#1

Hi!
i just made automativ gates but then i wanted taht only one Team can use it.
(if(gTeam[playerid] == TEAM_NWC))
i have to put it in the gamemode. First there were warnings:
Код:
Warning) local variable "x" shadows a variable at a preceding level
same with "y" and "z".
So i wrote:

Код:
forward PlayerToPoint(Float:radi, playerid, Float:x111, Float:y111, Float:z111);

public PlayerToPoint(Float:radi, playerid, Float:x111, Float:y111, Float:z111)
{
	if(IsPlayerConnected(playerid))
	{
		new Float:oldposx111, Float:oldposy111, Float:oldposz111;
		new Float:tempposx111, Float:tempposy111, Float:tempposz111;			
		GetPlayerPos(playerid, oldposx111, oldposy111, oldposz111);
		tempposx111 = (oldposx111 -x)
		tempposy111 = (oldposy111 -y);
		tempposz111 = (oldposz111 -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx111 < radi) && (tempposx111 > -radi)) && ((tempposy111 < radi) && (tempposy111 > -radi)) && ((tempposz111 < radi) && (tempposz111 > -radi)))
		{
			return 1;
		}
	}
return 0;	
}
when i started the game i ran to the doors but they didnt open!
and where i have to put the (if(gTeam[playerid] == TEAM_NWC))??
help!
Reply


Messages In This Thread
need help with automatic gates! - by BMGP - 24.08.2009, 07:52
Re: need help with automatic gates! - by Energyzer - 24.08.2009, 09:02
Re: need help with automatic gates! - by BMGP - 24.08.2009, 11:30

Forum Jump:


Users browsing this thread: 1 Guest(s)