Detect vehicle explosion and much more stuff
#1

I want to do if the vehicle is destroyed by explosion,when player respawn car using command its car must be created destroyed..
Reply
#2

Use this callback: https://sampwiki.blast.hk/wiki/OnVehicleDeath
Make use of per vehicle based vars to detect if was destroyed and do your stuff.
After storing the report, use this: https://sampwiki.blast.hk/wiki/OnVehicleSpawn

pawn Код:
new bool:died[MAX_VEHICLES];

public OnVehicleDeath(vehicleid, killerid)
{
     died[vehicleid] = true;
     return 1;
}

public OnVehicleSpawn(vehicleid)
{
     if(died[vehicleid])
     {
          //Spawn it as locked with low Health
     }
     return 1;
}
* You cant spawn a vehicle as destroyed.
Reply
#3

The problem with OnPlayerDeath, is the fact that it's called when the vehicle is submerged as well.
Quote:
Originally Posted by Wiki
This callback is called when a vehicle is destroyed - either by exploding or becoming submerged in water.
Reply
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
The problem with OnPlayerDeath, is the fact that it's called when the vehicle is submerged as well.
You mean OnVehicleDeath?
Reply
#5

Quote:
Originally Posted by BleverCastard
Посмотреть сообщение
You mean OnVehicleDeath?
Sorry, yes i meant OnVehicleDeath.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)