SA-MP Forums Archive
A GetPlayerAim 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A GetPlayerAim function. (/showthread.php?tid=97922)



A GetPlayerAim function. - [TG]Chase - 17.09.2009

A suggestion for 0.3 final - A function like GetPlayerAim(playerid,float,float:y,float:z) which gets the position of a point the player is aiming at. Could be useful when making target practice scripts.

I hope something like this is in 0.3 final release already..

If anyone knows a way to do it already, please tell me how.


Re: A GetPlayerAim function. - brett7 - 17.09.2009

sounds like alot of work for not much worth really


Re: A GetPlayerAim function. - TMasters - 17.09.2009

I support this idea, and if possible, would be better if there is realistic HP loos on shoot, etc, if you shoot someone in head with a gun, he dies, if in arm, some lof HP goes down etc etc


Re: A GetPlayerAim function. - TMasters - 17.09.2009

also good for aiming training on RP servers etc (cause of object destroy desync)


Re: A GetPlayerAim function. - [TG]Chase - 17.09.2009

Wouldn't the SAMP server have to know a player's aim coordinates in order to sync players getting shot?


Re: A GetPlayerAim function. - Joe Staff - 17.09.2009

Quote:
Originally Posted by Chaser98
Wouldn't the SAMP server have to know a player's aim coordinates in order to sync players getting shot?
Well the server already does know the player's aim, how do you think one player can tell that another player is looking up to shoot at his helicopter?


Re: A GetPlayerAim function. - cyber_punk - 18.09.2009

Hm, It would be more than just Z think about when your spinning around in one place while aiming, your rX and rY are changing just not your posX and posY. So I think its would be x,y,z and I also would like to see this. I have had a few's ideas for my gm I have put off simply because I didn't really like the current IsPlayerAiming function.


Re: A GetPlayerAim function. - lavamike - 18.09.2009

Quote:
Originally Posted by Seif_ [adream-rp.com
]
Quote:
Originally Posted by Joe Staff
Quote:
Originally Posted by Chaser98
Wouldn't the SAMP server have to know a player's aim coordinates in order to sync players getting shot?
Well the server already does know the player's aim, how do you think one player can tell that another player is looking up to shoot at his helicopter?
I'm not sure if it already knows the player's aim. Synchronizing doesn't mean the server knows if it has that much information, otherwise we would already have GetPlayerAim.
But again, X and Y would be useless, because it'd be the same as the player's position. What we need is GetPlayerZAimAngle no?
Yeah maybe but it would be less to do.


Re: A GetPlayerAim function. - Cueball - 18.09.2009

Funnily enough, I was reading about this yesterday. It's called spherical coordinates. All we currently have is the azimuth (player facing angle) We would need a way to get the elevation angle, and how far you're aiming (the radius). All of these are important to get a X, Y, Z coordinate for the player's aim. However we really could just make do with the elevation angle in a new function.

Just my two cents.

~Cueball~



Re: A GetPlayerAim function. - Daem - 18.09.2009

Quote:
Originally Posted by brett7
sounds like alot of work for not much worth really
srsly wat?
it is so easy just learn a little bit C++/C/VC++/etc.. it's like saying "changin wont'd levael colurz iz inposibl!" but it is possible to change wanted level RBGA like turning lamp on and off
on-topic:
i like the idea i believe it's very useful
GetPlayerLookAt
GetVehicleLookAt
is cool to.