SA-MP Forums Archive
Detect if player is standing in front of car's trunk - 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: Detect if player is standing in front of car's trunk (/showthread.php?tid=413618)



Detect if player is standing in front of car's trunk - SaW_[VrTx] - 06.02.2013

Hey,
I know this is possible because I have seen it before, but I have no idea how..
So, how to detect if the played is standing front of car's trunk (For RP - loading/unloading stuff)?


Re: Detect if player is standing in front of car's trunk - RajatPawar - 06.02.2013

I really am guessing here, but you could GetVehicleZAngle and then GetPlayerFacingAngle to see if the angle's are matching? Really, a guess.


Respuesta: Detect if player is standing in front of car's trunk - Dex007HLH - 06.02.2013

Use GetVehiclePos.. and make it able to use the trunk command only when the player is "x" meters behind the car.


Re: Detect if player is standing in front of car's trunk - RajatPawar - 06.02.2013

Alright, got it. Thanks and credits to 'MP2'
http://forum.sa-mp.com/showpost.php?...18&postcount=7


Re: Detect if player is standing in front of car's trunk - SaW_[VrTx] - 06.02.2013

Thanks. ^^


Re: Detect if player is standing in front of car's trunk - MP2 - 06.02.2013

I actually made a function yesterday to get any coordinates using offsets from other coordinates, I shall post it later. One probably exists already (and is undoubtfully better) but I can't seem to find one.

You're welcome ^