Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Accessing floats from a different script

$
0
0
I've been scripting for a while now, and I've never needed to access a float that's inside the gamemode, from a filterscript.

I've never had a problem when I access integers.
(I use CallRemoteFunction)

This is just an example of course:
Code:

Gamemode:
public Float: GetPlayerHealthEx(playerid)
{
    new Float: f;
    GetPlayerHealth(playerid, f);
    return f;
}

Filterscript:
CallRemoteFunction("GetPlayerHealthEx", "i", playerid);

Maybe I'm doing something completely stupid and I'm not noticing it, but it's not working.
I tried debugging, and all it did is make me more confused:
Code:

new
    Float: test = 100.0,
    Float: h = GetPlayerHealthEx(playerid);
printf("test: %f", test);
printf("h: %f", h);
if (test > h)
    print("test > h");

What it prints out:
Code:

test: 100.000000
h: 50.000000

The only way I'm getting it to work is by using PVars..

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>