All pastes #971208 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-04-04 16:15 UTC
rendered paste body

forward CheckGate(playerid);

new app; // automatic gate at military spawn //under defines
new OpenGate[MAX_PLAYERS]; // '' ''

app = CreateObject(974,96.6637,1919.3386,20.00,0,360,270.0); // ongameinit
----------------------------------------------------------------

SetTimer("CheckGate", 500, true); // at OnPlayerConnect
    
OpenGate[playerid] = 0; // " " 

----------------------------------------------------------------

public CheckGate(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(gTeam[playerid] == TEAM_MILITARY)
	{

    if(PlayerToPoint(10.0, playerid,96.6637,1919.3386,20.00) && OpenGate[i] == 0)
    {
            MoveObject(app,96.1625,1915.6414,20.00,1);
            OpenGate[playerid] = 1;
    }

    else if(!PlayerToPoint(10.0, playerid,96.6637,1919.3386,20.00) && OpenGate[i] == 1)
    {
            OpenGate[playerid] = 0;
            MoveObject(app,96.6637,1919.3386,20.00,1); // Gate(-X)(-Y)(-Z) - The ORIGINAL CLOSED gate ones
    }

}
}
}