New OnPlayerDisconnect
#1

Word: Some functions might not work correctly when used in this callback because the player is already disconnected when the callback is called. This means that you can't get unambiguous information from functions like GetPlayerIP and GetPlayerPos.

From: https://sampwiki.blast.hk/wiki/OnPlayerDisconnect

My Question: There is an include that can get ambiguous information from functions while the player is disconnecting ?

Thanks.
Reply
#2

Quote:
Originally Posted by Harty
Посмотреть сообщение
Word: Some functions might not work correctly when used in this callback because the player is already disconnected when the callback is called. This means that you can't get unambiguous information from functions like GetPlayerIP and GetPlayerPos.

From: https://sampwiki.blast.hk/wiki/OnPlayerDisconnect

My Question: There is an include that can get ambiguous information from functions while the player is disconnecting ?

Thanks.
Hey Harty,

GetPlayerPos works fine when calling it in OnPlayerDisconnect(), asleast from my experience... As for getting a person's IP, its better to log it when they connect/login and have it for later.
Reply
#3

use this

new Float, Float:y, Float:z;

public OnPlayerConnect(playerid)
{
SetPlayerPos(playerid, x,y,z);
return 1;
}
public OnPlayerDisConnect(playerid,Reason)
{
GetPlayerPos(playerid,x,y,z);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)