Accessing floats from a different script
#1

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:
Код:
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:
Код:
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:
Код:
test: 100.000000
h: 50.000000
The only way I'm getting it to work is by using PVars..
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)