SA-MP Forums Archive
GetXYOnRightOfPlayer function? - 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: GetXYOnRightOfPlayer function? (/showthread.php?tid=445293)



GetXYOnRightOfPlayer function? - CONTROLA - 20.06.2013

I need a function which gets the position at the right-top edge of the player's camera. Something like this:



I've tried using GetXYInFrontOfPlayer and adding 5.0 to the Y position but it's not always good.


Re: GetXYOnRightOfPlayer function? - CONTROLA - 21.06.2013

Bump! Basically, I need the side position of a player. Can somebody help me?


Re: GetXYOnRightOfPlayer function? - MP2 - 21.06.2013

Well it can't be done based on camera because of the widescreen option - there's no way to detect it. Resolutions come in to play also.

That angle is 45 degrees to the right, so just use the GetXYInFrontOfPlayer as if the player's angle is GetPlayerFacingAngle()+45.

EDIT: Okay, I misunderstood the question. What does the first player have to do with it though? Just edit GetXYInFrontOfPlayer and add 90 to the angle.


Re: GetXYOnRightOfPlayer function? - CONTROLA - 04.07.2013

Thanks!