How to create movable gate
#7

Can you help this code:

Код:
forward CheckForWalking();
public OnGameModeInit();
{
	SetTimer("CheckForWalking", 1500, 1);
}
public  CheckForWalking()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(PlayerToPoint(5.0, i, X ,Y, Z))
			{
			    if(GetPlayerColor(i) == 0xFFFFFF00)
			    {
					Script for move gate.
				}
				else return 1;
			}
		}
	}
	return 1;
}
static PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
	{
	    new Float:pos[3];
	    new Float:tmppos[3];
		GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
		tmppos[0] = (pos[0] - x);
		tmppos[1] = (pos[1] - y);
		tmppos[2] = (pos[2] - z);
		if (((tmppos[0] < radi) && (tmppos[0] > -radi)) && ((tmppos[1] < radi) && (tmppos[1] > -radi)) && ((tmppos[2] < radi) && (tmppos[2] > -radi)))
		{
			return 1;
		}
	}
	return 0;
}
Reply


Messages In This Thread
How to create movable gate Rep +1 - by MichaelProPlayer - 26.03.2012, 07:00
Re: How to create movable gate - by MichaelProPlayer - 26.03.2012, 09:46
Re: How to create movable gate - by Twisted_Insane - 26.03.2012, 09:51
Re: How to create movable gate - by MichaelProPlayer - 26.03.2012, 09:58
Re: How to create movable gate - by Twisted_Insane - 26.03.2012, 10:01
Re: How to create movable gate - by MichaelProPlayer - 26.03.2012, 10:06
Re : How to create movable gate - by Ultrascipter - 26.03.2012, 10:09

Forum Jump:


Users browsing this thread: 2 Guest(s)