Raised This Month: $ Target: $400
 0% 

get angles


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 12-19-2008 , 09:50   get angles
Reply With Quote #1

Iam looking for a way to get the angles of the direction iam looking in a given situation, i have used this to get my origins:

PHP Code:
public get_origin(id
{
 new 
origin[3]
 
get_user_origin(idorigin)
 
client_print(idprint_console"%i, %i, %i"origin[0], origin[1], origin[2])
 return 
PLUGIN_HANDLED

But i cant find a away to get my angles... any ideas?
Dr.G is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 12-19-2008 , 10:38   Re: get angles
Reply With Quote #2

use fakemeta

PHP Code:
#include <fakemeta>

//... then use in your code this:

//for origin:
new Float:origin[3];
pev(idpev_originorigin);

//for angles:
new Float:angles[3];
pev(idpev_anglesangles); 
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Dr.G
Senior Member
Join Date: Nov 2008
Old 12-19-2008 , 15:41   Re: get angles
Reply With Quote #3

Thanks! but it prints out something thats not true. When iam in origin
Quote:
1561.0,-1756.0,-475.0
i know the origin cuz i placed a model. It prints out
Quote:
1153728298, -992259791, -10093537
This is the code now:

PHP Code:
public get_origin(id
{
 new 
Float:origin[3];
 
pev(idpev_originorigin);
 
client_print(idprint_console"%i, %i, %i"origin[0], origin[1], origin[2])
 return 
PLUGIN_HANDLED

Or maybe its some kinda math thing i dont understand since #1 is a +origin, and the next two is minus like where i placed the model.. Can this print be fixed to a none binary numbers or what it is now?

Last edited by Dr.G; 12-19-2008 at 15:42. Reason: typo
Dr.G is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-19-2008 , 15:54   Re: get angles
Reply With Quote #4

should be %f ( float ) not %i ( integer ) because the output from pev() here is a float.
__________________
Arkshine is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 12-19-2008 , 18:18   Re: get angles
Reply With Quote #5

lol damn.. i totaly forgot to change that... Thanks both of ya...
Dr.G is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 09:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode