Advertisement
JeremyGrande

Untitled

Sep 10th, 2020
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. CMD:g(playerid, params[])
  2. {
  3. new string[64];
  4.  
  5. if(isnull(params))
  6. {
  7. return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /g [global chat]");
  8. }
  9. if(!enabledGlobal && PlayerInfo[playerid][pAdmin] < 2)
  10. {
  11. return SendClientMessage(playerid, COLOR_GREY, "The global channel is disabled at the moment.");
  12. }
  13. if(PlayerInfo[playerid][pGlobalMuted])
  14. {
  15. return SendClientMessage(playerid, COLOR_GREY, "You are muted from speaking in this channel.");
  16. }
  17. if(PlayerInfo[playerid][pToggleGlobal])
  18. {
  19. return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the global chat as you have it toggled.");
  20. }
  21. if(gettime() - PlayerInfo[playerid][pLastGlobal] < 3)
  22. {
  23. return SendClientMessageEx(playerid, COLOR_GREY, "You can only speak in this channel every 3 seconds. Please wait %i more seconds.", 3 - (gettime() - PlayerInfo[playerid][pLastGlobal]));
  24. }
  25.  
  26. if(PlayerInfo[playerid][pAdmin] > 1) {
  27. format(string, sizeof(string), "%s", GetAdminRank(playerid));
  28. } else if(PlayerInfo[playerid][pHelper] > 0) {
  29. format(string, sizeof(string), "%s", GetHelperRank(playerid));
  30. } else if(PlayerInfo[playerid][pVIPPackage] > 0) {
  31. format(string, sizeof(string), "{A028AD}%s VIP{FFA500}", GetVIPRank(PlayerInfo[playerid][pVIPPackage]));
  32. } else if(PlayerInfo[playerid][pLevel] >= 2) {
  33. format(string, sizeof(string), "Level %i Player", PlayerInfo[playerid][pLevel]);
  34. } else {
  35. string = "Level 1 Newbie";
  36. }
  37.  
  38. foreach(new i : Player)
  39. {
  40. if(!PlayerInfo[i][pToggleGlobal])
  41. {
  42. if(strlen(params) > MAX_SPLIT_LENGTH)
  43. {
  44. SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: %.*s...))", string, GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params);
  45. SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: ...%s ))", string, GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]);
  46. }
  47. else
  48. {
  49. SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: %s ))", string, GetPlayerRPName(playerid), params);
  50. }
  51. }
  52. }
  53.  
  54. if(PlayerInfo[playerid][pAdmin] < 2)
  55. {
  56. PlayerInfo[playerid][pLastGlobal] = gettime();
  57. }
  58.  
  59. return 1;
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement