OnPlayerDisconnect is not called.
#1

pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    new p_Name[24],str[128];
    GetPlayerName(playerid,p_Name,sizeof(p_Name));
    switch(reason)
    {
        case 0: format(str,sizeof(str),"::: %s[%d] Has left #COL_YELLOW" (Timedout) :::",p_Name,playerid);
        case 1: format(str,sizeof(str),"
::: %s[%d] Has left #COL_YELLOW" (Leaving)  :::",p_Name,playerid);
        case 2: format(str,sizeof(str),"::: %s[%d] Has left #COL_YELLOW" (Kicked/Banned) :::",p_Name,playerid);
    }
    return 1;
}
i have this simple code here , nothing responds at all nothing , i even added a debug message under every case
pawn Код:
print(str);
but still , and this is a part of my call back , i've tried debugging every part of it and nothing responds
Rewrote the whole call back but still doesn't respond
Anyone?
Reply
#2

Remove everything in onplayerdisconnect, and add
Код:
print("onplayerdisconnect called");
Let me know if it prints.
Reply
#3

Try this.
pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    new p_Name[24],str[128];
    GetPlayerName(playerid,p_Name,sizeof(p_Name));
    switch(reason)
    {
        case 0: format(str,sizeof(str),"::: %s[%d] Has left "#COL_YELLOW" (Timedout) :::",p_Name,playerid);
        case 1: format(str,sizeof(str),"::: %s[%d] Has left "#COL_YELLOW" (Leaving)  :::",p_Name,playerid);
        case 2: format(str,sizeof(str),"::: %s[%d] Has left "#COL_YELLOW" (Kicked/Banned) :::",p_Name,playerid);
    }
    SendClientMessageToAll(-1, str);
    return 1;
}
Reply
#4

Quote:
Originally Posted by Camacorn
Посмотреть сообщение
Remove everything in onplayerdisconnect, and add
Код:
print("onplayerdisconnect called");
Let me know if it prints.
No sir it didn't ...
EDIT: fixed it.
got include called k_playerarea or something like that , it blocked most of my codes , i recommend not to use it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)