03.03.2012, 17:15
Hi, well i the problem is, i have a ban checker and everytime when someone joins and his banned it shows me the left message.
I have this on playerconnect.
This on Onplayerdissconect
And another problem is, the banned person sees the server restarting.
How can i fix these?
I have this on playerconnect.
PHP код:
new query[300], ip[16];
GetPlayerName(playerid, pname, sizeof pname);
GetPlayerIp(playerid, ip, 16);
format(query, sizeof(query), "SELECT * FROM `Banned` WHERE `User` LIKE '%s' OR `IP` LIKE '%s' LIMIT 1", pname, ip);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() >= 1)
{
SendClientMessage(playerid, COLOR_SILVER, "You are banned from this server");
TogglePlayerControllable(playerid, 0);
loginbanned[playerid] = 1;
Kick(playerid);
}
mysql_free_result();
loginbanned[playerid] = 0;
PHP код:
if(loginbanned[playerid] == 0)
{
switch(reason)
{
case 0: format(mystring, sizeof(mystring), "%s has left the server. (Lost Connection)", pname);
case 1: format(mystring, sizeof(mystring), "%s has left the server.", pname);
case 2: format(mystring, sizeof(mystring), "%s has left the server.", pname);
}
How can i fix these?