Guest User

Untitled

a guest
Mar 10th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. CMD:newb(playerid, params[])
  2. {
  3. new log[128];
  4. if(gPlayerLogged{playerid} == 0)
  5. {
  6. SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
  7. return 1;
  8. }
  9. if(PlayerInfo[playerid][pTut] == 0)
  10. {
  11. SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
  12. return 1;
  13. }
  14. if ((nonewbie) && PlayerInfo[playerid][pAdmin] < 2)
  15. {
  16. SendClientMessageEx(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an administrator!");
  17. return 1;
  18. }
  19. if(PlayerInfo[playerid][pNMute] == 1)
  20. {
  21. SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the newbie chat channel.");
  22. return 1;
  23. }
  24. new string[128];
  25. if(NewbieTimer[playerid] > 0)
  26. {
  27. format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
  28. SendClientMessageEx(playerid, COLOR_GREY, string);
  29. return 1;
  30. }
  31. if(gNewbie[playerid]==1)
  32. {
  33. SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
  34. return 1;
  35. }
  36.  
  37. if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/newb)ie [Question]");
  38.  
  39. if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
  40. {
  41. NewbieTimer[playerid] = 50;
  42. }
  43. if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
  44. {
  45. format(string, sizeof(string), "** Newbie %s [%d]: %s", GetPlayerNameEx(playerid), playerid, params);
  46. }
  47. if(PlayerInfo[playerid][pAdmin] < 2 && CheckServerAd(params))
  48. {
  49. format(string,sizeof(string),"Warning: %s [ID: %d] may be server advertising: '%s'.", GetPlayerNameEx(playerid), playerid, params);
  50. ABroadCast(COLOR_RED, string, 2);
  51. format(log, sizeof(log), "Warning: %s [ID: %d] may be server advertising: '%s'.", GetPlayerNameEx(playerid), playerid, params);
  52. Log("logs/hack.log", string);
  53. return 0;
  54. }
  55. foreach(Player, n)
  56. {
  57. if (gNewbie[n]==0)
  58. {
  59. SendClientMessageEx(n, COLOR_NEWBIE, string);
  60. }
  61. }
  62. {
  63. if(PlayerInfo[playerid][pAdmin] >= 1)
  64. {
  65. new pID, text[256], string[256];
  66. if(sscanf(params, "us[256]", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /newb [Player ID] [Answer]");
  67. if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  68. if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself.");
  69. format(string, sizeof(string), "%s (%d) is not accepting newb answer at the moment.", PlayerName(pID), pID);
  70. if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
  71. format(string, sizeof(string), "Answer to %s: %s", PlayerName(pID), text);
  72. SendClientMessage(playerid, COLOR_YELLOW, string);
  73. format(string, sizeof(string), "Answer from %s: %s", PlayerName(playerid), text);
  74. SendClientMessage(pID, COLOR_YELLOW, string);
  75. pInfo[pID][Last] = playerid;
  76. for (new i = 0; i < MAX_PLAYERS; i++)
  77. if (IsPlayerAdmin(i))
  78. {
  79. format(string, sizeof(string), "Admin: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
  80. {
  81. if(PlayerInfo[playerid][pHelper] == 1)
  82. {
  83. format(string, sizeof(string), "Junior Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
  84. }
  85. if(PlayerInfo[playerid][pHelper] == 2)
  86. {
  87. format(string, sizeof(string), "Community Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
  88. }
  89. if(PlayerInfo[playerid][pHelper] == 3)
  90. {
  91. format(string, sizeof(string), "Senior Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
  92. }
  93. if(PlayerInfo[playerid][pHelper] == 4)
  94. {
  95. format(string, sizeof(string), "Chief Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
  96. }
  97. else if(PlayerInfo[playerid][pHelper] == 5)
  98. {
  99. format(string, sizeof(string), "Head Chief Moderator: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid, PlayerName(pID), pID, text);
  100. }
  101. if (IsPlayerAdmin(i))
  102. SendClientMessage(i, COLOR_GREY, string);
  103. }
  104. return 1;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment