Jump to content
  • 0

Problema masini


Diendo

Question

Salutare!Din pacate am numai probleme cu sistemul de masini si as vrea sa ma ajutati cu aceasta:am adaugat in cars.ini niste masini personale am modificat in gm-idurile de la IsAnOwnableCar pana aici bine de aici  apare problema,cand pornesc serverul, din 70 de masini personale se sterg aproape 27 de masini din cars.ini si nu stiu ca sa fac sa le bag si pe acelea in server

Multumesc anicipat

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

public LoadCar()

{

new arrCoords[13][64];

new strFromFile2[256];

new File: file = fopen("cars.cfg", io_read);

if (file)

{

new idx = 225;

while (idx < sizeof(CarInfo))

{

fread(file, strFromFile2);

split(strFromFile2, arrCoords, ',');

CarInfo[idx][cModel] = strval(arrCoords[0]);

CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);

CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);

CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);

CarInfo[idx][cAngle] = floatstr(arrCoords[4]);

CarInfo[idx][cColorOne] = strval(arrCoords[5]);

CarInfo[idx][cColorTwo] = strval(arrCoords[6]);

strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);

strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);

CarInfo[idx][cValue] = strval(arrCoords[9]);

CarInfo[idx][cLicense] = strval(arrCoords[10]);

CarInfo[idx][cOwned] = strval(arrCoords[11]);

CarInfo[idx][cLock] = strval(arrCoords[12]);

printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);

idx++;

}

}

return 1;

}

public SaveCarCoords()

{

new idx;

new File: file2;

while (idx < sizeof(CarInfo))

{

    new coordsstring[256];

    format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d\n",

CarInfo[idx][cModel],

CarInfo[idx][cLocationx],

CarInfo[idx][cLocationy],

CarInfo[idx][cLocationz],

CarInfo[idx][cAngle],

CarInfo[idx][cColorOne],

CarInfo[idx][cColorTwo]);

if(idx == 225)

{

file2 = fopen("cars.cfg", io_write);

}

else

{

file2 = fopen("cars.cfg", io_append);

}

fwrite(file2, coordsstring);

idx++;

fclose(file2);

}

return 1;

}

Uitati

Link to comment
Share on other sites

Probleme este de la CarInfo nu de la loadcars,cars.cfg sau altele.

Deoarece variabila carinfo iti calculeaza toate masinile de la server de exemplu sa zicem 230 si masinile de la cars.cfg adica sa zicem 45 masini personale ai in fisier.

Calcul se face 230 + 45 = 275 vei avea la CarInfo iar astfel toate masinile vor intra pe server.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.