Guest User

rewrwetgrdst

a guest
Sep 2nd, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. CMD:ndelete(playerid, params[])
  2. {
  3. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_RED2, "Nu poti folosi nicio comanda pentru ca nu esti logat.");
  4. if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pHelper] < 1) return SendClientMessage(playerid, COLOR_ERROR, AHOnly);
  5. if(PlayerInfo[id][pNMessage] == 0) return SendClientMessage(playerid, COLOR_GREY, "This player doesn't request help.");
  6. if(HelperDuty[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You are not on helper duty!");
  7. {
  8. new id,sendername[30],giveplayer[30],message[128],string[256];
  9. if(sscanf(params, "us[128]",id,message))
  10. {
  11. SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/ndelete [playerid] [message]");
  12. SendClientMessage(playerid, COLOR_GREY, "If you deleted any question from someone, messages will be show only for admins/helpers.");
  13. return 1;
  14. }
  15. else
  16. {
  17. if(IsPlayerConnected(id))
  18. {
  19. GetPlayerName(playerid, sendername, sizeof(sendername));
  20. if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
  21. {
  22. format(string, sizeof(string), "(/ndelete) Raspuns trimis: %s", message);
  23. SendClientMessage(playerid, COLOR_GREY, string)
  24. PlayerInfo[playerid][pNRE] = id;
  25. PlayerInfo[playerid][pHelpedPlayers]++;
  26. Update(playerid,pHelpedPlayersx);
  27. }
  28. if(PlayerInfo[playerid][pNRE] != -1)
  29. {
  30. GetPlayerName(PlayerInfo[playerid][pNRE], giveplayer, sizeof(giveplayer));
  31. foreach(Player,x)
  32. {
  33. if(PlayerInfo[x][pNewbieEnabled] == 1)
  34. {
  35. if(x == PlayerInfo[playerid][pNRE])
  36. {
  37. if(PlayerInfo[playerid][pAdmin] >= 1)
  38. {
  39. format(string, sizeof(string), "Admin %s: @%s, %s", sendername, giveplayer, message);
  40. SendClientMessage(x,COLOR_YELLOW,string2);
  41. ABroadCast(COLOR_NEWBIE,string,1);
  42. HLChat(COLOR_NEWBIE,string);
  43. }
  44. else if(PlayerInfo[playerid][pHelper] >= 1)
  45. {
  46. format(string, sizeof(string), "Helper %s: @%s, %s", sendername, giveplayer, message);
  47. SendClientMessage(x,COLOR_YELLOW,string2);
  48. ABroadCast(COLOR_NEWBIE,string,1);
  49. HLChat(COLOR_NEWBIE,string);
  50. }
  51. }
  52. }
  53. }
  54. }
  55. PlayerInfo[PlayerInfo[playerid][pNRE]][pNMessage] = 0;
  56. PlayerInfo[PlayerInfo[playerid][pNRE]][pNMessage2] = 0;
  57. PlayerInfo[PlayerInfo[playerid][pNRE]][pFirstAnswer] = 0;
  58. PlayerInfo[playerid][pNRE] = -1;
  59. }
  60. else return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");
  61. }
  62. }
  63. return 1;
  64. }
Add Comment
Please, Sign In to add comment