PHP код:
#define MAX_DVEHICLES 500
enum vInfo
{
vModel,
vID,
Float:vX,
Float:vY,
Float:vZ,
Float:vA,
vJob,
vFaction,
vC1,
vC2,
vWeed,
vMoney,
}
new VehInfo[MAX_DVEHICLES][vInfo];
new VehCount = 0;
forward LoadVehicles_Vehicle(vehid,name[],value[]);
public LoadVehicles_Vehicle(vehid,name[],value[])
{
INI_Int("vModel", VehInfo[vehid][vModel]);
INI_Float("vX", VehInfo[vehid][vX]);
INI_Float("vY", VehInfo[vehid][vY]);
INI_Float("vZ", VehInfo[vehid][vZ]);
INI_Float("vA", VehInfo[vehid][vA]);
INI_Int("vJob", VehInfo[vehid][vJob]);
INI_Int("vFaction", VehInfo[vehid][vFaction]);
INI_Int("Color1", VehInfo[vehid][vC1]);
INI_Int("Color2", VehInfo[vehid][vC2]);
INI_Int("vWeed", VehInfo[vehid][vWeed]);
INI_Int("vMoney", VehInfo[vehid][vMoney]);
return true;
}
LoadVehicles()
{
for(new i = 0; i < MAX_DVEHICLES; i++)
{
INI_ParseFile(VehPath(i), "LoadVehicles_%s", .bExtra = true, .extra = i);
CreateVehicle(VehInfo[i][vModel],VehInfo[i][vX],VehInfo[i][vY],VehInfo[i][vZ],VehInfo[i][vA],VehInfo[i][vC1],VehInfo[i][vC2], 99999);
}
return true;
}
public OnGamemodeInit()
{
LoadVehicles();
}