Hello I'm new in forum need help
#4

It's too simple. I will give u an example with a colorful/multiple color message!

On player connect
Code:
public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "{FF6600}%s{66FF00} has joined the server! {00FFFF}[Joined]", pname);
    SendClientMessageToAll(0x00ff33FF, string);
    return 1;
}
On player disconnect

Code:
public OnPlayerDisconnect(playerid, reason)
{
    new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname)); 
    switch(reason)
    {
        case 0: format(string, sizeof(string), "{FF6600}%s{FF0000} has left the server. {00FFFF}[Timeout]", pname);
        case 1: format(string, sizeof(string), "{FF6600}%s{FF0000} has left the server. {00FFFF}[Leaving]", pname);
        case 2: format(string, sizeof(string), "{FF6600}%s{FF0000} has left the server. {00FFFF}[Kicked/Banned]", pname);
    } 
    SendClientMessageToAll(0xff0000FF, string);
    return 1;
}
Reply


Messages In This Thread
Hello I'm new in forum need help - by RedRex - 26.01.2016, 23:31
Re: Hello I'm new in forum need help - by itsCody - 26.01.2016, 23:44
Re: Hello I'm new in forum need help - by Phar - 26.01.2016, 23:44
Re: Hello I'm new in forum need help - by MicroKyrr - 27.01.2016, 09:17
Re: Hello I'm new in forum need help - by amirm3hdi - 27.01.2016, 09:47
Re: Hello I'm new in forum need help - by MicroKyrr - 27.01.2016, 10:00
Re: Hello I'm new in forum need help - by RedRex - 27.01.2016, 12:39
Re: Hello I'm new in forum need help - by amirm3hdi - 27.01.2016, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)