connect message not working
#1

Can somebody tell me why the variables doesn't work? I mean, %s etc.

The message says:
has connected to the server! ID: 4 IP: 57


pawn Код:
new IP[16], name[MAX_PLAYER_NAME];
    GetPlayerIp(playerid, IP, sizeof(IP));
    GetPlayerName(playerid, name, sizeof(name));
    SendClientMessage(playerid, COLOR_LIGHTRED, "The server is now retrieving some information from the database. This usually takes around 10 seconds.");
    LoadPlayerTextDraws(playerid);
   
    new amessage[256];
    format(amessage, sizeof(amessage), "%s has connected to the server! ID: %d IP: %d", GetNameWithSpace(playerid), playerid, IP);
    SendMessageToAdmins(amessage, COLOR_LIGHTRED);
Reply
#2

Try this....
Код:
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

You mean when a player joins his name doesn't show up?

Quote:
Originally Posted by highstreetsrp
Посмотреть сообщение
Try this....
Код:
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;
}
He want it for the admins only not to all.
Reply
#4

try this:
pawn Код:
new IP[16], name[MAX_PLAYER_NAME];
    GetPlayerIp(playerid, IP, sizeof(IP));
    GetPlayerName(playerid, name, sizeof(name));
    SendClientMessage(playerid, COLOR_LIGHTRED, "The server is now retrieving some information from the database. This usually takes around 10 seconds.");
    LoadPlayerTextDraws(playerid);
   
    new amessage[256];
    format(amessage, sizeof(amessage), "%s has connected to the server! ID: %d IP: %s", GetNameWithSpace(playerid), playerid, IP);
    SendMessageToAdmins(amessage, COLOR_LIGHTRED);
Reply
#5

Thanks Eth.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)