29.01.2019, 00:50
so using debugger(print) i found that the bug is on creating label text
GetDealershipName
tried with CreateDynamic3DTextLabel and Create3DTextLabel, it's stopping the code, only printing the first dealer info
PHP код:
format(m, sizeof(m), "This Vehicle Is For Sell!\nVehicle Name : %s\nPrice : $%i\nDealership : %s", VehicleNames[DSVehicle[id][vehicle_model]-400],DSVehicle[id][vehicle_price],GetDealershipName(DSVehicle[id][vehicle_dealer]));
DSVehicle[id][vehicle_text]=CreateDynamic3DTextLabel(m ,COLOR_ORANGE, DSVehicle[id][vehicle_pos][0], DSVehicle[id][vehicle_pos][1], DSVehicle[id][vehicle_pos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
PHP код:
GetDealershipName(sqlid){
new query[128], name[64];
mysql_format(dbhandle, query, sizeof(query), "SELECT name FROM `dealerships` WHERE ID = '%d'", sqlid);
new Cache:result = mysql_query(dbhandle, query);
cache_get_field_content(0, "name", name, dbhandle, 64); //or what ever your players name saves as
cache_delete(result);
return name;
}