Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward Faction_Load();
- public Faction_Load()
- {
- static
- rows,
- fields,
- str[32];
- cache_get_data(rows, fields, g_iHandle);
- for (new i = 0; i < rows; i ++) if (i < MAX_FACTIONS)
- {
- FactionData[i][factionExists] = true;
- FactionData[i][factionID] = cache_get_field_int(i, "factionID");
- cache_get_field_content(i, "factionName", FactionData[i][factionName], g_iHandle, 32);
- FactionData[i][factionColor] = cache_get_field_int(i, "factionColor");
- FactionData[i][factionType] = cache_get_field_int(i, "factionType");
- FactionData[i][factionRanks] = cache_get_field_int(i, "factionRanks");
- FactionData[i][factionControl] = cache_get_field_int(i, "factionControl");
- FactionData[i][factionLockerPos][0] = cache_get_field_float(i, "factionLockerX");
- FactionData[i][factionLockerPos][1] = cache_get_field_float(i, "factionLockerY");
- FactionData[i][factionLockerPos][2] = cache_get_field_float(i, "factionLockerZ");
- FactionData[i][factionLockerInt] = cache_get_field_int(i, "factionLockerInt");
- FactionData[i][factionLockerWorld] = cache_get_field_int(i, "factionLockerWorld");
- //Spawning
- FactionData[i][SpawnX] = cache_get_field_float(i, "SpawnX");
- FactionData[i][SpawnY] = cache_get_field_float(i, "SpawnY");
- FactionData[i][SpawnZ] = cache_get_field_float(i, "SpawnZ");
- FactionData[i][SpawnInterior] = cache_get_field_int(i, "SpawnInterior");
- FactionData[i][SpawnVW] = cache_get_field_int(i, "SpawnVW");
- for (new j = 0; j < 8; j ++) {
- format(str, sizeof(str), "factionSkin%d", j + 1);
- FactionData[i][factionSkins][j] = cache_get_field_int(i, str);
- }
- for (new j = 0; j < 10; j ++) {
- format(str, sizeof(str), "factionWeapon%d", j + 1);
- FactionData[i][factionWeapons][j] = cache_get_field_int(i, str);
- format(str, sizeof(str), "factionAmmo%d", j + 1);
- FactionData[i][factionAmmo][j] = cache_get_field_int(i, str);
- }
- SQL_LoadFactionRanks(i, FactionData[i][factionRanks]);
- Faction_Refresh(i);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement