forward OnHouseLoad(); public OnHouseLoad() { new housestring[256]; if(cache_num_rows()) { for(new i = 0; i<cache_num_rows(); i++) { new hID = cache_get_field_content_int(i,"HouseID",mysql_con); new Float:enterx = cache_get_field_content_float(i,"EnterX",mysql_con); new Float:entery = cache_get_field_content_float(i,"EnterY",mysql_con); new Float:enterz = cache_get_field_content_float(i,"EnterZ",mysql_con); new hworld = cache_get_field_content_int(i,"InteriorVW",mysql_con); new Float:exitx = cache_get_field_content_float(i,"ExitX",mysql_con); new Float:exity = cache_get_field_content_float(i,"ExitY",mysql_con); new Float:exitz = cache_get_field_content_float(i,"ExitY",mysql_con); cache_get_field_content(i,"HouseOwner",hInfo[i][HouseOwner],mysql_con,25); cache_get_field_content(i,"HouseAdress",hInfo[i][HouseAdress],mysql_con,50); CreateDynamicPickup(1273, 1, enterx, entery, enterz, 0, 0); CreateDynamicPickup(1318, 1, exitx, exity, exitz, hworld, 0); format(housestring, sizeof(housestring), "Aadres: %s\nOmanik: %s", hInfo[i][HouseAdress], hInfo[i][HouseOwner]); Create3DTextLabel(housestring, -1, enterx, entery, enterz, 5.0, 0, 0); printf("MAJA IDga %d ON LAETUD!Omanik:%s Aadres:%s",hID,hInfo[i][HouseOwner], hInfo[i][HouseAdress]); } } else print("Maju EI leitud."); return 1; }
[00:49:39] Andmebaasiga ьhendus loodud! [00:49:39] Number of vehicle models: 0 [00:49:39] MAJA IDga 1 ON LAETUD!Omanik:RParna Aadres:Parna [00:49:39] MAJA IDga 2 ON LAETUD!Omanik:RLilla Aadres:Lilla
I am not sure what you mean? I see the correct behaviour it seems like? What should the printf actually say?
|
enum HouseDATA { HouseID, HouseOwner, HouseAdress, Float:EnterX, Float:EnterY, Float:EnterZ, Float:ExitX, Float:ExitY, Float:ExitZ, InteriorVW } new hInfo[MAX_HOUSES][HouseDATA];
Код:
enum HouseDATA { HouseID, HouseOwner, HouseAdress, Float:EnterX, Float:EnterY, Float:EnterZ, Float:ExitX, Float:ExitY, Float:ExitZ, InteriorVW } new hInfo[MAX_HOUSES][HouseDATA]; |
cache_get_field_content(); //loads strings. EG: HouseOwner[24]
cache_get_field_content_int(); //loads int values. EG: 1234 cache_get_field_content_float(); //loads float values. EG: 133.7 |