SA-MP Forums Archive
RESOLVED BY ME: creating connect and leave messages - 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: RESOLVED BY ME: creating connect and leave messages (/showthread.php?tid=251539)



RESOLVED BY ME: creating connect and leave messages - Slash01 - 27.04.2011

Hi there

after completing my GCSE's, i have decided to reopen my server

however, my last host, a friend of mine, has deleted all my server scripts, so not only do i not have my scripts, i have lost my scripting skills aswell

now i just need help with one thing that is really, i need to add connect, disconnect and death messages to my server...

just in the chat, for example:


(name)has been killed by(name)
or
(name) has died

and

(name) as joined the server

and
(name) has left the server (reason) (left, timed out)

any help please thanks x


Re: RESOLVED BY ME: creating connect and leave messages - Cjgogo - 27.04.2011

I'll help you only with leave:

pawn Код:
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(GREY,string);
    return 1;
}

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. (Timed Out)", pname);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
    }
    SendClientMessageToAll(GREY, string);
    return 1;
}
P.S:You could help me if you tell me how tos cript arrest command for a button if you know.