SA-MP Forums Archive
Reverse Horn Beeper - 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)
+--- Thread: Reverse Horn Beeper (/showthread.php?tid=506466)



Reverse Horn Beeper - dreamboxxl - 13.04.2014

Hello, i want to make a reverse horn beeper, but by checking a stock IsVehicleDrivingBackwards and not by pressing backward key.

I found this stock here:

stock IsVehicleDrivingBackwards(vehicleid) // By Joker
{
new
Float:Float[3]
;
if(GetVehicleVelocity(vehicleid, Float[1], Float[2], Float[0]))
{
GetVehicleZAngle(vehicleid, Float[0]);
if(Float[0] < 90)
{
if(Float[1] > 0 && Float[2] < 0) return true;
}
else if(Float[0] < 180)
{
if(Float[1] > 0 && Float[2] > 0) return true;
}
else if(Float[0] < 270)
{
if(Float[1] < 0 && Float[2] > 0) return true;
}
else if(Float[1] < 0 && Float[2] < 0) return true;
}
return false;
}


But i'm not sure how to use it, maybe onplayerupdate or with a timer.

Any help example is very appriciated.

Thank You


Re: Reverse Horn Beeper - superrobot48 - 13.04.2014

you can use timer to continually check if player is driving backward with that stock of yours