Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.43 KB | None | 0 0
  1. //VARIABILE
  2. #define DIALOG_HH 30
  3. new Newbie[MAX_PLAYERS];
  4. new NewbieText[MAX_PLAYERS][256];
  5.  
  6. //LA ONPLAYERCONNECT
  7.     format(NewbieText[playerid], 256, "None");
  8.     Newbie[playerid] = 0;
  9.  
  10. //COMENZI
  11. function HelperHelpDialog(playerid) {
  12.     new string[1024];
  13.     format(string, sizeof(string), "Helper 1 (Trial Helper)\n");
  14.     strcat(string, "/nre /nlist /hcolor\n");
  15.     strcat(string, "\n");
  16.     strcat(string, "Helper 2 (Junior Helper)\n");
  17.     strcat(string, "/ndelete\n");
  18.     strcat(string, "\n");
  19.     strcat(string, "Helper 3 (General Helper)\n");
  20.     strcat(string, "\n");
  21.     ShowPlayerDialog(playerid, DIALOG_HH, DIALOG_STYLE_MSGBOX, "Helper Commands", string, "Ok","");
  22.     return 1;
  23. }
  24. CMD:newbie(playerid, params[]) return cmd_n(playerid, params);
  25. CMD:n(playerid, params[])
  26. {
  27.     new result[256], string[256];
  28.     if(PlayerInfo[playerid][pAdmin] != 0) return SCM(playerid, COLOR_GREY, "Nu poti trimite o intrebare deoarece faci parte din staff!");
  29.     if(PlayerInfo[playerid][pHelper] != 0) return SCM(playerid, COLOR_GREY, "Nu poti trimite o intrebare deoarece faci parte din staff!")
  30.     if(sscanf(params, "s[256]", result)) return SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/newbie <text>");
  31.     if(Newbie[playerid] != 0) return SCM(playerid, COLOR_GREY, "Ai deja o intrebare activa. Asteapta pana cand un helper iti v-a raspunde!");
  32.     Newbie[playerid] = 1;
  33.     format(string, sizeof(string), "(NEWBIE) %s (%d) ask: %s",GetName(playerid), playerid, result);
  34.     SendHelperMessage(COLOR_YELLOW, string);
  35.     format(NewbieText[playerid], 256, result);
  36.     return 1;
  37. }
  38. CMD:nre(playerid, params[])
  39. {
  40.     if(PlayerInfo[playerid][pHelper] < 1) return SCM(playerid, -1, AdminOnly);
  41.     new id, reason[256];
  42.     if(sscanf(params, "us[256]", id, reason)) return SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/nre <playerid/name> <message>");
  43.     if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat!");
  44.     if(Newbie[id] != 1) return SCM(playerid, COLOR_GREY, "Acel player nu a trimis nicio intrebare.");
  45.     Newbie[id] = 0;
  46.     new string[256], str[256];
  47.     format(string, sizeof(string), "* Newbie %s: %s", GetName(id), NewbieText[id]);
  48.     SCMAll(NCOLOR, string);
  49.     format(str, sizeof(str), "Helper %s: %s", GetName(playerid), reason);  
  50.     SCMAll(NCOLOR, str);
  51.     SCM(playerid, COLOR_CYAN, "Intrebarea ta a fost trimisa catre helperi!");
  52.     new day, month, year,hour, minute, second;
  53.     gettime(hour, minute, second);
  54.     getdate(year, month, day)
  55.     new File:newbies = fopen("Logs/NewbieLog.rpg", io_append);
  56.     new strr[256];
  57.     format(strr, sizeof(strr), "[%d/%d/%d | %d:%d:%d]%s to %s: %s\r\n",day, month, year, hour, minute, second, GetName(playerid), GetName(id), reason);
  58.     fwrite(newbies, strr);
  59.     fclose(newbies);
  60.     return 1;
  61. }
  62. CMD:ndelete(playerid, params[])
  63. {
  64.     if((PlayerInfo[playerid][pHelper] < 2)) return SCM(playerid, -1, AdminOnly);
  65.     new id, reason[256];
  66.     if(sscanf(params, "us[256]", id, reason)) return SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/ndelete <playerid/name> <reason>");
  67.     if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat!");
  68.     if(Newbie[id] != 1) return SCM(playerid, COLOR_GREY, "Acel player nu a trimis nicio intrebare.");
  69.     Newbie[id] = 0;
  70.     new string[256], str[256];
  71.     format(string, sizeof(string), "Helper %s ti-a sters intrebarea. Motiv: %s",GetName(playerid), reason);
  72.     SCM(id, COLOR_YELLOW, string);
  73.     format(str, sizeof(str), "I-ai sters intrebarea lui %s. Motiv: %s", GetName(id), reason);
  74.     SCM(playerid, COLOR_CYAN, str);
  75.     return 1;
  76. }
  77. CMD:nlist(playerid, params[])
  78. {
  79.     if((PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)) return SCM(playerid, -1, AdminOnly);
  80.     new string[256];
  81.     SCM(playerid, 0xFFC400FF, "----------Newbie List----------");
  82.     foreach(Player, i) {
  83.         if(IsPlayerConnected(i) && Newbie[i] != 0) {
  84.             format(string, sizeof(string), "(%d) %s: %s", i, GetName(i), NewbieText[i]);
  85.             SCM(playerid, 0x93D94CFF, string);
  86.         }
  87.     }
  88.     return 1;
  89. }
  90. CMD:helperhelp(playerid, params[]) return cmd_ah(playerid, params);
  91. CMD:hhelp(playerid, params[]) return cmd_ah(playerid, params);
  92. CMD:hh(playerid, params[]) {
  93.     if((PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)) return SCM(playerid, -1, AdminOnly);
  94.     HelperHelpDialog(playerid);
  95.     return 1;
  96. }
  97. CMD:hcolor(playerid, params[])
  98. {
  99.     if(PlayerInfo[playerid][pHelper] < 1) return 1;
  100.     SetPlayerColor(playerid, 0xFF4D00FF);
  101.     SCM(playerid, -1, "{FF4D00}Server: {FFFFFF}Culoare schimbata cu succes!");
  102.     }
  103.     return 1;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement