Vehicle Autofix
#4

Here is a better way:
GameModeInit:
pawn Код:
SetTimer( "VehicleHealth", 3000, true );
pawn Код:
forward VehicleHealth( );
public VehicleHealth( )
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( IsPlayerConnected( i ) )
        {
            if( IsPlayerInAnyVehicle( i ) )
            {
                new vehicleid = GetPlayerVehicleID( i );
                RepairVehicle( vehicleid );
            }
        }
    }
    return 1;
}
About SetTimerEx, it's crazy because every one will run that timer.

And OnPlayerConnect will be the same, because SetTimer sets a GLOBAL timer, and SetTimerEx sets a timer for only one playerid. Use that code, it's gonna loop through all players and REPAIR the vehicle, not just set the HP to 1000.
Reply


Messages In This Thread
Vehicle Autofix - by Libra_PL - 18.02.2011, 09:38
Re: Vehicle Autofix - by Sascha - 18.02.2011, 09:43
Re: Vehicle Autofix - by Libra_PL - 18.02.2011, 09:48
Re: Vehicle Autofix - by Mean - 18.02.2011, 10:05
Re: Vehicle Autofix - by Unknown123 - 18.02.2011, 10:06
Re: Vehicle Autofix - by Mean - 18.02.2011, 10:07
Re: Vehicle Autofix - by [WF]Demon - 18.02.2011, 10:08
Re: Vehicle Autofix - by Mean - 18.02.2011, 10:08

Forum Jump:


Users browsing this thread: 3 Guest(s)