when a player crashes +reps! -
PawnoQ - 03.02.2012
hi,
right now i dont have the opportunity to test it myself so i hope someone can tell me out of mind.
Is the callback OnPlayerDisconnect executed successfully for a player that crashes?
(I know its not called when the server crashes).
But is it called when only a certain player crashes (loses his connection)?
thx in advance.
Re: when a player crashes +reps! -
PawnoQ - 04.02.2012
bump.
Re: when a player crashes +reps! -
Norck - 04.02.2012
Yes, OnPlayerDisconnect gets called even if player crashes.
AW: when a player crashes +reps! -
Tigerkiller - 04.02.2012
yes it is
Re: when a player crashes +reps! -
thimo - 04.02.2012
Yes it does. And its also has the oppertunity to make a message for it why he left like this:
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
}
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
Source:
https://sampwiki.blast.hk/wiki/Creating_...Leave_Messages
Re: when a player crashes +reps! -
Twisted_Insane - 04.02.2012
There is also a possibilty to show this, which means that OnPlayerDisconnect HAS to get called! Example:
PHP Code:
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
case 2: format(string, sizeof(string), "%s has been kicked by an administrator. (Kicked)", pname);
}
SendClientMessageToAll(0xAAAAAAAA, string);
EDIT: OMG, he was faster!!!
Re: when a player crashes +reps! -
PawnoQ - 04.02.2012
so the players data is saved even if a player crashes right?
(if there is a saving system under OnPlayerDisconnect ofc)
thx, all +rep
Re: when a player crashes +reps! -
thimo - 04.02.2012
Thanks