Connect message..
#1

Hello everyone, I am trying lately to make a message which will show everyone who's connected to the server, and who disconnected, like that %s [id(?)] has just connected to xxx...

I am guessing I shall use variables but I am not sure, can anyone give me an example please? Thanks in advance.

EDIT: Also can I keep the name colors to be only 2 of them? Like id 0 orange, id 1 white, id 2 orange and so on..?
Reply
#2

pawn Код:
public OnPlayerConnect( playerid )
{
    new
        _name[ MAX_PLAYER_NAME ],
        _msg[ 64 ]
    ;
    GetPlayerName( playerid, _name, MAX_PLAYER_NAME );
    format( _msg, sizeof( _msg ), "%s [id(%d)] has just connected to xxx...", _name, playerid );
    SendClientMessageToAll( 0xFFFF00FF, _msg );
    return 1;
}
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
public OnPlayerConnect( playerid )
{
    new
        _name[ MAX_PLAYER_NAME ],
        _msg[ 64 ]
    ;
    GetPlayerName( playerid, _name, MAX_PLAYER_NAME );
    format( _msg, sizeof( _msg ), "%s [id(%d)] has just connected to xxx...", _name, playerid );
    SendClientMessageToAll( 0xFFFF00FF, _msg );
    return 1;
}
Thanks, but how about the disconnect and the second question?
Reply
#4

The disconnect is the same thing.

About your second question:
pawn Код:
#define IsOdd(%0) %0 % 2

public OnPlayerConnect( playerid )
{
    if( IsOdd( playerid ) ) SetPlayerColor( playerid, COLOR_WHITE_HERE );
    else SetPlayerColor( playerid, COLOR_ORANGE_HERE );
    // rest
    return 1;
}
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The disconnect is the same thing.

About your second question:
pawn Код:
#define IsOdd(%0) %0 % 2

public OnPlayerConnect( playerid )
{
    if( IsOdd( playerid ) ) SetPlayerColor( playerid, COLOR_WHITE_HERE );
    else SetPlayerColor( playerid, COLOR_ORANGE_HERE );
    // rest
    return 1;
}
Like always..thanks again for your help. Can't rep anymore lol, gotta wait. :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)