Connect Message
#1

Hey guys, this is my connect message, all i want is to show this message to admin with ip and to players without the ip but there is and error on marker line. here is the script.


Код:
public OnPlayerConnect(playerid)
{
    if(!IsPlayerAdmin(playerid))
		{
			new string[124], pName[MAX_PLAYER_NAME];
    		GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    		format(string,sizeof string,"[ Connect ] Player %s has joined the server (%s).",pName,GetPlayerIpEx(playerid));
    		SendClientMessageToAll(0xFFFFFFAA,string);
    		}
			else
			new string[124], pName[MAX_PLAYER_NAME];
    		GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    		format(string,sizeof string,"[ Connect ] Player %s has joined the server.",pName);
    		SendClientMessageToAll(0xFFFFFFAA,string);
Reply
#2

pawn Код:
public OnPlayerConnect( playerid )
{
    new
        string[ 128 ],
        string2[ 128 ],
        pName[ MAX_PLAYER_NAME ],
        pIp[ 16 ]
    ;
   
    GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
    GetPlayerIp( playerid, pIp, 16 );
   
    format( string, sizeof( string ), "[ Connect ] Player %s has joined the server.", pName );
    format( string2, sizeof( string2 ), "[ Connect ] Player %s has joined the server (%s).", pName, pIp );

    for( new j = 0; j < MAX_PLAYERS; j++ )
    {
        if( !IsPlayerConnected( j ) ) continue;
       
        if( IsPlayerAdmin( j ) ) SendClientMessage( j, 0xFFFFFFAA, string2 );
        else SendClientMessage( j, 0xFFFFFFAA, string );
    }
    return 1;
}
Replace IsPlayerAdmin (for RCON Admins) to the variable you store the admin level if you want.
Reply
#3

no noo, i use only rcon admin system, but thanks
Reply
#4

pawn Код:
public OnPlayerConnect( playerid )
{
    new
        string[ 128 ],
        pName[ MAX_PLAYER_NAME ],
        pIp[ 16 ]
    ;
   
    GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
    GetPlayerIp( playerid, pIp, 16 );
    for( new j = 0; j < MAX_PLAYERS; j++ ) {
        if( !IsPlayerConnected( j ) ) continue;
        if( IsPlayerAdmin( playerid ) ) format( string, sizeof( string ), "[ Connect ] Player %s has joined the server.", pName );
        else format( string, sizeof( string ), "[ Connect ] Player %s has joined the server (%s).", pName, pIp );
        SendClientMessage( j, 0xFFFFFFAA, string );
    }
    return 1;
}
or you can use one variable


Quote:
Originally Posted by lsreskjn
Посмотреть сообщение
no noo, i use only rcon admin system, but thanks
This is for rcon only admin system
Reply
#5

Quote:
Originally Posted by lsreskjn
Посмотреть сообщение
no noo, i use only rcon admin system, but thanks
Both of them (iJumbo's and mine) are for RCON only. We just mentioned that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)