Raised This Month: $12 Target: $400
 3% 

Native not bound. | SquareRoot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
humptee
Junior Member
Join Date: Jul 2020
Old 07-18-2020 , 22:15   Native not bound. | SquareRoot
Reply With Quote #1

Hello, I am trying to use SquareRoot() from the float include in my project and am getting the error "Native not bound" for SquareRoot(x) and Pow(x, y)

However when I use any other function from that include it works?

examples:
Code:
public void OnPluginStart()
{
    // This returns 100 as expected.
    PrintToServer("RoundToFloor: %d", RoundToFloor(100.99));
    
    // this returns Exception thrown: Native is not bound
    // [0] SquareRoot()
    PrintToServer("SQRT: %d", SquareRoot(100.00));
}
Any help would be appreciated.
humptee is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-18-2020 , 22:18   Re: Native not bound. | SquareRoot
Reply With Quote #2

Works here, which SM version? Did you update includes when/if you upgraded SM?
__________________
Silvers is offline
humptee
Junior Member
Join Date: Jul 2020
Old 07-18-2020 , 22:20   Re: Native not bound. | SquareRoot
Reply With Quote #3

Quote:
Originally Posted by Silvers View Post
Works here, which SM version? Did you update includes when/if you upgraded SM?
Latest 1.10 on windows. Same thing occurs in my server and on a online compiler.
humptee is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-18-2020 , 22:23   Re: Native not bound. | SquareRoot
Reply With Quote #4

With that code? Because that compiles just fine (online and local 1.10)
__________________

Last edited by Silvers; 07-18-2020 at 22:23.
Silvers is offline
humptee
Junior Member
Join Date: Jul 2020
Old 07-18-2020 , 22:24   Re: Native not bound. | SquareRoot
Reply With Quote #5

Quote:
Originally Posted by Silvers View Post
With that code? Because that compiles just fine (online and local 1.10)
Yes exactly that code, it compiles fine I get that error on runtime.
Been struggling with this all day.
humptee is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-18-2020 , 22:33   Re: Native not bound. | SquareRoot
Reply With Quote #6

Strange works for me. Btw it should be "%f" not "%d" since "SquareRoot" returns a float.
__________________
Silvers is offline
humptee
Junior Member
Join Date: Jul 2020
Old 07-18-2020 , 22:35   Re: Native not bound. | SquareRoot
Reply With Quote #7

Which online compiler are you using maybe its just this one.

My actual runtime command i have testing this I have:
Code:
    float f = SquareRoot(25);
    PrintToChat(client, "%f", f);
    return Plugin_Handled;
This returns 0.

To me this makes 0 sense so I have no clue.
humptee is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-18-2020 , 22:55   Re: Native not bound. | SquareRoot
Reply With Quote #8

Because you're ignoring "warning 213: tag mismatch"

You should be putting "25.0" not "25" it accepts a float not ints. And don't cross post.
__________________

Last edited by Silvers; 07-18-2020 at 22:56.
Silvers is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-19-2020 , 09:36   Re: Native not bound. | SquareRoot
Reply With Quote #9

The SquareRoot native has existed in SM for over 13 years, you're definitely not getting "Native is not bound" from SM.
__________________
asherkin 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 17:07.


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