19.12.2011, 18:50
(
Последний раз редактировалось Ballu Miaa; 19.12.2011 в 19:29.
)
First-
A guy Called Mrki_Drakula gave me this code to Load Vehicle's from a file! But i dont know the usage or anything about using this FS he has designed. Can someone please tell me what each function is doing over here and How to Load and Save Vehicle's using LoadStaticVehicleFromFile() , Help will be highly appreciated with rep+
Thanks
Ballu Miaa
A guy Called Mrki_Drakula gave me this code to Load Vehicle's from a file! But i dont know the usage or anything about using this FS he has designed. Can someone please tell me what each function is doing over here and How to Load and Save Vehicle's using LoadStaticVehicleFromFile() , Help will be highly appreciated with rep+
Thanks
Ballu Miaa
pawn Код:
#include <a_samp>
#include <gl_common>
#define FILTERSCRIPT
#define CARS "cars.ini"
new bool:ValidVeh[MAX_VEHICLES] ;
public OnFilterScriptInit()
{
LoadStaticVehiclesFromFile(CARS);
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(CARS, 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;
}