enum VehData { Float:VehHealth }; new PVeh[MAX_VEHICLES][VehData]; public OnPlayerSpawn(playerid) { new query[120]; mysql_format(mysql, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e'", PlayerNameGet(playerid)); mysql_tquery(mysql, query, "LoadVehicle", "i", playerid); return 1; } forward LoadVehicle(playerid); public LoadVehicle(playerid) { new vehicleid; PVeh[vehicleid][VehModel] = cache_get_field_content_int(0, "VehModel"); PVeh[vehicleid][VehDestroyed] = cache_get_field_content_int(0, "VehDestroyed"); PVeh[vehicleid][VehFuel] = cache_get_field_content_int(0, "VehFuel"); PVeh[vehicleid][VehHealth] = cache_get_field_content_float(0, "VehHealth"); PVeh[vehicleid][VehX] = cache_get_field_content_float(0, "VehX"); PVeh[vehicleid][VehY] = cache_get_field_content_float(0, "VehY"); PVeh[vehicleid][VehZ] = cache_get_field_content_float(0, "VehZ"); PVeh[vehicleid][VehA] = cache_get_field_content_float(0, "VehA"); printf("Health %.2f",PVeh[vehicleid][VehHealth]); vehicleid = CreateVehicle(PVeh[playerid][VehModel],PVeh[playerid][VehX], PVeh[playerid][VehY], PVeh[playerid][VehZ],PVeh[playerid][VehA],-1,-1,-1); printf("Veh health : %.2f", PVeh[vehicleid][VehHealth]); }
new vehicleid; PVeh[vehicleid][VehModel] = cache_get_field_content_int(0, "VehModel"); PVeh[vehicleid][VehDestroyed] = cache_get_field_content_int(0, "VehDestroyed"); PVeh[vehicleid][VehFuel] = cache_get_field_content_int(0, "VehFuel"); PVeh[vehicleid][VehHealth] = cache_get_field_content_float(0, "VehHealth"); PVeh[vehicleid][VehX] = cache_get_field_content_float(0, "VehX"); PVeh[vehicleid][VehY] = cache_get_field_content_float(0, "VehY"); PVeh[vehicleid][VehZ] = cache_get_field_content_float(0, "VehZ"); PVeh[vehicleid][VehA] = cache_get_field_content_float(0, "VehA"); printf("Health %.2f",PVeh[vehicleid][VehHealth]); vehicleid = CreateVehicle(PVeh[playerid][VehModel],PVeh[playerid][VehX], PVeh[playerid][VehY], PVeh[playerid][VehZ],PVeh[playerid][VehA],-1,-1,-1); printf("Veh health : %.2f", PVeh[vehicleid][VehHealth]);
Where do you change your Veh health?
Have you checked your mysql_log yet? |
[20:03:03] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VehOwned", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehOwned", data: "1" [20:03:03] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VehModel", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehModel", data: "468" [20:03:03] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VehDestroyed", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehDestroyed", data: "0" [20:03:03] [DEBUG] cache_get_field_content_int - row: 0, field_name: "VehFuel", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehFuel", data: "100" [20:03:03] [DEBUG] cache_get_field_content_float - row: 0, field_name: "VehX", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehX", data: "193.531" [20:03:03] [DEBUG] cache_get_field_content_float - row: 0, field_name: "VehY", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehY", data: "1918.18" [20:03:03] [DEBUG] cache_get_field_content_float - row: 0, field_name: "VehZ", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehZ", data: "17.641" [20:03:03] [DEBUG] cache_get_field_content_float - row: 0, field_name: "VehA", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehA", data: "0" [20:03:03] [DEBUG] cache_get_field_content_float - row: 0, field_name: "VehHealth", connection: 1 [20:03:03] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "VehHealth", data: "500" [20:03:03] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called