OnVehicleSpawn & SetVehicleHealth
#1

Код:
public OnVehicleSpawn(vehicleid)
{
     if(tInfo[vehicleid][vOwned])
     {
          if(!IsABike(vehicleid))
          {
               SetVehicleHealth(vehicleid, 230);
          }
     }
     return 1;
}
Vehicle explodes but OnVehicleDeath don't call. How to fix it?
P.S: Timers can't help ;/
P.P.S: It is sa:mp bug, but i don't know how to fix it. Certainly i can create NPC and put he in vehicle, but it not good idea.
Reply
#2

TUTS
Link1
LINK2
Reply
#3

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
? I know how to create and respawn vehicle... I don't understand why my script don't call OnVehicleDeath when car explodes(when i sets vehicle health 230).

Код:
public OnVehicleSpawn(vehicleid)
{
     if(tInfo[vehicleid][vOwned])
     {
          if(!IsABike(vehicleid))
          {
               SetVehicleHealth(vehicleid, 230);
          }
     }
     return 1;
}
Reply
#4

Quote:
Originally Posted by Johurt
Посмотреть сообщение
? I know how to create and respawn vehicle... I don't understand why my script don't call OnVehicleDeath when car explodes(when i sets vehicle health 230).
Quote:
Originally Posted by Johurt
Посмотреть сообщение
Код:
public OnVehicleSpawn(vehicleid)
{
     SetVehicleHealth(vehicleid, 230);
     return 1;
}
Vehicle explodes but OnVehicleDeath don't call. How to fix it?
P.S: Timers can't help ;/
You set the vehicle's health when it re-spawns (after its death) and assuming from that code, it will set the health to 230 which result in fire AGAIN.
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You set the vehicle's health when it re-spawns (after its death) and assuming from that code, it will set the health to 230 which result in fire AGAIN.
You didn't understand me. I loading own vehicle, OnVehicleSpawn i set vehicle health(only 1 time).
It is sa:mp bug, but i don't know how to fix it. Certainly i can create NPC and put he in vehicle, but it not good idea.
EDIT: Put NPC/Player in vehicle and then set HP or just set > 250 HP.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)