25.08.2014, 09:44
Hello guys, i want to edit my ban system using "gpci".
NAME: Test, IP: 122.122.122.555, SERIAL: 4084DADD58D44E0DED884D4FE4ECEED5D04CEE84
NAME: Test2, IP: 122.122.122.777, SERIAL: 4084DADD58D44E0DED884D4FE4ECEED5D04CEE84
So i need a function to detect if these two IPs are in the same range but i don't have any ideas right now. In my mind i have something like if( 122.122.122.*** == 122.122.122.*** ) => check if( SERIAL1 == SERIAL2 ) => KICK.
I would try the strfind with the "position" but some IPs have this format: **.***.**.*** or ***.***.**.*** so i can't use this way. (I'm using MySQL)
EDIT: Can i use something like
?
NAME: Test, IP: 122.122.122.555, SERIAL: 4084DADD58D44E0DED884D4FE4ECEED5D04CEE84
NAME: Test2, IP: 122.122.122.777, SERIAL: 4084DADD58D44E0DED884D4FE4ECEED5D04CEE84
So i need a function to detect if these two IPs are in the same range but i don't have any ideas right now. In my mind i have something like if( 122.122.122.*** == 122.122.122.*** ) => check if( SERIAL1 == SERIAL2 ) => KICK.
I would try the strfind with the "position" but some IPs have this format: **.***.**.*** or ***.***.**.*** so i can't use this way. (I'm using MySQL)
EDIT: Can i use something like
pawn Код:
SELECT * FROM `Banlist` WHERE `IP` LIKE '%127.0.0.1%'