Car engine off.
#1

Hi people.I want to ask one thing.How to do when player with vehicle hit to the wall,he's car engine off?
Reply
#2

You could check with a timer if the vehicle's velocity suddenly went from X to 0... Otherwise I wouldn't know...

GetVehicleVelocity
SetTimerEx
Reply
#3

I try to do that but i don't know...How to do that right.
Reply
#4

You can check vehicle's health to make it easier.
Reply
#5

PHP код:
public OnVehicleDamageStatusUpdate(vehicleidplayerid)
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
    
SendClientMessage(playerid0xFF0000FF"Your vehicle was turned off because you hit something.");
    return 
1;

Reply
#6

Yes,but how to check health there is the hardest,how to do that check who if player with vehicle in 1 sec change hp about 300 then off engine
Reply
#7

Maybe something like this?
PHP код:
new engine,lights,alarm,doors,bonnet,boot,objective;
if(
GetVehicleHealth(vehicleid, &Float:health) < 700)
{
    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
       
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
       
SendClientMessage(playerid0xFF0000FF"Your vehicle was turned off because you hit something.");
    return 
1;

Reply
#8

No,i need if vehicle hit to the wall he engine off,and not 700 hp less,car can have anything hp 500 600 750,but if he hit to the wall he engine off.I want to do that.
Reply
#9

would you like something that detects if the car hood is missing and then shuts off the engine?
Reply
#10

No,how much time i sad,i need if player vehicle get's health changes about 300hp in second engine off.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)