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=465478)
Connect Message -
lsreskjn - 22.09.2013
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);
Re: Connect Message -
Konstantinos - 22.09.2013
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.
Re: Connect Message -
lsreskjn - 22.09.2013
no noo, i use only rcon admin system, but thanks
Re: Connect Message -
iJumbo - 22.09.2013
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
Re: Connect Message -
Konstantinos - 22.09.2013
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.