SA-MP Forums Archive
Login Warning Message Code - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Login Warning Message Code (/showthread.php?tid=274330)



Login Warning Message Code - Panormitis - 05.08.2011

Hello guys, i want a pawno code that when someone log in my server will appear a message in chat that will say
"Playername has join the server" and when he log out it will say "Playername has left the server" .....how to do this


Re: Login Warning Message Code - Kingunit - 05.08.2011

OnPlayerConnect
pawn Код:
new str[256], pName[24], pRame[24];
    GetPlayerName(playerid, pName, 24);
    GetPlayerRame(playerid, pRame, 24);
    format(str, 256, "[JOIN] %s has joined the server.", pRame);
    SendClientMessage(i, COLOR_GREY,str);
And
OnPlayerDisconnect
pawn Код:
new pRame[24], pName[24];
    GetPlayerRame(playerid, pRame, 24);
    GetPlayerName(playerid, pName, 24);
    format(str, 256, "[LEFT] %s has left the server.", pRame);
    SendClientMessageToAll(COLOR_GREY,str);



Re: Login Warning Message Code - iPLEOMAX - 05.08.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    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. (Timed out)",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;
}
OnPlayerConnect
OnPlayerDisconnect


Re: Login Warning Message Code - Kush - 05.08.2011

PHP код:
public OnPlayerConnect(playerdid)
{
    new 
name[MAX_PLAYER_NAME], string[128];
    
GetPlayerRPName(playeridnamesizeof(name));
    
format(stringsizeof(string), "%s has joined the server!"name);
    
SendClientMessageToAll(-1string);
    return 
1;