XEnergyX

Megaphon

Nov 1st, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. //new tmpcar = GetPlayerVehicleID(playerid);
  6. GetPlayerName(playerid, pname, sizeof(pname));
  7. new length = strlen(cmdtext);
  8. while ((idx < length) && (cmdtext[idx] <= ' '))
  9. {
  10. idx++;
  11. }
  12. new offset = idx;
  13. new result[64];
  14. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  15. {
  16. result[idx - offset] = cmdtext[idx];
  17. idx++;
  18. }
  19. result[idx - offset] = EOS;
  20. if(OnDuty[playerid]==0)
  21. {
  22. SendClientMessage(playerid, COLOR_GREY, "Du bist bist auser Dienst!");
  23. return 1;
  24. }
  25. if(!strlen(result))
  26. {
  27. SendClientMessage(playerid, COLOR_GRAD2, "Benutze: (/m)egaphone [megaphone chat]");
  28. return 1;
  29. }
  30. if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
  31. {
  32. if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
  33. {
  34. format(string, sizeof(string), "[Officer %s:o< %s]", pname, result);
  35. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  36. }
  37. else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
  38. {
  39. format(string, sizeof(string), "[Officer %s:o< %s]", pname, result);
  40. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  41. }
  42. else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
  43. {
  44. format(string, sizeof(string), "[Medic %s:o< %s]", pname, result);
  45. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  46. }
  47. else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
  48. {
  49. format(string, sizeof(string), "[FBI Agent %s:o< %s]", pname, result);
  50. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  51. }
  52. else if(PlayerInfo[playerid][pMember] == 23||PlayerInfo[playerid][pLeader] == 23)
  53. {
  54. format(string, sizeof(string), "[Soldat %s:o< %s]", pname, result);
  55. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  56. }
  57. else if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22)
  58. {
  59. format(string, sizeof(string), "[Feuerwehr %s:o< %s]", pname, result);
  60. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  61. }
  62. else if(PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
  63. {
  64. format(string, sizeof(string), "[Oamt %s:o< %s]", pname, result);
  65. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  66. }
  67. printf("%s", string);
  68. }
  69. else
  70. {
  71. SendClientMessage(playerid, COLOR_GRAD2, " Du musst bei einer Staatlichen Fraktion sein, um diesen Befehl benutzen zu können !");
  72. return 1;
  73. }
  74. }
  75. return 1;
  76. }
  77.  
Advertisement
Add Comment
Please, Sign In to add comment