AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Native not bound. | SquareRoot (https://forums.alliedmods.net/showthread.php?t=326118)

humptee 07-18-2020 22:15

Native not bound. | SquareRoot
 
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.

Silvers 07-18-2020 22:18

Re: Native not bound. | SquareRoot
 
Works here, which SM version? Did you update includes when/if you upgraded SM?

humptee 07-18-2020 22:20

Re: Native not bound. | SquareRoot
 
Quote:

Originally Posted by Silvers (Post 2710683)
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.

Silvers 07-18-2020 22:23

Re: Native not bound. | SquareRoot
 
With that code? Because that compiles just fine (online and local 1.10)

humptee 07-18-2020 22:24

Re: Native not bound. | SquareRoot
 
Quote:

Originally Posted by Silvers (Post 2710685)
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.

Silvers 07-18-2020 22:33

Re: Native not bound. | SquareRoot
 
Strange works for me. Btw it should be "%f" not "%d" since "SquareRoot" returns a float.

humptee 07-18-2020 22:35

Re: Native not bound. | SquareRoot
 
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.

Silvers 07-18-2020 22:55

Re: Native not bound. | SquareRoot
 
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.

asherkin 07-19-2020 09:36

Re: Native not bound. | SquareRoot
 
The SquareRoot native has existed in SM for over 13 years, you're definitely not getting "Native is not bound" from SM.


All times are GMT -4. The time now is 16:27.

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