Floats don't load correctly
#10

pawn Код:
if (strcmp("/loadmyhp", cmdtext, true) == 0)
    {
        new File:hp=fopen("/UsersHP.ini", io_read), string[200], str[200];
        fread(hp, str);
        format(string, 200, "The health you saved = %f", floatstr(str));
        SendClientMessage(playerid, -1, string);
        fclose(hp);
        return 1;
    }
Take a closer look people, where is the value of 'str' coming from? That's correct, nowhere... you haven't set a value for 'str' in your /loadmyhp command. So it is reading 0 by default, therefore it will load 0 as well.
Reply


Messages In This Thread
Floats don't load correctly - by TH3_R3D™ - 12.07.2013, 23:21
Respuesta: Floats don't load correctly - by PHudson - 12.07.2013, 23:46
Re: Respuesta: Floats don't load correctly - by TH3_R3D™ - 12.07.2013, 23:48
Re: Floats don't load correctly - by Basssiiie - 13.07.2013, 00:09
Re: Floats don't load correctly - by TH3_R3D™ - 13.07.2013, 00:27
AW: Floats don't load correctly - by BigETI - 13.07.2013, 00:36
Re: AW: Floats don't load correctly - by TH3_R3D™ - 13.07.2013, 00:54
Re: Floats don't load correctly - by TH3_R3D™ - 13.07.2013, 02:13
Re: Floats don't load correctly - by TH3_R3D™ - 13.07.2013, 15:19
Re: Floats don't load correctly - by Threshold - 13.07.2013, 15:28

Forum Jump:


Users browsing this thread: 2 Guest(s)