RESOLVED BY ME: creating connect and leave messages
#1

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)