Advertisement
Guest User

Untitled

a guest
Jan 4th, 2021
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. new selectedID[MAX_PLAYERS];
  2. public OnPlayerClickPlayer(playerid, clickedplayerid, source){
  3. if(playerinfo[playerid][pAdmin] < 6) return SCM(playerid, -1, NU_ESTI_ADMIN);
  4. if(playerinfo[playerid][pAdmin] >= 6) {
  5. selectedID[playerid] = clickedplayerid;
  6. ShowPlayerDialog(playerid, DIALOG_PLAYER, DIALOG_STYLE_TABLIST_HEADERS, "Locatii", "Selecteaza una din optiuni\nTeleporteaza-te la el\nTelepotreaza-l la tine\nHeal\nKill\nAdmin", "Select", "Cancel");
  7. }
  8. return 1;
  9. }
  10.  
  11. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  12. if(dialogid == DIALOG_PLAYER) {
  13. if(response) {
  14.  
  15. new pID = selectedID[playerid];
  16. new string[256];
  17. GetPlayerName(playerid, aname, sizeof(aname));
  18. GetPlayerName(pID, pname, sizeof(pname));
  19.  
  20. if(!IsPlayerConnected(pID)) return true;
  21.  
  22. switch(listitem) {
  23. case 0:
  24. {
  25. new px, py, pz;
  26. GetPlayerPos(pID, Float:px, Float:py, Float:pz);
  27. SetPlayerPos(playerid, Float:px, Float:py, Float:pz);
  28.  
  29. format(string, sizeof(string), "Admin %s s-a teleportat la tine!", aname);
  30. SendClientMessage(pID, -1, string);
  31.  
  32. format(string, sizeof(string), "AdmCmd:Admin %s s-a teleportat la playerul %s.", aname, pname);
  33. SendAdminMessage(-1, string);
  34. }
  35.  
  36. case 1:
  37. {
  38. new px, py, pz;
  39. GetPlayerPos(playerid, Float:px, Float:py, Float:pz);
  40. SetPlayerPos(pID, Float:px, Float:py, Float:pz);
  41.  
  42. format(string, sizeof(string), "Admin %s te-a teleportat la el!", aname);
  43. SCM(pID, -1, string);
  44.  
  45. format(string, sizeof(string), "AdmCmd:Playerul %s a fost teleportat la adminul %s.", pname, aname);
  46. SendAdminMessage(-1, string);
  47. }
  48.  
  49. case 2:
  50. {
  51. SetPlayerHealth(pID, 100);
  52. format(string, sizeof(string), "Admin %s ti-a heal.", aname);
  53. SCM(pID, -1, string);
  54.  
  55. format(string, sizeof(string), "AdmCmd:Admin %s i-a dat heal lui %s.", aname, pname);
  56. SendAdminMessage(-1, string);
  57. }
  58. case 3:
  59. {
  60. if(pID != playerid){
  61. SetPlayerHealth(pID, 0);
  62. format(string, sizeof(string), "Admin %s te-a omorat.", aname);
  63. SCM(pID, -1, string);
  64.  
  65. format(string, sizeof(string), "AdmCmd: %s i-a dat kill playerului %s", aname, pname);
  66. SendAdminMessage(-1, string);
  67. }
  68. }
  69. case 4: ShowPlayerDialog(playerid, DIALOG_MAKE_ADMIN, DIALOG_STYLE_TABLIST_HEADERS, "Admin", "Selecteaza un grad\nRank up\nRank down\nDemote", "Select", "Cancel");
  70. }
  71. }
  72. }
  73. if(dialogid == DIALOG_MAKE_ADMIN)
  74. {
  75. if(response) {
  76. new pID = selectedID[playerid],string[256];
  77.  
  78. GetPlayerName(pID, pname, sizeof(pname));
  79. GetPlayerName(playerid, aname, sizeof(aname));
  80.  
  81. switch(listitem) {
  82. case 0:{
  83. playerinfo[pID][pAdmin] ++;
  84.  
  85. format(string, sizeof(string), FELICITARI_COAE, playerinfo[pID][pAdmin]);
  86. SCM(pID, -1, string);
  87.  
  88. format(string, sizeof(string), FELICITARI_COAE_ADMBOT, aname, playerinfo[pID][pAdmin], pname);
  89. SendAdminMessage(-1, string);
  90. }
  91. case 1:{
  92. playerinfo[pID][pAdmin] --;
  93.  
  94. format(string, sizeof(string), IMI_PARE_RAU_COAE, playerinfo[pID][pAdmin]);
  95. SCM(pID, -1, string);
  96.  
  97. format(string, sizeof(string), IMI_PARE_RAU_COAE_ADMBOT, aname, playerinfo[pID][pAdmin], pname);
  98. SendAdminMessage(-1, string);
  99. }
  100. case 2:{
  101. playerinfo[pID][pAdmin] = 0;
  102.  
  103. format(string, sizeof(string), AYAYE_COAE, 0);
  104. SCM(pID, -1, string);
  105.  
  106. format(string, sizeof(string), AYAYE_COAE_ADMBOT, aname, pname);
  107. SendAdminMessage(-1, string);
  108. }
  109. }
  110. }
  111. }
  112. retrun 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement