11.09.2016, 18:57
Hey,
So I've created an org system, which has a CP using Incognito's Streamer, upon creating the org dynamically, the org's CP appears in game , and is correctly saved to the DB along with all the other org information (Name, vehicle limit, skins etc).
However upon a restarting the server, all of the org details load into the server from the db, as I can check what's loaded by typing /orgs, but weirdly the Dynamic CP isn't recreated using the saved coords loaded from the DB, i've tried updating the streamer too, for all players within range of the CP, yet still no avail, the loading code is posted below. Any help would be appreciated.
The above code is placed within the ongamemodeinit callback.
I am aware that there are duplicate values (Floats x,y,z) which were an attempt at fixing the issue, yet still nothing. The LoadOrgs function, is also forwarded.
Thanks for any support!
So I've created an org system, which has a CP using Incognito's Streamer, upon creating the org dynamically, the org's CP appears in game , and is correctly saved to the DB along with all the other org information (Name, vehicle limit, skins etc).
However upon a restarting the server, all of the org details load into the server from the db, as I can check what's loaded by typing /orgs, but weirdly the Dynamic CP isn't recreated using the saved coords loaded from the DB, i've tried updating the streamer too, for all players within range of the CP, yet still no avail, the loading code is posted below. Any help would be appreciated.
Код:
mysql_tquery(ServerMySQL, "SELECT * FROM Organisations", "LoadOrgs", "");
Код:
public LoadOrgs() { new rows =cache_num_rows(); new Float:x,Float:y,Float:z; if(rows) { new id,loaded; while(loaded < rows) { id=cache_get_field_content_int(loaded, "ID"); cache_get_field_content(loaded, "Name", oInfo[id][Name], .max_len =40 ); oInfo[id][Type]=cache_get_field_content_int(loaded, "Type"); oInfo[id][Color]=cache_get_field_content_int(loaded, "Color"); cache_get_field_content(loaded, "Leader", oInfo[id][oLeader], .max_len =40 ); oInfo[id][Skins][0]=cache_get_field_content_int(loaded, "Skin1"); oInfo[id][Skins][1]=cache_get_field_content_int(loaded, "Skin2"); oInfo[id][Skins][2]=cache_get_field_content_int(loaded, "Skin3"); oInfo[id][Members]=cache_get_field_content_int(loaded, "Members"); oInfo[id][Vehicles]=cache_get_field_content_int(loaded, "Vehicles"); oInfo[id][MemLimit]=cache_get_field_content_int(loaded, "MemberLimit"); oInfo[id][VehLimit]=cache_get_field_content_int(loaded, "VehicleLimit"); oInfo[id][CP][0]=cache_get_field_content_float(loaded, "CPX"); oInfo[id][CP][1]=cache_get_field_content_float(loaded, "CPY"); oInfo[id][CP][2]=cache_get_field_content_float(loaded, "CPZ"); oInfo[id][Wep][0]=cache_get_field_content_int(loaded, "Wep1"); oInfo[id][WepAmmo][0]=cache_get_field_content_int(loaded, "Wep1Ammo"); oInfo[id][Wep][1]=cache_get_field_content_int(loaded, "Wep2"); oInfo[id][WepAmmo][1]=cache_get_field_content_int(loaded, "Wep2Ammo"); oInfo[id][Wep][2]=cache_get_field_content_int(loaded, "Wep3"); oInfo[id][WepAmmo][2]=cache_get_field_content_int(loaded, "Wep3Ammo"); oInfo[id][Wep][3]=cache_get_field_content_int(loaded, "Wep4"); oInfo[id][WepAmmo][3]=cache_get_field_content_int(loaded, "Wep4Ammo"); oInfo[id][oBalance]=cache_get_field_content_int(loaded, "OrgBalance"); oInfo[id][oWage]=cache_get_field_content_int(loaded, "OrgWage"); x=cache_get_field_content_float(loaded, "CPX"); y=cache_get_field_content_float(loaded, "CPY"); z=cache_get_field_content_float(loaded, "CPZ"); oInfo[id][check]=CreateDynamicCP(x,y,z,1.3,-1,-1,-1,100.0); Iter_Add(Orgs, id); loaded++; } } return 1; }
Thanks for any support!