02.03.2015, 22:54
I been messing around with this for hours now trying to fix it and it just will not load backup on the server restart.
i mean it saves within the database it creates the entrance X Y Z and the others etc, i just can't manage to get it loading.
Saving..
Entrance load
i mean it saves within the database it creates the entrance X Y Z and the others etc, i just can't manage to get it loading.
Saving..
Код:
Entrance_Save(entranceid) { static query[1024]; format(query, sizeof(query), "UPDATE `entrances` SET `entranceName` = '%s', `entrancePass` = '%s', `entranceIcon` = '%d', `entranceLocked` = '%d', `entrancePosX` = '%.4f', `entrancePosY` = '%.4f', `entrancePosZ` = '%.4f', `entrancePosA` = '%.4f', `entranceIntX` = '%.4f', `entranceIntY` = '%.4f', `entranceIntZ` = '%.4f', `entranceIntA` = '%.4f', `entranceInterior` = '%d', `entranceExterior` = '%d', `entranceExteriorVW` = '%d', `entranceType` = '%d'", SQL_ReturnEscaped(EntranceData[entranceid][entranceName]), SQL_ReturnEscaped(EntranceData[entranceid][entrancePass]), EntranceData[entranceid][entranceIcon], EntranceData[entranceid][entranceLocked], EntranceData[entranceid][entrancePos][0], EntranceData[entranceid][entrancePos][1], EntranceData[entranceid][entrancePos][2], EntranceData[entranceid][entrancePos][3], EntranceData[entranceid][entranceInt][0], EntranceData[entranceid][entranceInt][1], EntranceData[entranceid][entranceInt][2], EntranceData[entranceid][entranceInt][3], EntranceData[entranceid][entranceInterior], EntranceData[entranceid][entranceExterior], EntranceData[entranceid][entranceExteriorVW], EntranceData[entranceid][entranceType] ); format(query, sizeof(query), "%s, `entranceCustom` = '%d', `entranceWorld` = '%d' WHERE `entranceID` = '%d'", query, EntranceData[entranceid][entranceCustom], EntranceData[entranceid][entranceWorld], EntranceData[entranceid][entranceID] ); return mysql_function_query(sqlHandle, query, false, "", ""); }
Код:
forward Entrance_Load(); public Entrance_Load() { static rows, fields; cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows; i ++) if (i < MAX_ENTRANCES) { EntranceData[i][entranceExists] = true; EntranceData[i][entranceID] = cache_get_field_int(i, "entranceID"); cache_get_field_content(i, "entranceName", EntranceData[i][entranceName], g_iHandle); cache_get_field_content(i, "entrancePass", EntranceData[i][entrancePass], g_iHandle); EntranceData[i][entranceIcon] = cache_get_field_int(i, "entranceIcon"); EntranceData[i][entranceLocked] = cache_get_field_int(i, "entranceLocked"); EntranceData[i][entrancePos][0] = cache_get_field_float(i, "entrancePosX"); EntranceData[i][entrancePos][1] = cache_get_field_float(i, "entrancePosY"); EntranceData[i][entrancePos][2] = cache_get_field_float(i, "entrancePosZ"); EntranceData[i][entrancePos][3] = cache_get_field_float(i, "entrancePosA"); EntranceData[i][entranceInt][0] = cache_get_field_float(i, "entranceIntX"); EntranceData[i][entranceInt][1] = cache_get_field_float(i, "entranceIntY"); EntranceData[i][entranceInt][2] = cache_get_field_float(i, "entranceIntZ"); EntranceData[i][entranceInt][3] = cache_get_field_float(i, "entranceIntA"); EntranceData[i][entranceInterior] = cache_get_field_int(i, "entranceInterior"); EntranceData[i][entranceExterior] = cache_get_field_int(i, "entranceExterior"); EntranceData[i][entranceExteriorVW] = cache_get_field_int(i, "entranceExteriorVW"); EntranceData[i][entranceType] = cache_get_field_int(i, "entranceType"); EntranceData[i][entranceCustom] = cache_get_field_int(i, "entranceCustom"); EntranceData[i][entranceWorld] = cache_get_field_int(i, "entranceWorld"); if (EntranceData[i][entranceType] == 3) CreateForklifts(i); Entrance_Refresh(i); } return 1; }
Код:
stock LoadEntrances() { mysql_function_query(sqlHandle, "SELECT `entranceID`,`entranceName`,`entranceIcon1`,`entrancePosX`,`entrancePosY`,`entrancePosZ`,`entrancePosA`,`entranceIntX`,`entranceIntY`,`entranceIntZ`,`entranceIntA`,`entranceInterior`,`entranceExterior`,`entranceExteriorVW`,`entranceType`,`entrancePass`,`entranceLocked`,`entranceCustom`,`entranceWorld` FROM ` entrances`", true, "Entrance_Load",""); }