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,308
Reputation: 337
Default GetPlayerCameraWeaponVector

GetPlayerCameraWeaponVector

As the title says, here I am providing a function which gets the correct 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 wasnt a far combat weapon equipped or the player isnt connected
Additionally I am providing the plotter filterscript which I used, you could use it to recreate the include

Final
- AdjustVector function rewritten
- Include name changes, it was over 32 char
- Comments removed, its obviously how to use it
- Function now returns the front vector if their wasnt a far combat weapon equipped

Download
Attached Files
File Type: zip [INC]GetPlayerCameraWeaponVector.zip (909 Bytes, 182 views)
File Type: zip [FS]Weapon Offset.zip (6.6 KB, 173 views)
File Type: zip [INC]GetPlayerCameraWeaponVector (Final).zip (595 Bytes, 105 views)
__________________



Last edited by Nero_3D; 03/11/2012 at 07:56 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,134
Reputation: 636
Default Re: GetPlayerCameraWeaponVector

Awesome! Thanks for sharing this useful include Nero.

+ rep.
__________________

Sup?
RyDeR` is offline   Reply With Quote
Old 14/08/2011, 01:20 AM   #3
[Ask]Terminator
Huge Clucker
 
[Ask]Terminator's Avatar
 
Join Date: Jan 2009
Posts: 203
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: Cary, NC, USA
Posts: 408
Reputation: 76
Default Re: GetPlayerCameraWeaponVector

these aren't the correct offsets, you get the correct ones from going into weapon.dat..
__________________
AutoArena EU
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,822
Reputation: 268
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
__________________

  • Are you prepared to get your wish? Twisted Metal SA-MP 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,120
Reputation: 900
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,274
Reputation: 669
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: 295
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: 872
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 12:30 PM.


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