Guest User

Joker

a guest
Apr 1st, 2009
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. // Admin Broadcast
  2. if(strcmp(cmd, "/ao", true) == 0)
  3. {
  4. if(IsPlayerConnected(playerid))
  5. {
  6. if(gPlayerLogged[playerid] == 0)
  7. {
  8. SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
  9. return 1;
  10. }
  11. GetPlayerName(playerid, sendername, sizeof(sendername));
  12. new length = strlen(cmdtext);
  13. while ((idx < length) && (cmdtext[idx] <= ' '))
  14. {
  15. idx++;
  16. }
  17. new offset = idx;
  18. new result[80];
  19. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  20. {
  21. result[idx - offset] = cmdtext[idx];
  22. idx++;
  23. }
  24. result[idx - offset] = EOS;
  25. if(!strlen(result))
  26. {
  27. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ao");
  28. return 1;
  29. }
  30. if (PlayerInfo[playerid][pAdmin] >= 1)
  31. {
  32. format(string, sizeof(string), "(( ** Administrator ** %s: %s ))", sendername, result);
  33. OOCOff(COLOR_LIGHTRED,string); //
  34. printf("%s", string);
  35. }
  36. }
  37. return 1;
  38. }
  39.  
  40. // Head Admin Broadcast
  41. if(strcmp(cmd, "/hoc", true) == 0)
  42. {
  43. if(IsPlayerConnected(playerid))
  44. {
  45. if(gPlayerLogged[playerid] == 0)
  46. {
  47. SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
  48. return 1;
  49. }
  50. GetPlayerName(playerid, sendername, sizeof(sendername));
  51. new length = strlen(cmdtext);
  52. while ((idx < length) && (cmdtext[idx] <= ' '))
  53. {
  54. idx++;
  55. }
  56. new offset = idx;
  57. new result[80];
  58. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  59. {
  60. result[idx - offset] = cmdtext[idx];
  61. idx++;
  62. }
  63. result[idx - offset] = EOS;
  64. if(!strlen(result))
  65. {
  66. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /hoc");
  67. return 1;
  68. }
  69. if (PlayerInfo[playerid][pAdmin] == 2009 || PlayerInfo[playerid][pAdmin] == 2009) // a
  70.  
  71. {
  72. format(string, sizeof(string), "(( ** Head Administrator ** %s: %s ))", sendername, result);
  73. OOCOff(COLOR_RED,string); //
  74. printf("%s", string);
  75. }
  76. }
  77. return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment