SA-MP Forums Archive
Car engine off. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car engine off. (/showthread.php?tid=267968)



Car engine off. - budelis - 10.07.2011

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


Re: Car engine off. - alpha500delta - 10.07.2011

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

GetVehicleVelocity
SetTimerEx


Re: Car engine off. - budelis - 10.07.2011

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


Re: Car engine off. - =WoR=Varth - 11.07.2011

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


Re: Car engine off. - Shadoww5 - 11.07.2011

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;




Re: Car engine off. - budelis - 11.07.2011

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


Re: Car engine off. - [MG]Dimi - 11.07.2011

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;




Re: Car engine off. - budelis - 11.07.2011

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.


Re: Car engine off. - dowster - 11.07.2011

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


Re: Car engine off. - budelis - 11.07.2011

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