if someone types a ip they get kicked?
#1

^i dont understand how to make the ip part help<.<
Reply
#2

Search, i know theres alot of people asking for that
Reply
#3

i found this
Код:
stock CountOccurrence(text[],ch) {
	new count = 0;
	for(new i=0;i<strlen(text);i++) {
		if (text[i] == ch) count++;
	}
	return count;
}

Script_OnPlayerText(playerid, text[]) {
	if(CountOccurrence(text,'.')>2 && CountOccurrence(text,':')>1) {
 		if(!IsPlayerAdmin(playerid)) {
 		  SendClientMessage(playerid,0xFF0000AA,"Error: We do not allow the posting of IP addresses here");
 		  Kick(playerid);
			return 0;
		}
	}
    return 1;
Код:
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAN~1.PWN(1456) : warning 203: symbol is never used: "Script_OnPlayerText"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.

ingore loose ident
Reply
#4

Try using the correct callback, OnPlayerText.
Reply
#5

Looks like that code is ysi, silly question are you using ysi? if not use
pawn Код:
stock CountOccurrence(text[],ch) {
    new count = 0;
    for(new i=0;i<strlen(text);i++) {
        if (text[i] == ch) count++;
    }
    return count;
}

public OnPlayerText(playerid, text[]) {
    if(CountOccurrence(text,'.')>2 && CountOccurrence(text,':')>1) {
        if(!IsPlayerAdmin(playerid)) {
          SendClientMessage(playerid,0xFF0000AA,"Error: We do not allow the posting of IP addresses here");
          Kick(playerid);
            return 0;
        }
    }
    return 1;
that should not give that error if u r not using ysi
Reply
#6

typed in my ip prefectly

72.51.79.182

nothing happened

wtf why is there isplayeradmin in there for?
Reply
#7

Admin can type IP but player not
Quote:
Originally Posted by Kar
typed in my ip prefectly

72.51.79.182

nothing happened

wtf why is there isplayeradmin in there for?
type port too 72.51.79.182:7777
or type "..." xD
Reply
#8

What if I type

Hi guys. I'm new. My name's Joe. (: So what do I need to do?

I'd be kicked lol

Reply
#9

Not got a clue why its not working, its checking if a player isnt admin, so admin can type ip's without getting kicked sorry cant help more , ps u need to put the port too like :7777
Reply
#10

Shouldn't it be..

if(CountOccurrence(text,'.')>3 && CountOccurrence(text,':')>1) {

So if you type 65.56.55:6666 you wont get kicked? (only 3 dots)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)