Connect message.. - 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.. (
/showthread.php?tid=465637)
Connect message.. -
CesarLT - 23.09.2013
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..?
Re: Connect message.. -
Konstantinos - 23.09.2013
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;
}
Re: Connect message.. -
CesarLT - 23.09.2013
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?
Re: Connect message.. -
Konstantinos - 23.09.2013
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;
}
Re: Connect message.. -
CesarLT - 23.09.2013
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. :/