Raised This Month: $ Target: $400
 0% 

sqrt, pow functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-18-2014 , 05:42   sqrt, pow functions
Reply With Quote #1

Why I can't use this functions?
ZASTRELIS is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-18-2014 , 05:48   Re: sqrt, pow functions
Reply With Quote #2

What is it that is making you incapable of using them?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-18-2014 , 05:52   Re: sqrt, pow functions
Reply With Quote #3

Quote:
Originally Posted by hornet View Post
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.

Last edited by ZASTRELIS; 01-18-2014 at 05:59.
ZASTRELIS is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-18-2014 , 05:59   Re: sqrt, pow functions
Reply With Quote #4

Code:
/* Gets the distance between 2 vectors (float[3]). */
native Float:vector_distance(const Float:vVector[3], const Float:vVector2[3]);;
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 01-18-2014 at 05:59.
hornet is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-18-2014 , 06:03   Re: sqrt, pow functions
Reply With Quote #5

Quote:
Originally Posted by hornet View Post
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 ;)
ZASTRELIS is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 01-18-2014 , 06:13   Re: sqrt, pow functions
Reply With Quote #6

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 ;)
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-18-2014 , 06:37   Re: sqrt, pow functions
Reply With Quote #7

clear

Last edited by ZASTRELIS; 01-18-2014 at 06:56. Reason: small distance
ZASTRELIS is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 01-19-2014 , 07:31   Re: sqrt, pow functions
Reply With Quote #8

Code:
native power(value, exponent);
native sqroot(value);
SpeeDeeR is offline
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

Forum Jump


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


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