How to load Float from .ini with Y_ini
#5

Quote:
Originally Posted by Horrible
View Post
pawn Code:
#include <YSI\y_ini>

enum nstation
{
s1,
s2,
s3,
s4,
s5,
}
new station[nstation];
enum posinfo6
{
    Float:posx,
    Float:posy,
    Float:posz,
};
new PosInfo6[posinfo6];
enum posinfo0
{
    Float:posx,
    Float:posy,
    Float:posz,
};
new PosInfo0[MAX_PLAYERS][posinfo0];
enum posinfo1
{
    Float:posx,
    Float:posy,
    Float:posz,
};
new PosInfo1[MAX_PLAYERS][posinfo1];
enum posinfo2
{
    Float:posx,
    Float:posy,
    Float:posz,
};
new PosInfo2[MAX_PLAYERS][posinfo2];
enum posinfo3
{
    Float:posx,
    Float:posy,
    Float:posz,
};
new PosInfo3[MAX_PLAYERS][posinfo3];
new rentcar1[MAX_PLAYERS];
new rentcar2[MAX_PLAYERS];
new rentcar3[MAX_PLAYERS];
new Locked[MAX_PLAYERS], IsLocked[MAX_VEHICLES];
new engine, lights, alarm, doors, bonnet, boot, objective;
new Float:x, Float:y, Float:z;
new timer1;
new timer2;
new timer3;
new slot;
new Float:x1, Float:y1, Float:z1;
new Float:x2, Float:y2, Float:z2;
new Float:x3, Float:y3, Float:z3;
new Float:x4, Float:y4, Float:z4;
new Float:x5, Float:y5, Float:z5;
new file1;

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Car Rental System by Horrible");
        print("--------------------------------------\n");
        print(" =   = = = =  = == = =  +  =     =    [====");
        print(" = = = =   =  =    =    =  ====) =    [=== ");
        print(" =   = = = =  =    =    =  =---) ==== [==== ");
        print(" ----------------Version 1.4-----------------");
        INI_Load("/h-rental/rental1.ini");
        LoadStores();
        DisableInteriorEnterExits();
        for(new v = 0; v < MAX_VEHICLES; v++) IsLocked[v] = 0;
        return 1;
}


CMD:createrental(playerid, params[])
{
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
        if(sscanf(params, "i", slot)) return SendClientMessage(playerid, COLOR_GREEN, "Usage: /createrental <slot>");
        if(slot < 1 || slot > 5) return SendClientMessage(playerid, COLOR_GREEN, "Invalid slot Id, (1 - 5)");
        if(slot == 1)
        {
        file1 = INI_Open("/h-rental/rental1.ini");
        DestroyPickup(station[s1]);
        GetPlayerPos(playerid, x1, y1, z1);
        PosInfo6[posx] = x1;
        PosInfo6[posy] = y1;
        PosInfo6[posz] = z1;
        INI_WriteFloat(file1, "X1", PosInfo6[posx]);
        INI_WriteFloat(file1, "Y1", PosInfo6[posy]);
        INI_WriteFloat(file1, "Z1", PosInfo6[posz]);
        station[s1] = CreatePickup(1318, 1, x1,y1,z1, 0);
        INI_Close(file1);
        }
stock LoadStores()
{
        new ini;
        ini = INI_Open("rental1.ini");
        station[s1] = CreatePickup(1318, 1, PosInfo6[posx],PosInfo6[posy],PosInfo6[posz], 0);
        INI_Close(ini);
        return 1;
}
return 1;
}
the rental1.ini created but can't load when me turn on and turn off the server again
can someone help?
i think this problem is about can't load the float from .ini file
Help please....
This makes no sense what you are doing. You are attempting to open and close a file locally through the process of executing a command. This is not how y_ini is supposed to be used. I'm not saying that it will not work, but values are supposed to be saved through variables.
Reply


Messages In This Thread
How to load Float from .ini with Y_ini - by Horrible - 22.08.2011, 08:46
Re: How to load Float from .ini with Y_ini - by [MWR]Blood - 22.08.2011, 08:54
Re: How to load Float from .ini with Y_ini - by Horrible - 22.08.2011, 09:00
Re: How to load Float from .ini with Y_ini - by Basicz - 22.08.2011, 12:03
Re: How to load Float from .ini with Y_ini - by Kush - 22.08.2011, 20:15
Re: How to load Float from .ini with Y_ini - by Horrible - 23.08.2011, 00:12
Re: How to load Float from .ini with Y_ini - by Kush - 23.08.2011, 00:29
Re: How to load Float from .ini with Y_ini - by Horrible - 23.08.2011, 00:37
Re: How to load Float from .ini with Y_ini - by iPLEOMAX - 23.08.2011, 00:43
Re: How to load Float from .ini with Y_ini - by Horrible - 23.08.2011, 00:45

Forum Jump:


Users browsing this thread: 3 Guest(s)