12.11.2015, 21:09
(
Последний раз редактировалось Joake6; 12.11.2015 в 22:58.
)
Hello,
I have a command that creates vehicles, works perfectly and saves it to the database but now I need a function to load the vehicle when the server starts
Variables:
Command to create vehicles:
I think it is a while loop and AddStaticVehicle function but not sure and do not know how I can do it. Sorry for bad English.
Thanks!
I have a command that creates vehicles, works perfectly and saves it to the database but now I need a function to load the vehicle when the server starts
Variables:
Код:
enum Vehiculos { IDveh, // ID Modelo, // Model Float:PosVehX, // Position X Float:PosVehY, // Position Y Float:PosVehZ, // Position Z Color1, Color2, TiempoRespawn, // Respawn time Sirena // Siren }; new Vehiculo[MAX_VEHICLES][Vehiculos];
Код:
CMD:crearcoche(playerid, params[]) // Administrador { new modelo, color1, color2; new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); new VehiculoCreado = CreateVehicle(modelo, pos[0], pos[1]+5, pos[2], color1, color2, 30000, 0); new query[512]; format(query, 512, "INSERT INTO vehiculos (Modelo, PosVehX, PosVehY, PosVehZ, Color1, Color2, TiempoRespawn) VALUES (%d, %f, %f, %f, %d, %d, 30000)", modelo, pos[0], pos[1], pos[2], color1, color2); mysql_tquery(mysql, query, "", ""); Vehiculo[VehiculoCreado][IDveh] = cache_insert_id(); Vehiculo[VehiculoCreado][Modelo] = modelo; Vehiculo[VehiculoCreado][PosVehX] = pos[0]; Vehiculo[VehiculoCreado][PosVehY] = pos[1]; Vehiculo[VehiculoCreado][PosVehZ] = pos[2]; Vehiculo[VehiculoCreado][Color1] = color1; Vehiculo[VehiculoCreado][Color2] = color2; return 1; }
Thanks!