Saving all vehicles on OnFilterScriptExit:
#9

I know what's wrong. Here's the whole new FS. I hope that it's working:

pawn Код:
#include <a_samp>
#include <gl_common>

#define FILTERSCRIPT
#define ARQUIVO_CARROS "carros.ini"

new bool:ValidVeh[MAX_VEHICLES] ;

public OnFilterScriptInit()
{
   LoadStaticVehiclesFromFile(ARQUIVO_CARROS);
   return 1;
}

public OnFilterScriptExit()
{
    new fstring[288], Float:vX, Float:vY, Float:vZ, Float:vA, File:veh;
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        if(!ValidVeh[v]) return 0;
        GetVehiclePos(v, vX, vY, vZ); GetVehicleZAngle(v, vA);
        format(fstring, 288, "%d, %f, %f, %f, %f, -1, -1, -1;\r\n", GetVehicleModel(v), vX, vY, vZ, vA);
        veh = fopen(ARQUIVO_CARROS, io_append);
        fwrite(veh, fstring);
        fclose(veh);
    }
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    ValidVeh[vehicleid] = true;
    return 1;
}

public OnVehicleDeath(vehicleid)
{
    ValidVeh[vehicleid] = false;
    return 1;
}
Try that ^^
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)