Floats don't load correctly
#5

Quote:
Originally Posted by Basssiiie
Посмотреть сообщение
How are the floats saved in the file?
Quote:
Originally Posted by TH3_R3D™
Посмотреть сообщение
pawn Код:
if (strcmp("/savemyhp", cmdtext, true) == 0)
    {
        new pname[32],Float:health, str[200];
        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
        GetPlayerHealth(playerid, health);
        new File:hp=fopen("/UsersHP.ini", io_append);
        if(hp)
        {
            format(str, sizeof(str), "%s(hp)=%f\r\n", pname, health); fwrite(hp, str);
            fclose(hp);
        }
        return 1;
    }
pawn Код:
stock SaveBiz(id)
{
    new File:File=fopen(PATH, io_write);
    if(File)
    {
        new str[165];
        fwrite(File,"[data]\r\n");
        format(str,30,"bOwned=%d\r\n", BusinessInfo[id][bOwned]);               fwrite(File, str);
        format(str,30,"bPrice=%d\r\n", BusinessInfo[id][bPrice]);               fwrite(File, str);
        format(str,30,"bOwner=%s\r\n", BusinessInfo[id][bOwner]);               fwrite(File, str);
        format(str,30,"bType=%d\r\n", BusinessInfo[id][bType]);                 fwrite(File, str);
        format(str,30,"bLocked=%d\r\n", BusinessInfo[id][bLocked]);             fwrite(File, str);
        format(str,30,"bMoney=%d\r\n", BusinessInfo[id][bMoney]);               fwrite(File, str);
        format(str,30,"bEntranceX=%f\r\n", BusinessInfo[id][bEntranceX]);       fwrite(File, str);
        format(str,30,"bEntranceY=%f\r\n", BusinessInfo[id][bEntranceY]);       fwrite(File, str);
        format(str,30,"bEntranceZ=%f\r\n", BusinessInfo[id][bEntranceZ]);       fwrite(File, str);
        format(str,30,"bEntranceA=%f\r\n", BusinessInfo[id][bEntranceA]);       fwrite(File, str);
        format(str,30,"bExitX=%f\r\n", BusinessInfo[id][bExitX]);               fwrite(File, str);
        format(str,30,"bExitY=%f\r\n", BusinessInfo[id][bExitY]);               fwrite(File, str);
        format(str,30,"bExitZ=%f\r\n", BusinessInfo[id][bExitZ]);               fwrite(File, str);
        format(str,30,"bExitA=%f\r\n", BusinessInfo[id][bExitA]);               fwrite(File, str);
        format(str,30,"bInt=%d\r\n", BusinessInfo[id][bInt]);                   fwrite(File, str);
        format(str,30,"bWorld=%d\r\n", BusinessInfo[id][bWorld]);               fwrite(File, str);
        format(str,30,"bInsideInt=%d\r\n", BusinessInfo[id][bInsideInt]);       fwrite(File, str);
        format(str,30,"bInsideWorld=%d\r\n", BusinessInfo[id][bInsideWorld]);   fwrite(File, str);
        format(str,30,"bName=%s\r\n", BusinessInfo[id][bName]);                 fwrite(File, str);
        fclose(File);
    }
    fclose(File);
    return 1;
}
but it saves very good?
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: 1 Guest(s)