Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. public LoadFacs()
  2. {
  3. new Cache: result1 = mysql_query(handle, "SELECT * FROM `factions` ORDER BY `factions`.`factionID` ASC");
  4. new x;
  5. for ( new i, j = cache_get_row_count ( ); i != j; ++i )
  6. {
  7. x++;
  8. cache_get_field_content(i, "factionName", temp); format(FactionInfo[x][fName], 64, temp);
  9. cache_get_field_content(i, "factionPosX", temp); FactionInfo[x][fExteriorPos][0] = floatstr(temp);
  10. cache_get_field_content(i, "factionPosY", temp); FactionInfo[x][fExteriorPos][1] = floatstr(temp);
  11. cache_get_field_content(i, "factionPosZ", temp); FactionInfo[x][fExteriorPos][2] = floatstr(temp);
  12. cache_get_field_content(i, "factionType", temp); FactionInfo[x][fType] = strval(temp);
  13. cache_get_field_content(i, "factionInteriorX", temp); FactionInfo[x][fInteriorPos][0] = floatstr(temp);
  14. cache_get_field_content(i, "factionInteriorY", temp); FactionInfo[x][fInteriorPos][1] = floatstr(temp);
  15. cache_get_field_content(i, "factionInteriorZ", temp); FactionInfo[x][fInteriorPos][2] = floatstr(temp);
  16. cache_get_field_content(i, "factionInterior", temp); FactionInfo[x][fInterior] = strval(temp);
  17. cache_get_field_content(i, "factionSafeX", temp); FactionInfo[x][fSafePos][0] = floatstr(temp);
  18. cache_get_field_content(i, "factionSafeY", temp); FactionInfo[x][fSafePos][1] = floatstr(temp);
  19. cache_get_field_content(i, "factionSafeZ", temp); FactionInfo[x][fSafePos][2] = floatstr(temp);
  20. cache_get_field_content(i, "factionSafeMoney", temp); FactionInfo[x][fSafe][0] = strval(temp);
  21. cache_get_field_content(i, "factionSafeMats", temp); FactionInfo[x][fSafe][1] = strval(temp);
  22. cache_get_field_content(i, "factionSafeDrugs", temp); FactionInfo[x][fSafe][2] = strval(temp);
  23. cache_get_field_content(i, "factionLock", temp); FactionInfo[x][fLock] = strval(temp);
  24. cache_get_field_content(i, "factionRankName1", temp); format(FactionInfo[x][fRankName1], 32, temp);
  25. cache_get_field_content(i, "factionRankName2", temp); format(FactionInfo[x][fRankName2], 32, temp);
  26. cache_get_field_content(i, "factionRankName3", temp); format(FactionInfo[x][fRankName3], 32, temp);
  27. cache_get_field_content(i, "factionRankName4", temp); format(FactionInfo[x][fRankName4], 32, temp);
  28. cache_get_field_content(i, "factionRankName5", temp); format(FactionInfo[x][fRankName5], 32, temp);
  29. cache_get_field_content(i, "factionRankName6", temp); format(FactionInfo[x][fRankName6], 32, temp);
  30. cache_get_field_content(i, "factionRankName7", temp); format(FactionInfo[x][fRankName7], 32, temp);
  31. cache_get_field_content(i, "MaxMembers", temp); FactionInfo[x][fMaxMembers] = strval(temp);
  32.  
  33. switch(FactionInfo[x][fLock])
  34. {
  35. case 0: format(temp, sizeof(temp), "%s's HQ\n\nPress ~k~~VEHICLE_ENTER_EXIT~ to enter.", FactionInfo[x][fName]);
  36. case 1: format(temp, sizeof(temp), "%s's HQ\n\n(locked)", FactionInfo[x][fName]);
  37. }
  38.  
  39. if(x == 1 || x == 2)
  40. {
  41. FactionInfo[x][fPickupID] = CreateDynamicPickup(1247, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
  42. 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);
  43. }
  44. else if(x == 3)
  45. {
  46. FactionInfo[x][fPickupID] = CreateDynamicPickup(1241, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
  47. 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);
  48. }
  49. else if(x == 4)
  50. {
  51. FactionInfo[x][fPickupID] = CreateDynamicPickup(1313, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
  52. 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);
  53. }
  54. else if(x == 5 || x == 6)
  55. {
  56. FactionInfo[x][fPickupID] = CreateDynamicPickup(1254, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
  57. 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);
  58. }
  59. else if(x == 7)
  60. {
  61. FactionInfo[x][fPickupID] = CreateDynamicPickup(1314, 23, FactionInfo[x][fExteriorPos][0], FactionInfo[x][fExteriorPos][1], FactionInfo[x][fExteriorPos][2], 0, -1, -1, 25.0);
  62. 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);
  63. }
  64. format(temp, sizeof(temp), "ID: {51D923}%d{FFFFFF}\nName: {51D923}%s{FFFFFF}\n\nFaction Deposit\nType {51D923}/fdeposit{FFFFFF}", x, FactionInfo[x][fName]);
  65.  
  66. 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);
  67. 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);
  68.  
  69. }
  70. cache_delete(result1);
  71. return 1;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement