replace ip in chat
#1

how to find ip in chat and replace it with my own ip?

so like player types 123.12.12.1424:7777 for advertisment and i want it replaced with my server ip.. like in crazybobs server when u type an ip u know it replaces with their own?

how can i put it in onplayerText? just for fun im curious i dont want to delete the whole message just the ip part..
Reply
#2

pawn Код:
if(strfind(text, ":", true) != -1)
        {

            new
                i_numcount,
                i_period,
                i_pos;

            while(text[i_pos]) {
                if('0' <= text[i_pos] <= '9') i_numcount++;
                else if(text[i_pos] == '.') i_period++;
                i_pos++;
            }
            if(i_numcount >= 8 && i_period >= 3) {
                format(string, sizeof(string), "123.12.12.1424:7777");
                ProxDetector(20.0,playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                Kick(playerid);
                return 0;
            }
        }
under public OnPlayerText(playerid, text[]) and public public OnPlayerCommandText(playerid, cmdtext[]) **OnPlayerCommandText ver needs a little modifacation**
Reply
#3

Quote:
Originally Posted by NumbSkull
Посмотреть сообщение
pawn Код:
if(strfind(text, ":", true) != -1)
        {

            new
                i_numcount,
                i_period,
                i_pos;

            while(text[i_pos]) {
                if('0' <= text[i_pos] <= '9') i_numcount++;
                else if(text[i_pos] == '.') i_period++;
                i_pos++;
            }
            if(i_numcount >= 8 && i_period >= 3) {
                format(string, sizeof(string), "123.12.12.1424:7777");
                ProxDetector(20.0,playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                Kick(playerid);
                return 0;
            }
        }
under public OnPlayerText(playerid, text[]) and public public OnPlayerCommandText(playerid, cmdtext[]) **OnPlayerCommandText ver needs a little modifacation**
thanks i guess that willl work... rapped+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)