OnPlayerDisconnect
#1

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.
Reply
#2

i want to be cop tell me how plz !
Reply
#3

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;
}
Reply
#4

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;
}
Reply
#5

Nice try for repeating my work...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)