[HELP] Vehicle Health
#1

Hello guys today i need help with this basically i want all the vehicles that are the same model lets say LSPD Car have 5000 Health When they are spawned or if they are already spanwned
Reply
#2

OnVehicleSpawn:
pawn Код:
if( GetVehicleModel( vehicleid ) == 596 ) //if the model of the vehicle spawned is in fact the LSPD
{
    SetVehicleHealth( vehicleid, 5000 );
}
Reply
#3

Remember that OnVehicleSpawn is called only when a vehicle respawns. AKA that code will not be executed when the server is started.
Reply
#4

pawn Код:
public OnGameModeInit()
{
    //code
    AllVehSetHealth();
    return 1;
}
AllVehSetHealth()
{
    for(new v; v<MAX_VEHICLES;v++)
    {
        SetVehicleHealth(v, 5000);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)