Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. CMD:marketing(playerid,params[])
  2. {
  3. if(pLoggedIn[playerid] == 0) return SendClientMessage(playerid,COLOR_GREY,"Niste prijavljeni!");
  4. mysql_function_query(SQLConn,"SELECT `pUsername`,`pMarketing`,,`pIsOnline` FROM `users` WHERE `pMarketing` > '0' ORDER BY `pMarketing` DESC",true,"LoadStaffStatusQuery1","i",playerid);
  5. return 1;
  6. }
  7.  
  8. forward LoadStaffStatusQuery1(playerid);
  9. public LoadStaffStatusQuery1(playerid)
  10. {
  11. new rows,fields;
  12.  
  13. new tempStaffName[24];
  14. new tempStaffAdmin = 0;
  15. new tempStaffOnline = 0;
  16. new tempStaffID = INVALID_PLAYER_ID;
  17. new tempStaffAfk = 0;
  18. new tempStaffDuty = 0;
  19. new tempValue[3];
  20. new container[24 * 100];
  21.  
  22. cache_get_data(rows,fields,SQLConn);
  23.  
  24. if(rows)//ako ima clanova u administraciji, a normalno ima
  25. {
  26. for(new i; i < rows; i++)
  27. {
  28. //load data
  29. cache_get_field_content(i,"pUsername",tempStaffName,SQLConn);
  30. tempStaffAdmin = cache_get_field_content_int(i,"pMarketing",SQLConn);
  31. tempStaffOnline = cache_get_field_content_int(i,"pIsOnline",SQLConn);
  32. //check if online
  33. tempStaffID = GetIDFromName(tempStaffName);
  34. //check if on duty
  35. if(tempStaffID != INVALID_PLAYER_ID)//ako nije off vidi jel on duty i afk
  36. {
  37. if(AdminDuty[tempStaffID] != 0) tempStaffDuty = 1;
  38. else if(GmDuty[tempStaffID] != 0) tempStaffDuty = 2;
  39. else tempStaffDuty = 0;
  40. tempStaffAfk = IsPlayerAfk(tempStaffID);
  41. }
  42. else
  43. {
  44. tempStaffAfk = 0;
  45. tempStaffDuty = 0;
  46. }
  47. //check if afk
  48.  
  49. //build the string
  50. if(tempStaffOnline == 1)
  51. {
  52. if(tempStaffAfk == 1) strcat(container,""LIGHTGREY"");//afk
  53. else if(tempStaffDuty == 0) strcat(container,""WHITE"");//online
  54. else if(tempStaffDuty == 1) strcat(container,""VAGOS"");//admin duty
  55. else if(tempStaffDuty == 2) strcat(container,""LIGHTBLUE"");//gm duty
  56. if(tempStaffAfk == 0) strcat(container,"[ON]\t\t");
  57. else if(tempStaffAfk == 1) strcat(container,"[AFK]\t\t");
  58. }
  59. else
  60. {
  61. strcat(container,""GREY"");//offline
  62. strcat(container,"[OFF]\t\t");
  63. }
  64. //Provjera statusa igraca
  65.  
  66. //Provjera levela admina/gma
  67. if(tempStaffAdmin != 0)
  68. {
  69. valstr(tempValue,tempStaffAdmin);
  70. strcat(container,"[Marketing "),strcat(container,tempValue),strcat(container,"]\t\t");
  71. }
  72. if(tempStaffAdmin == 6)
  73. {
  74. valstr(tempValue,tempStaffAdmin);
  75. strcat(container,"[Marketing "),strcat(container,tempValue),strcat(container,"]\t\t");
  76. }
  77. strcat(container,tempStaffName);
  78. strcat(container,"\n");
  79. }
  80. ShowDialog(playerid,Show:StaffDialog,DIALOG_STYLE_MSGBOX,"BU-RP Marketing Team",container,"Ok","");
  81. }
  82. else SendClientMessage(playerid, -1, "Nema marketing tima na listi!");
  83.  
  84. return 1;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement