05.03.2010, 23:05
Hey guys, I have added LA:RPs SaveCarCoords
Its for ownablevehicles but anyways i got everything to work accept one things
Everytime i restart my gamemode it there is allways some cars that gets deleted between 1-20 cars but i dont know why :S
I use this code
I wish some one could help me with this, i use to be a good scripter but everything i have tryed doesnt work and my brain is like a "?" XD
Its for ownablevehicles but anyways i got everything to work accept one things
Everytime i restart my gamemode it there is allways some cars that gets deleted between 1-20 cars but i dont know why :S
I use this code
Код:
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 == 194)
{
file2 = fopen("cars.cfg", io_write);
}
else
{
file2 = fopen("cars.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}

