Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LoadFacs()
- {
- new Cache: result1 = mysql_query(handle, "SELECT * FROM `factions` ORDER BY `factions`.`factionID` ASC");
- new x;
- for ( new i, j = cache_get_row_count ( ); i != j; ++i )
- {
- x++;
- cache_get_field_content(i, "factionName", temp); format(FactionInfo[x][fName], 64, temp);
- cache_get_field_content(i, "factionPosX", temp); FactionInfo[x][fExteriorPos][0] = floatstr(temp);
- cache_get_field_content(i, "factionPosY", temp); FactionInfo[x][fExteriorPos][1] = floatstr(temp);
- cache_get_field_content(i, "factionPosZ", temp); FactionInfo[x][fExteriorPos][2] = floatstr(temp);
- cache_get_field_content(i, "factionType", temp); FactionInfo[x][fType] = strval(temp);
- cache_get_field_content(i, "factionInteriorX", temp); FactionInfo[x][fInteriorPos][0] = floatstr(temp);
- cache_get_field_content(i, "factionInteriorY", temp); FactionInfo[x][fInteriorPos][1] = floatstr(temp);
- cache_get_field_content(i, "factionInteriorZ", temp); FactionInfo[x][fInteriorPos][2] = floatstr(temp);
- cache_get_field_content(i, "factionInterior", temp); FactionInfo[x][fInterior] = strval(temp);
- cache_get_field_content(i, "factionSafeX", temp); FactionInfo[x][fSafePos][0] = floatstr(temp);
- cache_get_field_content(i, "factionSafeY", temp); FactionInfo[x][fSafePos][1] = floatstr(temp);
- cache_get_field_content(i, "factionSafeZ", temp); FactionInfo[x][fSafePos][2] = floatstr(temp);
- cache_get_field_content(i, "factionSafeMoney", temp); FactionInfo[x][fSafe][0] = strval(temp);
- cache_get_field_content(i, "factionSafeMats", temp); FactionInfo[x][fSafe][1] = strval(temp);
- cache_get_field_content(i, "factionSafeDrugs", temp); FactionInfo[x][fSafe][2] = strval(temp);
- cache_get_field_content(i, "factionLock", temp); FactionInfo[x][fLock] = strval(temp);
- cache_get_field_content(i, "factionRankName1", temp); format(FactionInfo[x][fRankName1], 32, temp);
- cache_get_field_content(i, "factionRankName2", temp); format(FactionInfo[x][fRankName2], 32, temp);
- cache_get_field_content(i, "factionRankName3", temp); format(FactionInfo[x][fRankName3], 32, temp);
- cache_get_field_content(i, "factionRankName4", temp); format(FactionInfo[x][fRankName4], 32, temp);
- cache_get_field_content(i, "factionRankName5", temp); format(FactionInfo[x][fRankName5], 32, temp);
- cache_get_field_content(i, "factionRankName6", temp); format(FactionInfo[x][fRankName6], 32, temp);
- cache_get_field_content(i, "factionRankName7", temp); format(FactionInfo[x][fRankName7], 32, temp);
- cache_get_field_content(i, "MaxMembers", temp); FactionInfo[x][fMaxMembers] = strval(temp);
- switch(FactionInfo[x][fLock])
- {
- case 0: format(temp, sizeof(temp), "%s's HQ\n\nPress ~k~~VEHICLE_ENTER_EXIT~ to enter.", FactionInfo[x][fName]);
- case 1: format(temp, sizeof(temp), "%s's HQ\n\n(locked)", FactionInfo[x][fName]);
- }
- if(x == 1 || x == 2)
- {
- FactionInfo[x][fPickupID] = CreateDynamicPickup(1247, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
- FactionInfo[x][fLabelID] = CreateDynamic3DTextLabel(temp, COLOR_NICESKY, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
- }
- else if(x == 3)
- {
- FactionInfo[x][fPickupID] = CreateDynamicPickup(1241, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
- FactionInfo[x][fLabelID] = CreateDynamic3DTextLabel(temp, COLOR_NICESKY, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
- }
- else if(x == 4)
- {
- FactionInfo[x][fPickupID] = CreateDynamicPickup(1313, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
- FactionInfo[x][fLabelID] = CreateDynamic3DTextLabel(temp, COLOR_NICESKY, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
- }
- else if(x == 5 || x == 6)
- {
- FactionInfo[x][fPickupID] = CreateDynamicPickup(1254, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
- FactionInfo[x][fLabelID] = CreateDynamic3DTextLabel(temp, COLOR_NICESKY, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
- }
- else if(x == 7)
- {
- FactionInfo[x][fPickupID] = CreateDynamicPickup(1314, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
- FactionInfo[x][fLabelID] = CreateDynamic3DTextLabel(temp, COLOR_NICESKY, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 25.0);
- }
- format(temp, sizeof(temp), "ID: {51D923}%d{FFFFFF}\nName: {51D923}%s{FFFFFF}\n\nFaction Deposit\nType {51D923}/fdeposit{FFFFFF}", x, FactionInfo[x][fName]);
- FactionInfo[x][fSafePickupID] = CreateDynamicPickup(1274, 23, FactionInfo[x][fSafePos][0], FactionInfo[x][fSafePos][1], FactionInfo[x][fSafePos][2], FACTION_VIRTUAL_WORLD+x, FactionInfo[x][fInterior], -1, 50);
- FactionInfo[x][fSafeLabelID] = CreateDynamic3DTextLabel(temp, COLOR_WHITE, FactionInfo[x][fSafePos][0], FactionInfo[x][fSafePos][1], FactionInfo[x][fSafePos][2], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, FACTION_VIRTUAL_WORLD+x, FactionInfo[x][fInterior], -1, 50.0);
- }
- cache_delete(result1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement