one question
#1

Hi,
in what callback i should put script if i want to check vehicle healh all time?
Reply
#2

OnPlayerUpdate is where you would put it (assuming no new callbacks for vehicle damage were added in 0.3c, i havent played with it yet :P). I would add scheduling code so your code isnt being called on every update though.
Reply
#3

well, i will try it, thx
Reply
#4

why its not work(yea im lol)
pawn Код:
public OnPlayerUpdate(playerid)
{
new
   vehicleid = GetPlayerVehicleID(playerid);

    if (vehicleDB[vehicleid][drausta])
        {
       
          if (GetVehicleHealth(vehicleid) < 400)
            {
              SetVehicleHealth(vehicleid,1000);
            }
        }
return 1;}
its dont do nothing

this works, i know couse i get message then i get in car....
pawn Код:
if (vehicleDB[vehicleid][drausta])
Reply
#5

https://sampwiki.blast.hk/wiki/GetVehicleHealth


You're using GetVehicleHealth wrong.
Reply
#6

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

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    RepairVehicle(vehicleid);
    return 1;
}
same as godmode
Reply
#7

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    RepairVehicle(vehicleid);
    return 1;
}
same as godmode
Sorry but this is probably the worst option, as this callback only gets called when a vehicle gets visibly damage, which not every vehicle can be (boats, planes, and any 2 wheel vehicle etc do not have visible elements that can be damaged). Test your code with an NRG500 or a plane for example.
Reply
#8

thx Koysaur its working
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)