OnPlayerDisconnect - 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 (
/showthread.php?tid=325814)
OnPlayerDisconnect -
new121 - 14.03.2012
How do make it so when player leaves the server it says " david has left the server(leaving)" or if they crashed
david has left the server(Crash)
Thanks in advance.
Re: OnPlayerDisconnect -
Jack_minka - 14.03.2012
i want to be cop tell me how plz !
Re: OnPlayerDisconnect -
Twisted_Insane - 14.03.2012
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;
}
Re: OnPlayerDisconnect -
Alexy_Dramon - 14.03.2012
Code:
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Crashed)",name);
case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
Re: OnPlayerDisconnect -
Twisted_Insane - 14.03.2012
Nice try for repeating my work...