AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   sqrt, pow functions (https://forums.alliedmods.net/showthread.php?t=233636)

ZASTRELIS 01-18-2014 05:42

sqrt, pow functions
 
Why I can't use this functions?

hornet 01-18-2014 05:48

Re: sqrt, pow functions
 
What is it that is making you incapable of using them?

ZASTRELIS 01-18-2014 05:52

Re: sqrt, pow functions
 
Quote:

Originally Posted by hornet (Post 2087537)
What is it that is making you incapable of using them?

Code:
new Float:disance = sqrt(pow(plrOrigin[0] - entOrigin[0]) + pow(plrOrigin[1] + entOrigin[1]) + pow(plrOrigin[2] + entOrigin[2]))

Tried this, but it not worked, so I start find ready function in XS.inc.
Reading XS.. Finding some interesting for me there =)

P.S. I need compute distance between to vecs.

hornet 01-18-2014 05:59

Re: sqrt, pow functions
 
Code:

/* Gets the distance between 2 vectors (float[3]). */
native Float:vector_distance(const Float:vVector[3], const Float:vVector2[3]);;


ZASTRELIS 01-18-2014 06:03

Re: sqrt, pow functions
 
Quote:

Originally Posted by hornet (Post 2087542)
Code:

/* Gets the distance between 2 vectors (float[3]). */
native Float:vector_distance(const Float:vVector[3], const Float:vVector2[3]);;


tnx, one of ";" is unnecessary in native ;)

hornet 01-18-2014 06:13

Re: sqrt, pow functions
 
Yes, my bad, I copied that from the include file, accidentally copied the wrong native, and then replace copied with the correct one and obvs missed the semicolon ;)

ZASTRELIS 01-18-2014 06:37

Re: sqrt, pow functions
 
clear

SpeeDeeR 01-19-2014 07:31

Re: sqrt, pow functions
 
Code:

native power(value, exponent);
native sqroot(value);



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

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