SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 14/08/2011, 12:53 AM   #1
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 3,370
Reputation: 390
Default GetPlayerCameraWeaponVector

GetPlayerCameraWeaponVector

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

Parameters
Code:
(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 and paste it

Z is still inaccurate in some situations

Download

Removed till I found a way to get the correct Z offeset
__________________



Last edited by Nero_3D; 18/11/2014 at 09:25 PM.
Nero_3D is offline   Reply With Quote
Old 14/08/2011, 12:54 AM   #2
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 3,133
Reputation: 645
Default Re: GetPlayerCameraWeaponVector

Awesome! Thanks for sharing this useful include Nero.

+ rep.
__________________

Sup?
RyDeR` is online now   Reply With Quote
Old 14/08/2011, 01:20 AM   #3
[Ask]Terminator
Huge Clucker
 
[Ask]Terminator's Avatar
 
Join Date: Jan 2009
Posts: 202
Reputation: 3
Default Re : GetPlayerCameraWeaponVector

realy nice release
__________________
Code:
[Ask]Terminator is offline   Reply With Quote
Old 14/08/2011, 01:47 AM   #4
Whitetiger
Huge Clucker
 
Whitetiger's Avatar
 
Join Date: Nov 2007
Location: Greenville, NC, USA
Posts: 437
Reputation: 97
Default Re: GetPlayerCameraWeaponVector

these aren't the correct offsets, you get the correct ones from going into weapon.dat..
__________________
GitHub

Whitetiger is offline   Reply With Quote
Old 14/08/2011, 01:58 AM   #5
Kar
High-roller
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,895
Reputation: 286
Default Re: GetPlayerCameraWeaponVector

Quote:
Originally Posted by whitetigerswt View Post
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
__________________

  • Twisted Metal's Website & Forums are up! http://tm.lvcnr.net

    Are you prepared to get your wish? Twisted Metal SA-MP is coming soon! Join the IRC Channel: #tm on irc.tl - @tmsamp_dev

server.lvcnr.net:7777 | samp://server.lvcnr.net:7777
www.lvcnr.net | @kcnrdev
Channel: #lvcnr on irc.tl
Kar is offline   Reply With Quote
Old 14/08/2011, 02:36 AM   #6
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,122
Reputation: 928
Default Re: GetPlayerCameraWeaponVector

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

rep + from me!
__________________

192.169.82.202:7777 - An awesome CnR server consisting of doozy features! Come, we have players!


Lorenc_ is offline   Reply With Quote
Old 14/08/2011, 02:40 AM   #7
RealCop228
Godfather
 
Join Date: Feb 2010
Location: Springboro, OH
Posts: 8,265
Reputation: 670
Default Re: GetPlayerCameraWeaponVector

Oh this will be very nice and useful!

+ rep
__________________
Putting [URGENT] in the thread title stops me from opening the thread. Nobody else's problem on this forum is more important that another person's. Try not to be self-centered!
RealCop228 is offline   Reply With Quote
Old 14/08/2011, 02:43 AM   #8
MiTToS
Huge Clucker
 
MiTToS's Avatar
 
Join Date: Jul 2011
Posts: 294
Reputation: 35
Default Re: GetPlayerCameraWeaponVector

Awesome! I liked it.
MiTToS is offline   Reply With Quote
Old 09/09/2011, 07:46 PM   #9
Darnell
Gangsta
 
Darnell's Avatar
 
Join Date: Jul 2010
Posts: 870
Reputation: 34
Default Re: GetPlayerCameraWeaponVector

I like it.
Darnell is offline   Reply With Quote
Old 09/09/2011, 08:16 PM   #10
Trooper[Y]
Gangsta
 
Trooper[Y]'s Avatar
 
Join Date: Apr 2009
Posts: 523
Reputation: 18
Default AW: GetPlayerCameraWeaponVector

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!
__________________




Trooper[Y] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.