Automatic gates
#1

This is very weird, not sure what's happening. The function stopped working seemingly without me doing anything to it.

IsPlayerInArea:
pawn Код:
forward isPlayerInArea();
public isPlayerInArea()
{
    new mibgate_status;
    new armygate1_status;
    new armygate2_status;
    new grovegate_status;
    new swatgate_status;
    new swatgate2_status;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
   
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i, 10, 1877.0999800,705.0999800,14.2000000) && gTeam[i] == TEAM_MIB) mibgate_status = 1;

        if(IsPlayerInRangeOfPoint(i, 10, 3424.8994100,1393.0996100,34.1000000) && gTeam[i] == TEAM_ARMY) armygate1_status = 1;
        if(IsPlayerInRangeOfPoint(i, 10, 3424.8000500,1377.0999800,34.1000000) && gTeam[i] == TEAM_ARMY) armygate2_status = 1;
        if(IsPlayerInRangeOfPoint(i, 10, 2856.8999000,2613.6001000,12.5000000) && gTeam[i] == TEAM_GROVE) grovegate_status = 1;
        if(IsPlayerInRangeOfPoint(i, 10, 2529.3999000,2424.0000000,12.6000000) && gTeam[i] == TEAM_SWAT) swatgate_status = 1;
        if(IsPlayerInRangeOfPoint(i, 10, 2515.8999000,2475.8999000,12.6000000) && gTeam[i] == TEAM_SWAT) swatgate2_status = 1;
    }

    if(mibgate_status) MoveObject(mibgate, 1877.0999800, 715.0999800, 14.2000000, 3);
    else MoveObject(mibgate, 1877.0999800, 705.0999800, 14.2000000, 3);

    if(armygate1_status) MoveObject(armygate1, 3424.8994100,1403.0996100,34.1000000, 3);
    else MoveObject(armygate1, 3424.8994100,1393.0996100,34.1000000, 3);

    if(armygate2_status) MoveObject(armygate2, 3424.8000500,1367.0999800,34.1000000, 3);
    else MoveObject(armygate2, 3424.8000500,1377.0999800,34.1000000, 3);

    if(grovegate_status) MoveObject(grovegate, 2856.8999000,2603.6001000,12.5000000, 3);
    else MoveObject(grovegate, 2856.8999000,2613.6001000,12.5000000, 3);

    if(swatgate_status) MoveObject(swatgate, 2519.3999000,2424.0000000,12.6000000, 3);
    else MoveObject(swatgate, 2529.3999000,2424.0000000,12.6000000, 3);

    if(swatgate2_status) MoveObject(swatgate2, 2515.8999000,2465.8999000,12.6000000, 3);
    else MoveObject(swatgate2, 2515.8999000,2475.8999000,12.6000000, 3);
}
OnGameModeInit:
pawn Код:
mibgate = CreateObject(971,1877.0999800,705.0999800,14.2000000,0.0000000,0.0000000,90.0000000); //object(subwaygate) (1)
    armygate1 = CreateObject(980,3424.8994100,1393.0996100,34.1000000,0.0000000,0.0000000,270.0000000); //object(airportgate) (1)
    armygate2 = CreateObject(980,3424.8000500,1377.0999800,34.1000000,0.0000000,0.0000000,270.0000000); //object(airportgate) (2)
    swatgate = CreateObject(980,2529.3999000,2424.0000000,12.6000000,0.0000000,0.0000000,0.0000000); //object(airportgate) (3)
    swatgate2 = CreateObject(980,2515.8999000,2475.8999000,12.6000000,0.0000000,0.0000000,270.0000000); //object(airportgate) (4)
    grovegate = CreateObject(975,2856.8999000,2613.6001000,12.5000000,0.0000000,0.0000000,268.0000000); //object(columbiangate) (1)
....
    SetTimer("isPlayerInArea", 1000, true);
...
Globally declared variables:
pawn Код:
new mibgate;
    new grovegate;
    new swatgate;
    new swatgate2;
    new armygate1;
    new armygate2;
Any idea why it's not working?
Reply


Messages In This Thread
Automatic gates - by JackBurgani - 08.05.2013, 22:12
Re: Automatic gates - by IceCube! - 08.05.2013, 22:17
Re: Automatic gates - by JackBurgani - 08.05.2013, 22:22
Re: Automatic gates - by Knappen - 08.05.2013, 22:42
Re: Automatic gates - by JackBurgani - 08.05.2013, 22:52
Re: Automatic gates - by JackBurgani - 08.05.2013, 23:21
Re: Automatic gates - by MP2 - 09.05.2013, 05:25

Forum Jump:


Users browsing this thread: 1 Guest(s)