> Problem with loading player vehicles..
#1

Hello sa-mp forum.

I have a problem and i dont know how to resolve it. My private player vehicle saves successfully, but not loading..
My loading script:

OnPlayerConnect
pawn Код:
function SystemConnect_Vehicles(id)
{
    for(new i; i < MAX_PLAYER_CARS; i++)
    {
        LoadPlayerVehicle(id, i);
    }
    return 1;
}
Under connect
pawn Код:
stock LoadPlayerVehicle(id, SlotID)
{
    new s[75];
    format(s, sizeof(s), "kVehicles/%s_slot_%d.ini", Name(id), SlotID);
    if(fexist(s))
    {
        INI_ParseFile(s, "LoadVehicles_%s", .bExtra = true, .extra = id); //This is the line - Idk
    }
    return 1;
}
and the function
pawn Код:
forward LoadVehicles_data(id, SlotID, name[], value[]);
public LoadVehicles_data(id, SlotID, name[], value[])
{
    INI_Int("ModelID", PlayerCar[id][SlotID][CarID]);
    INI_Float("X", PlayerCar[id][SlotID][X]);
    INI_Float("Y", PlayerCar[id][SlotID][Y]);
    INI_Float("Z", PlayerCar[id][SlotID][Z]);
    return 1;
}
Maybe(i dont find) in function INI_ParseFile is a double extra parameter? In my case it should be:
pawn Код:
INI_ParseFile(s, "LoadVehicles_%s", .bExtra = true, .extra = id, .extra = SlotID); //Dont work
Thanks for any help. REP+ if helped.
Reply
#2

pawn Код:
function SystemConnect_Vehicles(id)
{
    for(new i; i < MAX_PLAYER_CARS; i++)
    {
        LoadPlayerVehicle(id, i);
    }
    return 1;
}
stock LoadPlayerVehicle(id, SlotID)
{
    new s[75];
    format(s, sizeof(s), "kVehicles/%s_slot_%d.ini", Name(id), SlotID);
    if(fexist(s))
    {
        INI_ParseFile(s, "LoadVehicles_%s", .bExtra = true, .extra = id); //This is the line - Idk
        Createvehicle(id);
    }
    return 1;
}
forward LoadVehicles_data(id, SlotID, name[], value[]);
public LoadVehicles_data(id, SlotID, name[], value[])
{
    INI_Int("ModelID", PlayerCar[id][SlotID][CarID]);
    INI_Float("X", PlayerCar[id][SlotID][X]);
    INI_Float("Y", PlayerCar[id][SlotID][Y]);
    INI_Float("Z", PlayerCar[id][SlotID][Z]);
    return 1;
}
stock Createvehicle(id)
{
    CreateVehicle(PlayerCar[id][SlotId][CarId],PlayerCar[id][SlotID][X],PlayerCar[id][SlotID][X],PlayerCar[id][SlotID][X],90,-1,-1,1);
}
Try that , not test.
Reply
#3

Not work. I am really lost with y_ini.. i think i must send to function 2 parameters (id, SlotID)
pawn Код:
INI_ParseFile(s, "LoadVehicles_%s", .bExtra = true, .extra = id, .extra2 = SlotID);
Just for example it not works..
Anyone can help me? :/
Reply
#4

bump
Reply
#5

Anyone know it?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)