Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.97 KB | None | 0 0
  1.  
  2. public OnPlayerText(playerid, text[])
  3. {
  4. if(GetPVarInt(playerid, "Spawned") == 0)
  5. return 0;
  6. if(GetPVarInt(playerid, "Afkowicz") == 1)
  7. return SendClientMessage(playerid, GREEN, "Nie możesz {FF0000}pisać dopóki jestes AFK!"), 0;
  8. if(GetTickCount() < GetPVarInt(playerid, "SpamCount"))
  9. {
  10. SetPVarInt(playerid, "FakeSpamCount", GetPVarInt(playerid, "FakeSpamCount") + 1);
  11.  
  12. if(GetPVarInt(playerid, "FakeSpamCount") >= 10)
  13. {
  14. format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyrzucony(a). Powód: Mass Spam.",PlayerName(playerid), playerid);
  15. SendClientMessageToAll(RED, StrEasy);
  16.  
  17. TogglePlayerSpectating(playerid, 1);
  18. Kick(playerid);
  19. }
  20. SetPVarInt(playerid, "SpamCount", GetTickCount() + 2000);
  21. }
  22. if(!strcmp(text, Texts[playerid], true) && Texts[playerid][0] != '\0')
  23. {
  24. SetPVarInt(playerid, "AntySPAMText", GetPVarInt(playerid, "AntySPAMText")+1);
  25.  
  26. if(GetPVarInt(playerid, "AntySPAMText") >= 20)
  27. {
  28. format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyrzucony(a). Powód: Mass Spam.",PlayerName(playerid), playerid);
  29. SendClientMessageToAll(RED, StrEasy);
  30.  
  31. TogglePlayerSpectating(playerid, 1);
  32. Kick(playerid);
  33. }
  34. return 0;
  35. }
  36. if(GetTickCount() < GetPVarInt(playerid, "UnBlockMute"))
  37. {
  38. format(StrEasy, sizeof(StrEasy), "{FF0000}Zostałeś wyciszony! Będziesz mógł pisać dopiero za {FFFFFF}%d {FF0000}sekund!", ((GetPVarInt(playerid, "UnBlockMute") - GetTickCount()) / 1000) + 1);
  39. return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Informacje", StrEasy, "Zamknij", ""), 0;
  40. }
  41.  
  42. format(Texts[playerid], 128, text);
  43.  
  44. if(SearchIP(text) || SearchPage(text))
  45. {
  46. SetPVarInt(playerid, "ReklamaIP", GetPVarInt(playerid, "ReklamaIP") + 1);
  47.  
  48. if(GetPVarInt(playerid, "ReklamaIP") == 3)
  49. {
  50. format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyrzucony(a). Powód: Reklama.",PlayerName(playerid), playerid);
  51. SendClientMessageToAll(RED, StrEasy);
  52.  
  53. TogglePlayerSpectating(playerid, 1);
  54. Kick(playerid);
  55. }
  56.  
  57. return 0;
  58. }
  59.  
  60. if(text[0] == '@')
  61. {
  62. if(!IsPlayerSpecialAdmin(playerid))
  63. return SendClientMessage(playerid, GREEN, "{FF0000}Nie jesteś {FF0000}Adminem!"), 0;
  64.  
  65. text[0] = ' ';
  66.  
  67. foreach(Player, i)
  68. {
  69. if(IsPlayerSpecialAdmin(i) && GetPVarInt(i, "ACzat") == 0)
  70. {
  71. format(StrEasy, sizeof StrEasy, "(A) %s [ID:%d]:%s", PlayerName(playerid), playerid, text);
  72. SendClientMessage(i, 0xFF0000FF, StrEasy);
  73. }
  74. }
  75.  
  76. return 0;
  77. }
  78.  
  79. if(text[0] == '!')
  80. {
  81. if(!IsPlayerInAnyGang(playerid))
  82. return SendClientMessage(playerid, RED, "Nie jesteś w żadnym gangu!"), 0;
  83.  
  84. new
  85. gangid = GetPlayerGangID(playerid)
  86. ;
  87.  
  88. text[0] = ' ';
  89.  
  90. foreach(Player, i)
  91. {
  92. if(IsPlayerInGangEx(i, gangid) && GetPVarInt(i, "GCzat") == 0)
  93. {
  94. format(StrEasy, sizeof StrEasy, "(G) %s [ID:%d]:%s", PlayerName(playerid), playerid, text);
  95. SendClientMessage(i, GREEN, StrEasy);
  96. }
  97. }
  98.  
  99. return 0;
  100. }
  101.  
  102. if(text[0] == '#')
  103. {
  104. if(GetPVarInt(playerid, "Operator") == 0)
  105. return SendClientMessage(playerid, RED, "{FF0000}Nie jesteś Operatorem!"), 0;
  106.  
  107. text[0] = ' ';
  108.  
  109. foreach(Player, i)
  110. {
  111. if(GetPVarInt(i, "Operator") == 1)
  112. {
  113. format(StrEasy, sizeof StrEasy, "(E) %s [ID:%d]:%s", PlayerName(playerid), playerid, text);
  114. SendClientMessage(i, 0x00FF00FF, StrEasy);
  115. }
  116. }
  117.  
  118. return 0;
  119. }
  120.  
  121. SearchBadWords(text);
  122. KillTimer(GetPVarInt(playerid, "DisSpamTimer"));
  123. SetPVarInt(playerid, "DisSpamTimer", SetTimerEx("DisSPAM", 2000, false, "d", playerid));
  124. SetPVarInt(playerid, "DisSpam", GetPVarInt(playerid, "DisSpam")+1);
  125. if(GetPVarInt(playerid, "DisSpam") > 5)
  126. {
  127. format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyciszony(a) na minutę. Powód: Spam",PlayerName(playerid), playerid);
  128. SendClientMessageToAll(RED, StrEasy);
  129. SetPVarInt(playerid, "UnBlockMute", GetTickCount() + 60000);
  130. return 0;
  131. }
  132. if(GetPVarInt(playerid, "ZapisanyChowany") == 0 && ChowanyRozpoczety == 0 || GetPVarInt(playerid, "ZapisanyChowany") == 1 && ChowanyRozpoczety == 0)
  133. SetPlayerChatBubble(playerid, text,WHITE,10,5000);
  134. if(IsPlayerSpecialAdmin(playerid))
  135. {
  136. if(!strcmp(PlayerName(playerid), "[PSR]NitroFuN", true))
  137. format(text, 144,"%d {%06x}%s {FF0000}(Head Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  138. else if(!strcmp(PlayerName(playerid), "[PSR]X3nO", true))
  139. format(text, 144,"%d {%06x}%s {FF0000}(Head Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  140. else if(!strcmp(PlayerName(playerid), "LaVida.Joffrey", true))
  141. format(text, 144,"%d {%06x}%s {FFFFFF}(VH@){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  142. else if(!strcmp(PlayerName(playerid), "[PSR]Sebalowek", true))
  143. format(text, 144,"%d {%06x}%s {FFFFFF}(Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  144. else if(!strcmp(PlayerName(playerid), "", true))
  145. format(text, 144,"%d {%06x}%s {FFFFFF}(Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  146.  
  147. }
  148. else
  149. {
  150. if(GetPVarInt(playerid, "[OSS]BoniacZ") == 1)
  151. format(text, 144,"%d {%06x}%s {00FF00}(Eventowicz){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  152. else if(GetPVarInt(playerid, "[OSS]CinekRPK") == 1)
  153. format(text, 144,"%d {%06x}%s {00FF00}(Eventowicz){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  154. else if(IsPlayerVIP(playerid) == 1)
  155. format(text, 144,"%d {%06x}%s {00E5EE}(VIP){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  156. else if(GetPVarInt(playerid, "Gracz") == 1)
  157. format(text, 144,"%d {%06x}%s {F5DEB3}(StałyGracz){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  158. else if(GetPVarInt(playerid, "Gracz") == 0 && IsPlayerVIP(playerid) == 0)
  159. format(text, 144,"%d {%06x}%s{FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
  160. }
  161.  
  162. SendSplitMessageToAll(0xC0C0C0FF, text);
  163. return 0;
  164. }
  165.  
  166. #define EX_SPLITLENGTH 94
  167.  
  168. SendSplitMessageToAll(color, text[]){
  169. new len = strlen(text);
  170.  
  171. if(len>EX_SPLITLENGTH){
  172. new buffer[EX_SPLITLENGTH+5];
  173. new times = (len/EX_SPLITLENGTH);
  174.  
  175. for(new i = 0; i < times+1; i++){
  176. strdel(buffer, 0, EX_SPLITLENGTH+5);
  177. if(len-(i*EX_SPLITLENGTH)>EX_SPLITLENGTH){
  178. strmid(buffer, text, EX_SPLITLENGTH*i, EX_SPLITLENGTH*(i+1));
  179. }else{
  180. strmid(buffer, text, EX_SPLITLENGTH*i, len);
  181. }
  182. SendClientMessageToAll((i)?(-1):(color), buffer);
  183. }
  184. }else{
  185. SendClientMessageToAll(color, text);
  186. }
  187. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement