SA-MP Forums Archive
When player disconect see reason but with command - 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: When player disconect see reason but with command (/showthread.php?tid=452301)



When player disconect see reason but with command - Configuration - 20.07.2013

HELLO i need when player leave from game and i make /quits see who player have quit game and reason for what he is Leave Crash/Timeout/kick/ban
Thanks


Re : When player disconect see reason but with command - AmirRFCNR - 20.07.2013

Creating a Join Message


PHP код:
public OnPlayerConnect(playerid)
{
    new 
pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
    
GetPlayerName(playerid, pname, sizeof(pname));
    
format(string, sizeof(string), "%s has joined the server", pname);
    
SendClientMessageToAll(0xAAAAAAAA, string);
    return 
1;
} 
Creating a Leave Message

PHP код:
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;
}