AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get angles (https://forums.alliedmods.net/showthread.php?t=82224)

Dr.G 12-19-2008 09:50

get angles
 
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?

SchlumPF* 12-19-2008 10:38

Re: get angles
 
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); 


Dr.G 12-19-2008 15:41

Re: get angles
 
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?

Arkshine 12-19-2008 15:54

Re: get angles
 
should be %f ( float ) not %i ( integer ) because the output from pev() here is a float.

Dr.G 12-19-2008 18:18

Re: get angles
 
lol damn.. i totaly forgot to change that... Thanks both of ya...


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

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