Guest User

Untitled

a guest
Aug 3rd, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. }
  2. CMD:n(playerid,params[])
  3. {
  4. if(PlayerInfo[playerid][pMuted] == 1)
  5. {
  6. SendClientMessage(playerid, COLOR_GREY, "You are muted from the newbie chat channel.");
  7. return 1;
  8. }
  9. if(NewbieTimer[playerid] > 0)
  10. {
  11. new string[128],cmdtext;
  12. format(string, sizeof(string), "You must wait %d between each message.", NewbieTimer[playerid]);
  13. SendClientMessage(playerid, COLOR_GREY, string);
  14. return 1;
  15. }
  16. new length = strlen(cmdtext);
  17. new offset = idx;
  18. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  19. {
  20. result[idx - offset] = cmdtext[idx];
  21. idx++;
  22. }
  23. result[idx - offset] = EOS;
  24. if(!strlen(result))
  25. {
  26. SendClientMessage(playerid, COLOR_NEWBIE, "{33CCFF}USAGE:{FFFFFF} /newb [text]");
  27. return 1;
  28. }
  29. if(PlayerInfo[playerid][pAdmin] < 1)
  30. {
  31. NewbieTimer[playerid] = 30;
  32. }
  33. if(PlayerInfo[playerid][pAdmin]<1)
  34. {
  35. format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), result);
  36. }
  37. if(PlayerInfo[playerid][pAdmin] == 1)
  38. {
  39. format(string, sizeof(string), "** Moderator %s: %s", GetPlayerNameEx(playerid), result);
  40. }
  41. if(PlayerInfo[playerid][pAdmin] >= 2)
  42. {
  43. format(string, sizeof(string), "** Admin %s: %s", GetPlayerNameEx(playerid), result);
  44. }
  45. foreach(Player, n)
  46. {
  47. SetTimer("NewbTimer", 25000, 0);
  48. SendClientMessage(n, COLOR_NEWBIE, string);
  49. }
  50. return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment