OnPlayerDisconnect
#1

Hello, I have a proble, here is my codes:

Код:
	new string[128];
	new name[MAX_PLAYER_NAME];
	new ip[20];
	GetPlayerIp(playerid,ip,sizeof(ip));
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0:
		{
			format(string,sizeof string,"%s (ID: %d) left the server [Timed out]",name,playerid);
			SendNoAdminMessage(0xAFAFAFAA,string);
			format(string,sizeof string,"%s (ID: %d) left the server [IP: %s] [Timed out]",name,playerid,ip);
			SendReportMessage(0xAFAFAFAA,string);
		}
        case 1:
		{
			format(string,sizeof string,"%s (ID: %d) left the server [Leaving]",name,playerid);
			SendNoAdminMessage(0xAFAFAFAA,string);
			format(string,sizeof string,"%s (ID: %d) left the server [IP: %s] [Timed out]",name,playerid,ip);
			SendReportMessage(0xAFAFAFAA,string);
		}
        case 2:
		{
			format(string,sizeof string,"%s (ID: %d) left the server [Kicked/Banned]",name,playerid);
			SendNoAdminMessage(0xAFAFAFAA,string);
			format(string,sizeof string,"%s (ID: %d) left the server [IP: %s] [Timed out]",name,playerid,ip);
			SendReportMessage(0xAFAFAFAA,string);
		}
    }
SendNoAdminMessage means tо send a message to all players with admin level 0
SendReportMessage means tо send a message to all players with admin level more than 0

And the problem is when someone leaving the server this IP appears always 255.255.255.255, but when the player is kicked/banned the corrected IP appears, but says that the player timed out.
Any ideas how to fix it ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)