28.11.2010, 18:56
There' s a simple bug on my vehicle system ( I think the last u_u ). And I bet it's on OnFilterScriptInit. Look;
That saves and reload the cars normally, on same x,y,z and model. But when I destroy all cars of server, and I reload on close the FS (server console or /rcon reloadfs savecar), it deletes all cars saved before. And I'd like to know how to avoid it x=
Код:
public OnFilterScriptExit() { new Float:x,Float:y,Float:z,Float:a; new str[64],Model; new count = 0; new File:CarFile = fopen(ARQUIVO_CARROS,io_write); for(new i=1; i < MAX_VEHICLES; i++) { if((Model=GetVehicleModel(i))) { count++; { GetVehiclePos(i,x,y,z); GetVehicleZAngle(i,a); format(str,64,"%d,%f,%f,%f,%f,%d,%d ;\r\n",Model,x,y,z,a,-1,-1); fwrite(CarFile,str); } else if(count == 0) return false; } } fclose(CarFile); return 1; }