pawn Код:
public OnPlayerText(playerid, text[])
{
new str[128];
if(dini_Int(DataPath(playerid), "Ban") == 1 && CheckBan(IP))
{
SendClientMessage(playerid, COLOR_RED, "*** You cannot use chat you are banned! ***");
return 0;
}
if(pData[playerid][Mute] == 1)
{
SendClientMessage(playerid, COLOR_RED, "*** You are mute you cannot talk! ***");
return 0;
}
if(CapsLock(text))
{
SendClientMessage(playerid, COLOR_RED, "*** Disable your caps lock, because it annoys a player! ***");
return 0;
}
if(stringContainsIP(text))
{
format(str, sizeof(str), "%s(%d) has been kick for Server Advertising", GetpName(playerid), playerid);
SendClientMessageToAll(COLOR_RED, str);
SendClientMessage(playerid, COLOR_RED, "*** You have been kicked for Server Advertising ***");
Kick(playerid);
return 0;
}
for(new i=0; i<MAX_ENTRY; i++)
{
if(!Swear[i][0]) continue;
Cenzura(text, Swear[i]);
}
if(text[0] == '!' && strfind(GetpName(playerid), "[iP]", false) != -1)
{
format(str, sizeof(str), "[iP] Clan Chat: %s: "white"%s", GetpName(playerid), text[1]);
SendMessageToiPMember(COLOR_LIGHTGREEN, str);
return 0;
}
else if(text[0] == '@' && pData[playerid][Admin] > 1)
{
format(str, sizeof(str), "Admin Chat: %s: "white"%s", GetpName(playerid), text[1]);
SendMessageToAdmins(COLOR_RED, str);
return 0;
}
else if(text[0] == '#' && pData[playerid][VIP] > 1)
{
format(str, sizeof(str), "VIP Chat: %s: "white"%s", GetpName(playerid), text[1]);
SendMessageToVIP(COLOR_YELLOW, str);
return 0;
}
if(strval(text) == ContestAnswer && ContestAnswer != -1)
{
new string[128];
KillTimer(ContestTimer);
format(string,sizeof string,"CONTEST: %s(%d) has won the reaction-contest", GetpName(playerid), playerid);
SendClientMessageToAll(0x00FFFFFF,string);
GivePlayerMoney(playerid,CONTEST_PRIZE);
SetPlayerScore(playerid, GetPlayerScore(playerid) + CONTEST_PRIZE2);
ContestAnswer = -1;
return 0;
}
if(strfind(GetpName(playerid), "Annoymous[iP]", false) != -1)
{
format(str, sizeof(str), "[iP] Co-Owner: %s"white" (%d) %s", GetpName(playerid), playerid, text);
SendClientMessageToAll(COLOR_ORANGE, str);
IRC_GroupSay(gGroupID, IRC_Channel, str);
return 0;
}
else if(strfind(GetpName(playerid), "[iP]", false) != -1)
{
format(str, sizeof(str), "[iP] Member: %s"white" (%d) %s", GetpName(playerid), playerid, text);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);
IRC_GroupSay(gGroupID, IRC_Channel, str);
return 0;
}
format(str, sizeof(str), "%s (%d): "white"%s", GetpName(playerid), playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), str);
IRC_GroupSay(gGroupID, IRC_Channel, str);
format(str, MAX_CHATBUBBLE_LENGTH, "%s", text);
SetPlayerChatBubble(playerid, str, COLOR_YELLOW, 13.0, 10000);
return 0;
}