Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerText(playerid, text[])
- {
- if(GetPVarInt(playerid, "Spawned") == 0)
- return 0;
- if(GetPVarInt(playerid, "Afkowicz") == 1)
- return SendClientMessage(playerid, GREEN, "Nie możesz {FF0000}pisać dopóki jestes AFK!"), 0;
- if(GetTickCount() < GetPVarInt(playerid, "SpamCount"))
- {
- SetPVarInt(playerid, "FakeSpamCount", GetPVarInt(playerid, "FakeSpamCount") + 1);
- if(GetPVarInt(playerid, "FakeSpamCount") >= 10)
- {
- format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyrzucony(a). Powód: Mass Spam.",PlayerName(playerid), playerid);
- SendClientMessageToAll(RED, StrEasy);
- TogglePlayerSpectating(playerid, 1);
- Kick(playerid);
- }
- SetPVarInt(playerid, "SpamCount", GetTickCount() + 2000);
- }
- if(!strcmp(text, Texts[playerid], true) && Texts[playerid][0] != '\0')
- {
- SetPVarInt(playerid, "AntySPAMText", GetPVarInt(playerid, "AntySPAMText")+1);
- if(GetPVarInt(playerid, "AntySPAMText") >= 20)
- {
- format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyrzucony(a). Powód: Mass Spam.",PlayerName(playerid), playerid);
- SendClientMessageToAll(RED, StrEasy);
- TogglePlayerSpectating(playerid, 1);
- Kick(playerid);
- }
- return 0;
- }
- if(GetTickCount() < GetPVarInt(playerid, "UnBlockMute"))
- {
- 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);
- return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Informacje", StrEasy, "Zamknij", ""), 0;
- }
- format(Texts[playerid], 128, text);
- if(SearchIP(text) || SearchPage(text))
- {
- SetPVarInt(playerid, "ReklamaIP", GetPVarInt(playerid, "ReklamaIP") + 1);
- if(GetPVarInt(playerid, "ReklamaIP") == 3)
- {
- format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyrzucony(a). Powód: Reklama.",PlayerName(playerid), playerid);
- SendClientMessageToAll(RED, StrEasy);
- TogglePlayerSpectating(playerid, 1);
- Kick(playerid);
- }
- return 0;
- }
- if(text[0] == '@')
- {
- if(!IsPlayerSpecialAdmin(playerid))
- return SendClientMessage(playerid, GREEN, "{FF0000}Nie jesteś {FF0000}Adminem!"), 0;
- text[0] = ' ';
- foreach(Player, i)
- {
- if(IsPlayerSpecialAdmin(i) && GetPVarInt(i, "ACzat") == 0)
- {
- format(StrEasy, sizeof StrEasy, "(A) %s [ID:%d]:%s", PlayerName(playerid), playerid, text);
- SendClientMessage(i, 0xFF0000FF, StrEasy);
- }
- }
- return 0;
- }
- if(text[0] == '!')
- {
- if(!IsPlayerInAnyGang(playerid))
- return SendClientMessage(playerid, RED, "Nie jesteś w żadnym gangu!"), 0;
- new
- gangid = GetPlayerGangID(playerid)
- ;
- text[0] = ' ';
- foreach(Player, i)
- {
- if(IsPlayerInGangEx(i, gangid) && GetPVarInt(i, "GCzat") == 0)
- {
- format(StrEasy, sizeof StrEasy, "(G) %s [ID:%d]:%s", PlayerName(playerid), playerid, text);
- SendClientMessage(i, GREEN, StrEasy);
- }
- }
- return 0;
- }
- if(text[0] == '#')
- {
- if(GetPVarInt(playerid, "Operator") == 0)
- return SendClientMessage(playerid, RED, "{FF0000}Nie jesteś Operatorem!"), 0;
- text[0] = ' ';
- foreach(Player, i)
- {
- if(GetPVarInt(i, "Operator") == 1)
- {
- format(StrEasy, sizeof StrEasy, "(E) %s [ID:%d]:%s", PlayerName(playerid), playerid, text);
- SendClientMessage(i, 0x00FF00FF, StrEasy);
- }
- }
- return 0;
- }
- SearchBadWords(text);
- KillTimer(GetPVarInt(playerid, "DisSpamTimer"));
- SetPVarInt(playerid, "DisSpamTimer", SetTimerEx("DisSPAM", 2000, false, "d", playerid));
- SetPVarInt(playerid, "DisSpam", GetPVarInt(playerid, "DisSpam")+1);
- if(GetPVarInt(playerid, "DisSpam") > 5)
- {
- format(StrEasy, sizeof StrEasy, "{FF0000}%s [ID:%d] {FF0000}został(a) wyciszony(a) na minutę. Powód: Spam",PlayerName(playerid), playerid);
- SendClientMessageToAll(RED, StrEasy);
- SetPVarInt(playerid, "UnBlockMute", GetTickCount() + 60000);
- return 0;
- }
- if(GetPVarInt(playerid, "ZapisanyChowany") == 0 && ChowanyRozpoczety == 0 || GetPVarInt(playerid, "ZapisanyChowany") == 1 && ChowanyRozpoczety == 0)
- SetPlayerChatBubble(playerid, text,WHITE,10,5000);
- if(IsPlayerSpecialAdmin(playerid))
- {
- if(!strcmp(PlayerName(playerid), "[PSR]NitroFuN", true))
- format(text, 144,"%d {%06x}%s {FF0000}(Head Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(!strcmp(PlayerName(playerid), "[PSR]X3nO", true))
- format(text, 144,"%d {%06x}%s {FF0000}(Head Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(!strcmp(PlayerName(playerid), "LaVida.Joffrey", true))
- format(text, 144,"%d {%06x}%s {FFFFFF}(VH@){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(!strcmp(PlayerName(playerid), "[PSR]Sebalowek", true))
- format(text, 144,"%d {%06x}%s {FFFFFF}(Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(!strcmp(PlayerName(playerid), "", true))
- format(text, 144,"%d {%06x}%s {FFFFFF}(Admin){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- }
- else
- {
- if(GetPVarInt(playerid, "[OSS]BoniacZ") == 1)
- format(text, 144,"%d {%06x}%s {00FF00}(Eventowicz){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(GetPVarInt(playerid, "[OSS]CinekRPK") == 1)
- format(text, 144,"%d {%06x}%s {00FF00}(Eventowicz){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(IsPlayerVIP(playerid) == 1)
- format(text, 144,"%d {%06x}%s {00E5EE}(VIP){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(GetPVarInt(playerid, "Gracz") == 1)
- format(text, 144,"%d {%06x}%s {F5DEB3}(StałyGracz){FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- else if(GetPVarInt(playerid, "Gracz") == 0 && IsPlayerVIP(playerid) == 0)
- format(text, 144,"%d {%06x}%s{FFFFFF}: %s", playerid, (GetPlayerColor(playerid) >>> 8), PlayerName(playerid), text);
- }
- SendSplitMessageToAll(0xC0C0C0FF, text);
- return 0;
- }
- #define EX_SPLITLENGTH 94
- SendSplitMessageToAll(color, text[]){
- new len = strlen(text);
- if(len>EX_SPLITLENGTH){
- new buffer[EX_SPLITLENGTH+5];
- new times = (len/EX_SPLITLENGTH);
- for(new i = 0; i < times+1; i++){
- strdel(buffer, 0, EX_SPLITLENGTH+5);
- if(len-(i*EX_SPLITLENGTH)>EX_SPLITLENGTH){
- strmid(buffer, text, EX_SPLITLENGTH*i, EX_SPLITLENGTH*(i+1));
- }else{
- strmid(buffer, text, EX_SPLITLENGTH*i, len);
- }
- SendClientMessageToAll((i)?(-1):(color), buffer);
- }
- }else{
- SendClientMessageToAll(color, text);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement