OnPlayerDissconect message
#1

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.

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; 
This on Onplayerdissconect

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);
        } 
And another problem is, the banned person sees the server restarting.
How can i fix these?
Reply
#2

It's a bug on 0.3d
pawn Код:
Kick( playerid );
OnPlayerConnect Callback makes the player to reconnect.
Reply
#3

any chances to evade that message from case 2.

EDIT: I remember i fixed that but it stop sending that message but it keeps sending random messages from script
Reply
#4

So how can i get rid of that case 2. It pisses me of , I removed the case 2 but when someone gets kicked(for wrongpass or kicked by an admin) it inserts a msg(empy msg).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)