Advertisement
ZH14

Untitled

Apr 16th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. forward Faction_Load();
  2. public Faction_Load()
  3. {
  4. static
  5. rows,
  6. fields,
  7. str[32];
  8.  
  9. cache_get_data(rows, fields, g_iHandle);
  10.  
  11. for (new i = 0; i < rows; i ++) if (i < MAX_FACTIONS)
  12. {
  13. FactionData[i][factionExists] = true;
  14. FactionData[i][factionID] = cache_get_field_int(i, "factionID");
  15.  
  16. cache_get_field_content(i, "factionName", FactionData[i][factionName], g_iHandle, 32);
  17.  
  18. FactionData[i][factionColor] = cache_get_field_int(i, "factionColor");
  19. FactionData[i][factionType] = cache_get_field_int(i, "factionType");
  20. FactionData[i][factionRanks] = cache_get_field_int(i, "factionRanks");
  21. FactionData[i][factionControl] = cache_get_field_int(i, "factionControl");
  22. FactionData[i][factionLockerPos][0] = cache_get_field_float(i, "factionLockerX");
  23. FactionData[i][factionLockerPos][1] = cache_get_field_float(i, "factionLockerY");
  24. FactionData[i][factionLockerPos][2] = cache_get_field_float(i, "factionLockerZ");
  25. FactionData[i][factionLockerInt] = cache_get_field_int(i, "factionLockerInt");
  26. FactionData[i][factionLockerWorld] = cache_get_field_int(i, "factionLockerWorld");
  27.  
  28. //Spawning
  29. FactionData[i][SpawnX] = cache_get_field_float(i, "SpawnX");
  30. FactionData[i][SpawnY] = cache_get_field_float(i, "SpawnY");
  31. FactionData[i][SpawnZ] = cache_get_field_float(i, "SpawnZ");
  32. FactionData[i][SpawnInterior] = cache_get_field_int(i, "SpawnInterior");
  33. FactionData[i][SpawnVW] = cache_get_field_int(i, "SpawnVW");
  34.  
  35. for (new j = 0; j < 8; j ++) {
  36. format(str, sizeof(str), "factionSkin%d", j + 1);
  37.  
  38. FactionData[i][factionSkins][j] = cache_get_field_int(i, str);
  39. }
  40.  
  41. for (new j = 0; j < 10; j ++) {
  42. format(str, sizeof(str), "factionWeapon%d", j + 1);
  43.  
  44. FactionData[i][factionWeapons][j] = cache_get_field_int(i, str);
  45.  
  46. format(str, sizeof(str), "factionAmmo%d", j + 1);
  47.  
  48. FactionData[i][factionAmmo][j] = cache_get_field_int(i, str);
  49. }
  50.  
  51. SQL_LoadFactionRanks(i, FactionData[i][factionRanks]);
  52.  
  53. Faction_Refresh(i);
  54. }
  55. return 1;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement