Any help to fix this issue please?
#6

It still compiles fine.
pawn Код:
#include < a_samp >
#include < YSI\y_ini >

enum carDataEnum
{
    model,
    Float:xspawn,
    Float:yspawn,
    Float:zspawn,
    Float:anglespawn,
    col1,
    col2,
    respawn,
    owner[MAX_PLAYER_NAME]
}
new carData[MAX_VEHICLES][carDataEnum];

forward LoadVehicleData(vehicle, name[], value[]);
public LoadVehicleData(vehicle, name[], value[])
{
    INI_Int("Model", carData[vehicle][model]);
    INI_Float("xLast", carData[vehicle][xspawn]);
    INI_Float("yLast", carData[vehicle][yspawn]);
    INI_Float("zLast", carData[vehicle][zspawn]);
    INI_Float("aLast", carData[vehicle][anglespawn]);
    INI_Int("Color1", carData[vehicle][col1]);
    INI_Int("Color2", carData[vehicle][col2]);
    INI_Int("Respawn", carData[vehicle][respawn]);
    INI_String("Owner", carData[vehicle][owner], MAX_PLAYER_NAME);

    return 1;
}

stock LoadAllVehicles()
{
    //new fname[36];
    new loadindex = 0;
    //format(fname, sizeof(fname), "/vehicles/%d.ini", loadindex);
    while(fexist(VehiclePath(loadindex)))  //Here's the reason why the ini files are named continuosly
    {
        LoadVehicle(loadindex, VehiclePath(loadindex));
        loadindex++;
        //format(fname, sizeof(fname), "/vehicles/%d.ini", index);
    }
    printf("Vehicles Loaded: %d", loadindex);
}

stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[])
{
    new carid = GetFreeVehicleSlot();
    carData[carid][model] = modelid;
    carData[carid][xspawn] = x;
    carData[carid][yspawn] = y;
    carData[carid][zspawn] = z;
    carData[carid][anglespawn] = angle;
    carData[carid][col1] = color1;
    carData[carid][col2] = color2;
    carData[carid][respawn] = respawntime;
    strcpy(carData[carid][owner], ownername, MAX_PLAYER_NAME);
    validcar[carid] = true;
    CreateVehicle(modelid, x, y, z, angle, color1, color2, respawntime);
    return carid;
}

stock LoadVehicle(vehicle, filename[])
{
    INI_ParseFile(filename, "LoadVehicleData", .bExtra = true, .extra = vehicle);
    CreateVehicleEx(carData[vehicle][model], carData[vehicle][xspawn], carData[vehicle][yspawn], carData[vehicle][zspawn], carData[vehicle][anglespawn], carData[vehicle][col1], carData[vehicle][col2], carData[vehicle][respawn], carData[vehicle][owner]);
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)