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(playeridpnamesizeof(pname));
    
format(stringsizeof(string), "%s has joined the server"pname);
    
SendClientMessageToAll(0xAAAAAAAAstring);
    return 
1;

Creating a Leave Message

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
pname[MAX_PLAYER_NAME], string[39 MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnamesizeof(pname)); 
    switch(
reason)
    {
        case 
0format(stringsizeof(string), "%s has left the server. (Lost Connection)"pname);
        case 
1format(stringsizeof(string), "%s has left the server. (Leaving)"pname);
        case 
2format(stringsizeof(string), "%s has left the server. (Kicked)"pname);
    } 
    
SendClientMessageToAll(0xAAAAAAAAstring);
    return 
1;