ceva

ceva

Jun 12th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. if(strcmp(cmd, "/b", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(gPlayerLogged[playerid] == 0)
  6. {
  7. SendClientMessage(playerid, COLOR_WHITE, "You havent logged in yet !");
  8. return 1;
  9. }
  10. GetPlayerName(playerid, sendername, sizeof(sendername));
  11. new length = strlen(cmdtext);
  12. while ((idx < length) && (cmdtext[idx] <= ' '))
  13. {
  14. idx++;
  15. }
  16. new offset = idx;
  17. new result[256];
  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_GRAD2, "USAGE: /b [local ooc chat]");
  27. return 1;
  28. }
  29. if(Muted[playerid] == 1)
  30. {
  31. SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently muted.");
  32. return 1;
  33. }
  34. new str[128];
  35. if(strlen(result) > MAXLEN)
  36. {
  37. new pos = MAXLEN;
  38. //while(result[--pos] < ' ') {}
  39. if(pos < MAXLEN-1) pos = MAXLEN;
  40. format(str, sizeof(str), "(( [%d] %s: %.*s ... ))", playerid, PlayerName(playerid), pos, result);
  41. ProxDetector(25.0, playerid, str,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
  42. format(str, sizeof(str), "(( [%d] %s: ... %s ))", playerid, PlayerName(playerid), result[pos]);
  43. ProxDetector(25.0, playerid, str,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
  44. printf("%s", str);
  45. return 1;
  46. }
  47. else
  48. {
  49. format(str, sizeof(str), "(( [%d] %s: %s ))", playerid, PlayerName(playerid), result);
  50. ProxDetector(25.0, playerid, str,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
  51. printf("%s", str);
  52. return 1;
  53. }
  54. else
  55. {
  56. if(AdminDuty[playerid] == 1)
  57. format(str, sizeof(str), "{FF6600}(( [%d] Administrator {FFFFFF}%s: %s ))", playerid, PlayerName(playerid), result);
  58. ProxDetector(25.0, playerid, str,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
  59. printf("%s", str);
  60. return 1;
  61. }
  62. else
  63. {
  64. if(TesterDuty[playerid] == 1)
  65. format(str, sizeof(str), "{660000}(( [%d] Tester {FFFFFF}%s: %s ))", playerid, PlayerName(playerid), result);
  66. ProxDetector(25.0, playerid, str,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
  67. printf("%s", str);
  68. return 1;
  69. }
  70.  
  71. }
  72. return 1;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment