SA-MP Forums Archive
connect message not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: connect message not working (/showthread.php?tid=540217)



connect message not working - EmilLykke - 03.10.2014

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);



Re: connect message not working - highstreetsrp - 03.10.2014

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;
}



Re: connect message not working - JJack - 03.10.2014

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.


Re: connect message not working - Eth - 03.10.2014

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);



Re: connect message not working - EmilLykke - 03.10.2014

Thanks Eth.