1
0

news.pwn 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. News Group Type
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. stock IsANewsCar(carid)
  34. {
  35. if(DynVeh[carid] != -1)
  36. {
  37. new iDvSlotID = DynVeh[carid], iGroupID = DynVehicleInfo[iDvSlotID][gv_igID];
  38. if((0 <= iGroupID < MAX_GROUPS))
  39. {
  40. if(arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_NEWS) return 1;
  41. }
  42. }
  43. return 0;
  44. }
  45. stock OOCNews(color, string[])
  46. {
  47. foreach(new i: Player) {
  48. ChatTrafficProcess(i, color, string, 1);
  49. }
  50. }
  51. CMD:tognews(playerid, params[])
  52. {
  53. if (!gNews[playerid])
  54. {
  55. gNews[playerid] = 1;
  56. PlayerInfo[playerid][pToggledChats][1] = 1;
  57. SendClientMessageEx(playerid, COLOR_GRAD2, "You have disabled news chat.");
  58. }
  59. else
  60. {
  61. gNews[playerid] = 0;
  62. PlayerInfo[playerid][pToggledChats][1] = 0;
  63. SendClientMessageEx(playerid, COLOR_GRAD2, "You have enabled news chat.");
  64. }
  65. return 1;
  66. }
  67. CMD:liveban(playerid, params[])
  68. {
  69. if (IsAReporter(playerid))
  70. {
  71. new giveplayerid,
  72. string[128];
  73. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /liveban [player]");
  74. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player is not connected.");
  75. if(PlayerInfo[giveplayerid][pLiveBanned] == 0)
  76. {
  77. PlayerInfo[giveplayerid][pLiveBanned] = 1;
  78. format(string, sizeof(string), "%s has interview banned %s", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  79. SendGroupMessage(GROUP_TYPE_NEWS, RADIO, string);
  80. return 1;
  81. }
  82. else SendClientMessageEx(playerid, COLOR_WHITE, "That player is already live banned.");
  83. }
  84. return 1;
  85. }
  86. CMD:liveunban(playerid, params[])
  87. {
  88. new string[128],
  89. giveplayerid;
  90. if(IsAReporter(playerid) && PlayerInfo[playerid][pRank] >= 7)
  91. {
  92. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /liveban [player]");
  93. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player is not connected.");
  94. if(PlayerInfo[giveplayerid][pLiveBanned] == 1)
  95. {
  96. PlayerInfo[giveplayerid][pLiveBanned] = 0;
  97. format(string, sizeof(string), "%s has unbanned %s from interviews", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  98. SendGroupMessage(GROUP_TYPE_NEWS, RADIO, string);
  99. }
  100. else SendClientMessageEx(playerid, COLOR_WHITE, "That player is currently not live banned");
  101. }
  102. else SendClientMessageEx(playerid, COLOR_WHITE, "You must be at least Rank 7 to use this command");
  103. return 1;
  104. }
  105. CMD:live(playerid, params[])
  106. {
  107. if(IsAReporter(playerid) && PlayerInfo[playerid][pRank] > 0)
  108. {
  109. if(shutdown == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "The news system is currently shut down." );
  110. if(TalkingLive[playerid] != INVALID_PLAYER_ID)
  111. {
  112. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Live conversation ended.");
  113. SendClientMessageEx(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live conversation ended.");
  114. TogglePlayerControllable(playerid, 1);
  115. TogglePlayerControllable(TalkingLive[playerid], 1);
  116. DeletePVar(playerid, "IsLive");
  117. DeletePVar(TalkingLive[playerid], "IsLive");
  118. TalkingLive[TalkingLive[playerid]] = INVALID_PLAYER_ID;
  119. TalkingLive[playerid] = INVALID_PLAYER_ID;
  120. return 1;
  121. }
  122. new string[128], giveplayerid;
  123. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /live [player]");
  124. if (IsPlayerConnected(giveplayerid))
  125. {
  126. if (ProxDetectorS(5.0, playerid, giveplayerid))
  127. {
  128. if(PlayerInfo[giveplayerid][pLiveBanned] == 1) return SendClientMessageEx(playerid, COLOR_GREY, "That person is interview banned.");
  129. if(PlayerCuffed[giveplayerid] >= 1 || PlayerCuffed[playerid] >= 1)
  130. {
  131. SendClientMessageEx(playerid, COLOR_GRAD2, "You are unable to do this right now.");
  132. }
  133. else
  134. {
  135. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot talk live with yourself!"); return 1; }
  136. format(string, sizeof(string), "* You offered %s to have a live conversation.", GetPlayerNameEx(giveplayerid));
  137. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  138. format(string, sizeof(string), "* %s offered you to have a live conversation, type /accept live to accept.", GetPlayerNameEx(playerid));
  139. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  140. LiveOffer[giveplayerid] = playerid;
  141. }
  142. }
  143. else
  144. {
  145. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  146. return 1;
  147. }
  148. }
  149. else
  150. {
  151. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  152. return 1;
  153. }
  154. }
  155. else
  156. {
  157. SendClientMessageEx(playerid, COLOR_GREY, " You are not a News Reporter!");
  158. }
  159. return 1;
  160. }