Block IP's in chat
#1

how can i block IP's in the chat? (OnPlayerText)
Reply
#2

I think he means like if someone is trying to advertise another server.
Reply
#3

I think he means that if an admin block some IP, the player isn't able to write anymore, something like /mute?
Reply
#4

I think he means that
Quote:
Originally Posted by backwardsman97
I think he means like if someone is trying to advertise another server.
Like make a little FS to if someone types an ip Ex: 11.111.111.111:1111
It would maybe kick them or ban them that why theres no advertisement on your server
Right?
Reply
#5

pawn Код:
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;
}
Nooo idea if that works.
Reply
#6

Ill try it give me a min.
Reply
#7

Updated it a little :P.
Reply
#8

Nope didnt work sorry
Reply
#9

none of that nonsense will work

this will :

Код:
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;

		}
Even has an auto ban
Reply
#10

actually you can comment out alot of that stuff because your server dont use it, and now that i look it will only work if it has all 3 digit numbers ex: xxx.xxx.xxx.xxx

illhave to get the cookie cutter and ill post another solutiion
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)