Advertisement
XEnergyX

Megaphon

Nov 1st, 2011
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. // Makeleader befehl
  2.  
  3. if(strcmp(cmd, "/makeleader", true) == 0)
  4. {
  5. if(IsPlayerConnected(playerid))
  6. {
  7. tmp = strtok(cmdtext, idx);
  8. if(!strlen(tmp))
  9. {
  10. SendClientMessage(playerid, COLOR_GRAD2, " /makeleader [playerid/Name] [Nummer(1-24)]");
  11. return 1;
  12. }
  13. new para1;
  14. new level;
  15. para1 = ReturnUser(tmp);
  16. tmp = strtok(cmdtext, idx);
  17. level = strval(tmp);
  18. if(level > 24 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Geh nicht tiefer als Nummer 0, oder höher als Nummer 25!"); return 1; }
  19. if (PlayerInfo[playerid][pAdmin] >= 4)
  20. {
  21. if(IsPlayerConnected(para1))
  22. {
  23. if(para1 != INVALID_PLAYER_ID)
  24. {
  25. if(PlayerInfo[para1][pFrakSperre] > 0)
  26. {
  27. SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler hat FraktionsSperre!");
  28. return 1;
  29. }
  30.  
  31. // Der /megaphone befehl
  32.  
  33. if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
  34. {
  35. if(IsPlayerConnected(playerid))
  36. {
  37. //new tmpcar = GetPlayerVehicleID(playerid);
  38. GetPlayerName(playerid, pname, sizeof(pname));
  39. new length = strlen(cmdtext);
  40. while ((idx < length) && (cmdtext[idx] <= ' '))
  41. {
  42. idx++;
  43. }
  44. new offset = idx;
  45. new result[64];
  46. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  47. {
  48. result[idx - offset] = cmdtext[idx];
  49. idx++;
  50. }
  51. result[idx - offset] = EOS;
  52. if(OnDuty[playerid]==0)
  53. {
  54. SendClientMessage(playerid, COLOR_GREY, "Du bist bist auser Dienst!");
  55. return 1;
  56. }
  57. if(!strlen(result))
  58. {
  59. SendClientMessage(playerid, COLOR_GRAD2, "Benutze: (/m)egaphone [megaphone chat]");
  60. return 1;
  61. }
  62. if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
  63. {
  64. if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
  65. {
  66. format(string, sizeof(string), "[Officer %s:o< %s]", pname, result);
  67. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  68. }
  69. else if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2)
  70. {
  71. format(string, sizeof(string), "[Officer %s:o< %s]", pname, result);
  72. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  73. }
  74. else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
  75. {
  76. format(string, sizeof(string), "[Medic %s:o< %s]", pname, result);
  77. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  78. }
  79. else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
  80. {
  81. format(string, sizeof(string), "[FBI Agent %s:o< %s]", pname, result);
  82. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  83. }
  84. else if(PlayerInfo[playerid][pMember] == 23||PlayerInfo[playerid][pLeader] == 23)
  85. {
  86. format(string, sizeof(string), "[Soldat %s:o< %s]", pname, result);
  87. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  88. }
  89. else if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22)
  90. {
  91. format(string, sizeof(string), "[Feuerwehr %s:o< %s]", pname, result);
  92. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  93. }
  94. else if(PlayerInfo[playerid][pMember] == 24||PlayerInfo[playerid][pLeader] == 24)
  95. {
  96. format(string, sizeof(string), "[Oamt %s:o< %s]", pname, result);
  97. ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
  98. }
  99. printf("%s", string);
  100. }
  101. else
  102. {
  103. SendClientMessage(playerid, COLOR_GRAD2, " Du musst bei einer Staatlichen Fraktion sein, um diesen Befehl benutzen zu können !");
  104. return 1;
  105. }
  106. }
  107. return 1;
  108. }
  109.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement