Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. public LoadFactions()
  2. {
  3. new result[100],label[128],index = 0;
  4. mysql_query(SQL,"SELECT * FROM `factions` ORDER BY `factions`.`ID` ASC");
  5. mysql_store_result();
  6. while(mysql_retrieve_row())
  7. {
  8. index++;
  9. serverfactions++;
  10. new i = index;
  11. mysql_get_field("ID", result); DynamicFactions[i][fID] = strval(result);
  12. mysql_get_field("Name", result); strmid(DynamicFactions[i][fName], result, 0, 100, 100);
  13. mysql_get_field("IntX", result); DynamicFactions[i][fcX] = floatstr(result);
  14. mysql_get_field("IntY", result); DynamicFactions[i][fcY] = floatstr(result);
  15. mysql_get_field("IntZ", result); DynamicFactions[i][fcZ] = floatstr(result);
  16. mysql_get_field("X", result); DynamicFactions[i][extX] = floatstr(result);
  17. mysql_get_field("Y", result); DynamicFactions[i][extY] = floatstr(result);
  18. mysql_get_field("Z", result); DynamicFactions[i][extZ] = floatstr(result);
  19. mysql_get_field("VW", result); DynamicFactions[i][fVW] = strval(result);
  20. mysql_get_field("Interior", result); DynamicFactions[i][fInterior] = strval(result);
  21. mysql_get_field("Mats", result); DynamicFactions[i][fMats] = strval(result);
  22. mysql_get_field("Drugs", result); DynamicFactions[i][fDrugs] = strval(result);
  23. mysql_get_field("Bank", result); DynamicFactions[i][fBank] = strval(result);
  24. mysql_get_field("Anunt", result); strmid(DynamicFactions[i][fAnn], result, 0, 100, 100);
  25. mysql_get_field("Name1", result); strmid(fRankNames[i][0], result, 0, 100, 100);
  26. mysql_get_field("Name2", result); strmid(fRankNames[i][1], result, 0, 100, 100);
  27. mysql_get_field("Name3", result); strmid(fRankNames[i][2], result, 0, 100, 100);
  28. mysql_get_field("Name4", result); strmid(fRankNames[i][3], result, 0, 100, 100);
  29. mysql_get_field("Name5", result); strmid(fRankNames[i][4], result, 0, 100, 100);
  30. mysql_get_field("Name6", result); strmid(fRankNames[i][5], result, 0, 100, 100);
  31. mysql_get_field("Name7", result); strmid(fRankNames[i][6], result, 0, 100, 100);
  32. mysql_get_field("App", result); DynamicFactions[i][fApp] = strval(result);
  33. mysql_get_field("Type", result); DynamicFactions[i][fType] = strval(result);
  34.  
  35. new x = i;
  36. cache_get_field_content(i, "Rank1", result); FactionInfo[x][fRank1] = strval(result);
  37. cache_get_field_content(i, "Rank2", result); FactionInfo[x][fRank2] = strval(result);
  38. cache_get_field_content(i, "Rank3", result); FactionInfo[x][fRank3] = strval(result);
  39. cache_get_field_content(i, "Rank4", result); FactionInfo[x][fRank4] = strval(result);
  40. cache_get_field_content(i, "Rank5", result); FactionInfo[x][fRank5] = strval(result);
  41. cache_get_field_content(i, "Rank6", result); FactionInfo[x][fRank6] = strval(result);
  42.  
  43. if(x != 7) {
  44. format(label, sizeof(label), "%s HQ\nApasa pe Enter pentru a intra", DynamicFactions[i][fName]);
  45. Create3DTextLabel(label,0xFFFFFF99,DynamicFactions[x][extX], DynamicFactions[x][extY], DynamicFactions[x][extZ],20.0, 0, 1);
  46. CreatePickup(1239, 23, DynamicFactions[x][extX], DynamicFactions[x][extY], DynamicFactions[x][extZ]);
  47. }
  48. }
  49. mysql_free_result();
  50. printf("[MySQL Factions]: %d", serverfactions);
  51. return 1;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement