02.07.2014, 13:26
I cant solve this problem. I am busy making a vehicle system for my gamemode and kinda need this solved ASAP.
Thanks
Enums:
Code:
Thanks
Enums:
Код:
enum loadedinfo { vehicles = 0, } new LoadedInfo[loadedinfo]; enum posInfo { Float: vX, Float: vY, Float: vZ, Float: vR, } enum vehicleinfo { vID, vOwner[25], vModel, vPrice, Float:Pos[posInfo], vColor1, vColor2 } new vInfo[SCRIPT_CARS][vehicleinfo];
Код:
stock Load_Vehicles() { new Query[512], savestr[50], rows, fields, id; mysql_format(dbHandle,Query, sizeof(Query), "SELECT * FROM `Vehicles`"); mysql_query(dbHandle,Query); cache_get_data(rows, fields); id = LoadedInfo[vehicles]; if(rows) { /* cache_get_field_content(0, "ID", savestr); vInfo[SCRIPT_CARS][vID] = strval(savestr); cache_get_field_content(0, "Owner", savestr); vInfo[SCRIPT_CARS][vOwner] = strval(savestr); cache_get_field_content_int(0, "Model", savestr); vInfo[SCRIPT_CARS][vModel] = strval(savestr); cache_get_field_content(0, "PosX", savestr); vInfo[SCRIPT_CARS][vPosX] = floatstr(savestr); cache_get_field_content(0, "PosY", savestr); vInfo[SCRIPT_CARS][vPosY] = floatstr(savestr); cache_get_field_content(0, "PosZ", savestr); vInfo[SCRIPT_CARS][vPosZ] = floatstr(savestr); cache_get_field_content(0, "PosA", savestr); vInfo[SCRIPT_CARS][vPosA] = floatstr(savestr); cache_get_field_content_int(0, "Color1", savestr); vInfo[SCRIPT_CARS][vColor1] = strval(savestr); cache_get_field_content_int(0, "Color2", savestr); vInfo[SCRIPT_CARS][vColor2] = strval(savestr); */ cache_get_field_content(0, "ID", savestr); vInfo[SCRIPT_CARS][vID] = strval(savestr); } AddStaticVehicleEx(vInfo[id][vModel], vInfo[id][Pos][vX], vInfo[id][Pos][vY], vInfo[id][Pos][vZ], vInfo[id][Pos][vR], vInfo[SCRIPT_CARS][vColor1], vInfo[SCRIPT_CARS][vColor2], 10000); }