26.12.2008, 23:31
how can i block IP's in the chat? (OnPlayerText)
Originally Posted by backwardsman97
I think he means like if someone is trying to advertise another server.
|
public OnPlayerText(playerid, text)
{
if(new pos = strfind(".", text, true) == 0)
if(pos = strfind(".", text, true, pos + 1) == 0)
if(pos = strfind(".", text, true, pos + 1) == 0)
if(pos = strfind(".", text, true, pos + 1) == 0)
if(pos = strfind(":", text, true, pos + 1) == 0)
return 0;
else return 1;
else return 1;
else return 1;
else return 1;
else return 1;
}
new len=strlen(cmdtext); new bTest=0; for(new s=0;s<len;s++) { if((cmdtext==46)&&(cmdtext[s+4]==46)&&(cmdtext[s+8]==46)) bTest=1; } if(PlayerAdminLevel[playerid] == 1337){ return 1; } if(bTest==0){ return 1;} new gname[30]; // new string[256]; new interi; interi = GetPlayerInterior(playerid); new wep = GetPlayerWeapon(playerid); GetPlayerName(playerid, gname, 30); format(string, sizeof(string), "-ANTI ADVERTISE- **(AUTO BAN)** %s(%d) Has attempted to Advertise an IP address",gname,playerid); SendClientMessageToAll(COLOR_RED, string); //ircSay(EchoConnection, EchoChan,string); SendClientMessage(playerid,COLOR_RED,"YOU HAVE BEEN DETECTED AS AN ADVERTISER"); SendClientMessage(playerid,COLOR_RED,"YOU HAVE BEEN BANNED FROM THIS SERVER"); SendClientMessage(playerid,COLOR_RED,"If you think this is a mistake post an appeal at www.thematrixrpg.com"); format(string, sizeof(string), "-ANTI ADVERTISE-**(AUTO BAN)** %s(%d) ADVERTISER Wep:[%d] Int:[%d]",gname,playerid,wep,interi); printf("%s", string); if(udb_Exists(PlayerName(playerid)) && PLAYERLIST_authed[playerid]) { dUserSetINT(PlayerName(playerid)).("nameban",1); dUserSetINT(PlayerName(playerid)).("donater",0); SetPlayerInterior(playerid,10); SetPlayerPos(playerid,219.6257,111.2549,999.0156); SetPlayerFacingAngle(playerid,2.2339); SetCameraBehindPlayer(playerid); Banning[playerid] = 1; SetTimer("BanPlayer",700,0); return 1; }