MistarA

Untitled

Aug 17th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.99 KB | None | 0 0
  1. if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. GetPlayerName(playerid, sendername, sizeof(sendername));
  6. new length = strlen(cmdtext);
  7. while ((idx < length) && (cmdtext[idx] <= ' '))
  8. {
  9. idx++;
  10. }
  11. new offset = idx;
  12. new result[256];
  13. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  14. {
  15. result[idx - offset] = cmdtext[idx];
  16. idx++;
  17. }
  18. result[idx - offset] = EOS;
  19. if(!strlen(result))
  20. {
  21. SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}Folosire{696969}: (/d)epartments [chat]");
  22. return 1;
  23. }
  24. if(Muted[playerid] == 1)
  25. {
  26. SendClientMessage(playerid, COLOR_LIGHTRED, "Momentan ai mute.");
  27. return 1;
  28. }
  29. new maskid = PlayerInfo[playerid][pMaskID];
  30. new str[128];
  31. new faction[128];
  32. if(PlayerInfo[playerid][pFaction] == 3) { faction = "BCSD"; }
  33. if(PlayerInfo[playerid][pFaction] == 6) { faction = "GOUVERMENT"; }
  34. if(PlayerInfo[playerid][pFaction] == 7) { faction = "LSC"; }
  35. if(PlayerInfo[playerid][pFaction] == 2) { faction = "BCFD"; }
  36. if(PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pFaction] == 7 || PlayerInfo[playerid][pFaction] == 2 || PlayerInfo[playerid][pFaction] == 3)
  37. {
  38. if(strlen(result) > MAXLEN)
  39. {
  40. new pos = MAXLEN;
  41. if(pos < MAXLEN-1) pos = MAXLEN;
  42. if(PlayerInfo[playerid][pMaskuse] == 1)
  43. {
  44. format(str, sizeof(str), "** [%s] %s [Masca_%d]: %.*s ...", faction, GetRankName(playerid), maskid, pos, result);
  45. SendFactionMessage(3, COLOR_ALLDEPT, str);
  46. SendFactionMessage(6, COLOR_ALLDEPT, str);
  47. SendFactionMessage(7, COLOR_ALLDEPT, str);
  48. SendFactionMessage(2, COLOR_ALLDEPT, str);
  49. SendFactionMessage(10, COLOR_ALLDEPT, str);
  50. format(str, sizeof(str), "** [%s] %s [Masca_%d]: ... %s **", faction, GetRankName(playerid), maskid, result[pos]);
  51. SendFactionMessage(3, COLOR_ALLDEPT, str);
  52. SendFactionMessage(6, COLOR_ALLDEPT, str);
  53. SendFactionMessage(7, COLOR_ALLDEPT, str);
  54. SendFactionMessage(2, COLOR_ALLDEPT, str);
  55. SendFactionMessage(10, COLOR_ALLDEPT, str);
  56. }
  57. else
  58. {
  59. format(str, sizeof(str), "** [%s] %s %s: %.*s ...", faction, GetRankName(playerid), GetPlayerNameEx(playerid), pos, result);
  60. SendFactionMessage(3, COLOR_ALLDEPT, str);
  61. SendFactionMessage(6, COLOR_ALLDEPT, str);
  62. SendFactionMessage(7, COLOR_ALLDEPT, str);
  63. SendFactionMessage(2, COLOR_ALLDEPT, str);
  64. SendFactionMessage(10, COLOR_ALLDEPT, str);
  65. format(str, sizeof(str), "** [%s] %s %s: ... %s **", faction, GetRankName(playerid), GetPlayerNameEx(playerid), result[pos]);
  66. SendFactionMessage(3, COLOR_ALLDEPT, str);
  67. SendFactionMessage(6, COLOR_ALLDEPT, str);
  68. SendFactionMessage(7, COLOR_ALLDEPT, str);
  69. SendFactionMessage(2, COLOR_ALLDEPT, str);
  70. SendFactionMessage(10, COLOR_ALLDEPT, str);
  71. }
  72. }
  73. else
  74. {
  75. if(PlayerInfo[playerid][pMaskuse] == 1)
  76. {
  77. format(str, sizeof(str), "** [%s] %s [Masca_%d]: %s **", faction, GetRankName(playerid), maskid, result);
  78. SendFactionMessage(3, COLOR_ALLDEPT, str);
  79. SendFactionMessage(6, COLOR_ALLDEPT, str);
  80. SendFactionMessage(7, COLOR_ALLDEPT, str);
  81. SendFactionMessage(2, COLOR_ALLDEPT, str);
  82. SendFactionMessage(10, COLOR_ALLDEPT, str);
  83. }
  84. else
  85. {
  86. format(str, sizeof(str), "** [%s] %s %s: %s **", faction, GetRankName(playerid), GetPlayerNameEx(playerid), result);
  87. SendFactionMessage(3, COLOR_ALLDEPT, str);
  88. SendFactionMessage(6, COLOR_ALLDEPT, str);
  89. SendFactionMessage(7, COLOR_ALLDEPT, str);
  90. SendFactionMessage(2, COLOR_ALLDEPT, str);
  91. SendFactionMessage(10, COLOR_ALLDEPT, str);
  92. }
  93. }
  94. else
  95. {
  96. SendClientMessage(playerid, COLOR_LIGHTRED, "Factiune invalida.");
  97. return 1;
  98. }
  99. }
  100. return 1;
  101. }
  102. if(strcmp(cmd, "/r", true) == 0)
  103. {
  104. if(IsPlayerConnected(playerid))
  105. {
  106. if(Muted[playerid] == 1) { SendClientMessage(playerid, COLOR_LIGHTRED, "Ai primit mute."); return 1; }
  107. if(PlayerInfo[playerid][pRadio] == 0) { SendClientMessage(playerid, COLOR_GREY,"Nu ai o statie radio."); return 1; }
  108. if(PlayerInfo[playerid][pJailed] != 0) { SendClientMessage(playerid, COLOR_LIGHTRED,"1 ti-a confiscat statia radio.."); return 1; }
  109. if(PlayerInfo[playerid][pRfreq] == 0) { SendClientMessage(playerid, COLOR_WHITE,"Te rog selecteaza o frecventa!(/setfreq)"); return 1; }
  110. GetPlayerName(playerid, sendername, sizeof(sendername));
  111. new length = strlen(cmdtext);
  112. while ((idx < length) && (cmdtext[idx] <= ' '))
  113. {
  114. idx++;
  115. }
  116. new offset = idx;
  117. new result[256];
  118. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  119. {
  120. result[idx - offset] = cmdtext[idx];
  121. idx++;
  122. }
  123. result[idx - offset] = EOS;
  124. if(!strlen(result))
  125. {
  126. SendClientMessage(playerid, COLOR_GRAD2, "Fp;psore: (/r)adio [radio chat]");
  127. return 1;
  128. }
  129. new str[128];
  130. new maskid = PlayerInfo[playerid][pMaskID];
  131. if(RadioStatus[playerid] == 1)
  132. {
  133. if(PlayerInfo[playerid][pRfreq] == 911510 || PlayerInfo[playerid][pRfreq] == 911112 || PlayerInfo[playerid][pRfreq] == 911910)
  134. {
  135. if(PlayerInfo[playerid][pFaction] == 3 || PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pFaction] == 2)
  136. {
  137. if(strlen(result) > MAXLEN)
  138. {
  139. new pos = MAXLEN;
  140. if(pos < MAXLEN-1) pos = MAXLEN;
  141. if(PlayerInfo[playerid][pMaskuse] == 1)
  142. {
  143. if (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRfreq] == 911910)
  144. {
  145. format(str, sizeof(str), "**[CH: %d] %s [Masca_%d]: %.*s ...", PlayerInfo[playerid][pRfreq], GetRankName(playerid), maskid, pos, result);
  146. SendRadioMessagePD(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str, PlayerInfo[playerid][pRadioPD]);
  147. format(str, sizeof(str), "**[CH: %d] %s [Masca_%d]: ... %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), maskid, result[pos]);
  148. SendRadioMessagePD(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str, PlayerInfo[playerid][pRadioPD]);
  149. }
  150. else
  151. {
  152. format(str, sizeof(str), "**[CH: %d] %s [Masca_%d]: %.*s ...", PlayerInfo[playerid][pRfreq], GetRankName(playerid), maskid, pos, result);
  153. SendRadioMessage(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str);
  154. format(str, sizeof(str), "**[CH: %d] %s [Masca_%d]: ... %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), maskid, result[pos]);
  155. SendRadioMessage(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str);
  156. }
  157. }
  158. else
  159. {
  160. if (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRfreq] == 911910)
  161. {
  162. format(str, sizeof(str), "**[CH: %d] %s %s: %.*s ...", PlayerInfo[playerid][pRfreq], GetRankName(playerid), GetPlayerNameEx(playerid), pos, result);
  163. SendRadioMessagePD(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str, PlayerInfo[playerid][pRadioPD]);
  164. format(str, sizeof(str), "**[CH: %d] %s %s: ... %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), GetPlayerNameEx(playerid), result[pos]);
  165. SendRadioMessagePD(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str, PlayerInfo[playerid][pRadioPD]);
  166. }
  167. else
  168. {
  169. format(str, sizeof(str), "**[CH: %d] %s %s: %.*s ...", PlayerInfo[playerid][pRfreq], GetRankName(playerid), GetPlayerNameEx(playerid), pos, result);
  170. SendRadioMessage(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str);
  171. format(str, sizeof(str), "**[CH: %d] %s %s: ... %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), GetPlayerNameEx(playerid), result[pos]);
  172. SendRadioMessage(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str);
  173. }
  174. }
  175. }
  176. else
  177. {
  178. if(PlayerInfo[playerid][pMaskuse] == 1)
  179. {
  180. if (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRfreq] == 911910)
  181. {
  182. format(str, sizeof(str), "**[CH: %d] %s [Masca_%d]: %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), maskid, result);
  183. SendRadioMessagePD(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str, PlayerInfo[playerid][pRadioPD]);
  184. }
  185. else
  186. {
  187. format(str, sizeof(str), "**[CH: %d] %s [Masca_%d]: %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), maskid, result);
  188. SendRadioMessage(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str);
  189. }
  190. }
  191. else
  192. {
  193. if (PlayerInfo[playerid][pFaction] == 3 && PlayerInfo[playerid][pRfreq] == 911910)
  194. {
  195. format(str, sizeof(str), "**[CH: %d] %s %s: %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), GetPlayerNameEx(playerid), result);
  196. SendRadioMessagePD(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str, PlayerInfo[playerid][pRadioPD]);
  197. }
  198. else
  199. {
  200. format(str, sizeof(str), "**[CH: %d] %s %s: %s, over", PlayerInfo[playerid][pRfreq], GetRankName(playerid), GetPlayerNameEx(playerid), result);
  201. SendRadioMessage(playerid,PlayerInfo[playerid][pRfreq], COLOR_RADIO,str);
  202. }
  203. }
  204. }
  205. }
  206. }
  207. else
  208. {
  209. SendClientMessage(playerid, COLOR_GRAD2, "Statia ta radio este oprita.");
  210. return 1;
  211. }
  212. }
  213. return 1;
  214. }
Advertisement
Add Comment
Please, Sign In to add comment