[Include] GetPlayerCameraWeaponVector
#1

GetPlayerCameraWeaponVector

As the title says, here I am providing a function which gets roughly the vector if you aim with a ranged weapon

Parameters
Код:
(playerid, & Float: vX, & Float: vY, & Float: vZ)

playerid	The ID of the player you want to obtain the camera weapon vector of.
Float: vX	A float to store the X coordinate, passed by reference.
Float: vY	A float to store the Y coordinate, passed by reference.
Float: vZ	A float to store the Z coordinate, passed by reference.

Returns false if there wasn't a ranged weapon equipped or the player isn't connected
This include only contain one function, you are free to copy / paste it

Download

GitHub v5
GitHub v3

Changelog v5

The major change is that I changed the code from a constant (~accurate with +-5 degrees) to a function

I know everyone likes images therefore I present the interpolation (---) for the measurement (points), y = zRot-Offset, x = Z-Vector
Well this could have been more accurate but I wanted to use a simple polynomial (y = a*(x-b)^c + d)
Anyway should be somehow accurate if you don't aim to low < -35 degrees

Reply
#2

Awesome! Thanks for sharing this useful include Nero.

+ rep.
Reply
#3

realy nice release
Reply
#4

these aren't the correct offsets, you get the correct ones from going into weapon.dat..
Reply
#5

Quote:
Originally Posted by whitetigerswt
Посмотреть сообщение
these aren't the correct offsets, you get the correct ones from going into weapon.dat..
These are the offsets that work with sa-mp
Reply
#6

This will come in so damn handy for me, thanks alot nero!

rep + from me!
Reply
#7

Oh this will be very nice and useful!

+ rep
Reply
#8

Awesome! I liked it.
Reply
#9

I like it.
Reply
#10

Was waiting for my doctor title to do that,
but now you did it, we can finally advance with camera functions.

Thanks a lot,
very helpful!
Reply
#11

Thanks i was waiting, for something like this.
Reply
#12

coool dude
and very usefull
Reply
#13

It's really handy! Nice work
Reply
#14

What Does It Do?? does it get the pos where the player is aiming?
Reply
#15

Quote:
Originally Posted by newbie scripter
View Post
What Does It Do?? does it get the pos where the player is aiming?
Yes it gets first the front vector (thats always the center of the screen) and adjust it to the crosshair of the weapon, also the aiming vector
Reply
#16

Awesome
Reply
#17

Quote:
Originally Posted by Nero_3D
View Post
Yes it gets first the front vector (thats always the center of the screen) and adjust it to the crosshair of the weapon, also the aiming vector
then my idea can become true
Reply
#18

Quote:
Originally Posted by Nero_3D
View Post
Yes it gets first the front vector (thats always the center of the screen) and adjust it to the crosshair of the weapon, also the aiming vector
Crazy i always needed something like this to make a shooting range i think. Great work. Rep+4
Reply
#19

Nice I was looking for this
Reply
#20

This looks good! It might get handy.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)