23.12.2010, 01:19
Hmm... that's a really tricky one.
What I'd suggest to do is:
Create a new table with the IP, and A Tinyint called active. the size of IP should be 50, and the size of the Tinyint should be 15.
Now, the whole concept is, when the user is banned, their IP is sent to the table, and the Tinyint called 'active' is set to one. After that, go back to the gamemode and do this.
You need to create something that checks the table for that IP the user connects with, and see if the 'active' is set to either 1, or 0. If it is 1, refuse the connection, by kicking the player. If it is 0, let them connect.
So:
But note, you might get a bug where it checks all the IP's, when you're only looking for the one IP the user connected with, be careful. And this has not even been tested, so don't blame me if it doesn't work. I'm trying to help you get a headstart on this.
What I'd suggest to do is:
Create a new table with the IP, and A Tinyint called active. the size of IP should be 50, and the size of the Tinyint should be 15.
Now, the whole concept is, when the user is banned, their IP is sent to the table, and the Tinyint called 'active' is set to one. After that, go back to the gamemode and do this.
You need to create something that checks the table for that IP the user connects with, and see if the 'active' is set to either 1, or 0. If it is 1, refuse the connection, by kicking the player. If it is 0, let them connect.
So:
pawn Код:
new
k[1][50],
string[128], //optional; if you have a global query, delete this
pIP[16]; //for player IP
GetPlayerIp(playerid, pIP, 16);
format(string, 128, "SELECT IP from TableName WHERE active = 1");
mysql_query(string);
mysql_store_result();
mysql_free_result();
//and so on