OnPlayerDisconnect is not called. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDisconnect is not called. (
/showthread.php?tid=372399)
OnPlayerDisconnect is not called. -
CoDeZ - 26.08.2012
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
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?
Re: OnPlayerDisconnect is not called. -
Camacorn - 26.08.2012
Remove everything in onplayerdisconnect, and add
Код:
print("onplayerdisconnect called");
Let me know if it prints.
Re: OnPlayerDisconnect is not called. -
Universal - 26.08.2012
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;
}
Re: OnPlayerDisconnect is not called. -
CoDeZ - 27.08.2012
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.