Setting String Depending On Float (I think?)
#2

You could convert the float to an integer, then loop strcat to add a dot each time, and then send the string this makes.

eg:

pawn Код:
new Float:Health, iHealth, LString[105];
    GetPlayerHealth(playerid,Health);
    iHealth = floatround(Health, floatround_ceil);
    for(new i; i < iHealth; i++)
    {
        strcat(LString, ".");
    }
Very Untested.
Reply


Messages In This Thread
Setting String Depending On Float (I think?) - by NeRoSiS - 07.06.2009, 10:25
Re: Setting String Depending On Float (I think?) - by Weirdosport - 07.06.2009, 10:33
Re: Setting String Depending On Float (I think?) - by yom - 07.06.2009, 10:36
Re: Setting String Depending On Float (I think?) - by Weirdosport - 07.06.2009, 10:39
Re: Setting String Depending On Float (I think?) - by NeRoSiS - 07.06.2009, 11:35
Re: Setting String Depending On Float (I think?) - by NeRoSiS - 07.06.2009, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)