vehicle explosion
#1

How to prevent vehicle from exploding, i know there was function for that, but i dont remember it.
Reply
#2

At OnGameModeInit
Код:
    SetTimer("nexplode", 1000, 1);
and add it bottom of your Script
Код:
forward nexplode();
public nexplode()
{
    for (new i; i < MAX_PLAYERS; i++)
    {
     if(IsPlayerInAnyVehicle(i))
	{
			SetVehicleHealth(GetPlayerVehicleID(i), 1000.0);
	}
    }
}
Reply
#3

See: https://sampwiki.blast.hk/wiki/OnVehicleDeath

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    SetVehicleHealth(vehicleid, 1000.0);
    return 1;
}
Note:
This callback will also be called when a vehicle enters water, but the vehicle can be saved from destruction by teleportation or driving out (if only partially submerged). The callback won't be called a second time, and the vehicle may disappear when the driver exits, or after a short time.

OR See: https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new Float:health;
    GetVehicleHealth(vehicleid, health);   
    if(health <= 250.0)
        SetVehicleHealth(vehicleid, 1000.0);
    return 1;  
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)