SA-MP Forums Archive
Detect if a player drives Forwards or Backwards - 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: Detect if a player drives Forwards or Backwards (/showthread.php?tid=154091)



Detect if a player drives Forwards or Backwards - sean5874 - 12.06.2010

Hello,
Im gonna make a shifing system for my server, so i need a function like this. How i can detect if a player drives forwards or backwards??
Greetzz,
sean5874


Re: Detect if a player drives Forwards or Backwards - deather - 12.06.2010

Check his keys!!


Re: Detect if a player drives Forwards or Backwards - Sjitty - 12.06.2010

try comparing GetVehicleZAngle with the direction hes moving.

check his coords every second, then calculate the direction hes going and convert it into map angle then compare with vehicleZangle. It will always be either the same or 180 degrees difference.


Re: Detect if a player drives Forwards or Backwards - Sjitty - 12.06.2010

oke nvm my post, his is waaay better


Re: Detect if a player drives Forwards or Backwards - sean5874 - 12.06.2010

Lol, that sounds a little difficult , how to do it?

Quote:

Check his keys!!

Are there ids for the W and the S key to check on??



Re: Detect if a player drives Forwards or Backwards - deather - 13.06.2010

I think GetPlayerKeys is for up, down, left and right arrows. Not sure