14.08.2012, 13:35
Avec le VehID ma caisse spawn pu duty
PHP Code:
stock LoadVehicule()
{
new arrCoords[32][64];
new strFromFile2[256];
new File:VehiculeFichier = fopen("Vehicules.cfg",io_readwrite);
while(fread(VehiculeFichier,strFromFile2,256) > 0)
{
split(strFromFile2, arrCoords, '|');
InfoVehicule[nbVeh][VehID] = strval(arrCoords[0]);
InfoVehicule[nbVeh][vModel] = strval(arrCoords[1]);
InfoVehicule[nbVeh][SpawnX] = floatstr(arrCoords[2]);
InfoVehicule[nbVeh][SpawnY] = floatstr(arrCoords[3]);
InfoVehicule[nbVeh][SpawnZ] = floatstr(arrCoords[4]);
InfoVehicule[nbVeh][SpawnA] = floatstr(arrCoords[5]);
InfoVehicule[nbVeh][Color1] = strval(arrCoords[6]);
InfoVehicule[nbVeh][Color2] = strval(arrCoords[7]);
InfoVehicule[nbVeh][Price] = strval(arrCoords[8]);
InfoVehicule[nbVeh][MaxEssence] = strval(arrCoords[9]);
InfoVehicule[nbVeh][Portes] = strval(arrCoords[10]);
InfoVehicule[nbVeh][Vendu] = strval(arrCoords[11]);
strmid(InfoVehicule[nbVeh][Proprio], arrCoords[12], 0, strlen(arrCoords[12]), 255);
strmid(InfoVehicule[nbVeh][plaque], arrCoords[13], 0, strlen(arrCoords[13]), 255);
CreateVehicle(InfoVehicule[nbVeh][vModel],InfoVehicule[nbVeh][SpawnX],InfoVehicule[nbVeh][SpawnY],InfoVehicule[nbVeh][SpawnZ],InfoVehicule[nbVeh][SpawnA],0,0,-1);
nbVeh++;
}
fclose(VehiculeFichier);
printf("Il а %d voiture spawn !",nbVeh);
return 1;
}