12.10.2013, 15:46
Код:
stock LoadCar() { new Query[128]; new vid; new string[62]; format(Query, sizeof(Query), "SELECT `Id`, `Owner`, `Ownername`, `Model`, `PosX`, `PosY`, `PosZ` `PosFace`, `Color1`, `Color2`, `Plate` FROM `vehicle`"); mysql_query(Query); mysql_store_result(); while(mysql_fetch_row(Query, "|")) { vid = LoadedInfo[Vehicles]; sscanf(Query, "p<|>dds[25]dffffdds[32]",VehicleInfo[vid][Id],VehicleInfo[vid][Owner],VehicleInfo[vid][Ownername],VehicleInfo[vid][Model], VehicleInfo[vid][PosX], VehicleInfo[vid][PosY], VehicleInfo[vid][PosZ], VehicleInfo[vid][PosFace], VehicleInfo[vid][Color1], VehicleInfo[vid][Color2], VehicleInfo[vid][Plate]); new vehd = CreateVehicle(VehicleInfo[vid][Model], VehicleInfo[vid][PosX], VehicleInfo[vid][PosY], VehicleInfo[vid][PosZ], VehicleInfo[vid][PosFace], VehicleInfo[vid][Color1], VehicleInfo[vid][Color2],-1); SetVehicleNumberPlate(vehd, VehicleInfo[vid][Plate]); LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1; } format(string, sizeof(string), "%d kocsi betцltve!", LoadedInfo[Vehicles]); print(string); }
Sorry for my bad english