27.11.2010, 18:54
Код:
#include <a_samp> #include <gl_common> #define ARQUIVO_CARROS "carros.ini" #define AMARELO 0xFFFF00FF forward save_cars(playerid); public OnFilterScriptInit() { LoadStaticVehiclesFromFile(ARQUIVO_CARROS); SetTimer("save_cars", 300000, false) && print("Save_cars forward jб em processo..."); return 1; } public OnFilterScriptExit() { new Float:x,Float:y,Float:z,Float:a; new str[64],Model; new File:CarFile = fopen(ARQUIVO_CARROS,io_write); for(new i=1; i < MAX_VEHICLES; i++) { if((Model=GetVehicleModel(i))) { 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); DestroyVehicle(i); } else if(i == 0) return 0; } fclose(CarFile); return 1; } stock SoundForAll(SoundID) { for(new i = 0; i < MAX_PLAYERS; i++) PlayerPlaySound(i, SoundID, 0.0, 0.0, 0.0); } public save_cars(playerid) { new Float:x,Float:y,Float:z,Float:a; new str[64],Model; new File:CarFile = fopen(ARQUIVO_CARROS,io_write); for(new i=1; i < MAX_VEHICLES; i++) { if((Model=GetVehicleModel(i)) && GetVehicleHealth(i) > 0) { 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); //DestroyVehicle(i); } } fclose(CarFile); SoundForAll(1133); SendClientMessageToAll(AMARELO, "SERVER: veiculos salvos"); print("VEICULOS SALVOS EM carros.ini"); SetTimer("save_cars", 300000, true); }
Код:
457,1336.319946,1778.599975,10.819999,90.000000,-1,-1 ;
![Sad](images/smilies/sad.gif)