Jump to content

Question

Posted

sal all! cum pot face o chestie pentru admin ca de exemplu...cand cineva da unui admin mai mare ca el warn/ban/kick,...sa ii dea lui automat ban..sau sal avertizeze? un fel de sistem antiban admin...cum pot face?

2 answers to this question

Recommended Posts

Posted

if(!isplayeradmin)

return sendclientmessage(red, "Nu poti da ban unui admin mai mare!")

pune ceva de genu la comanda ta

Asta sa o crezi tu, ai gresit total sintaxa.

Corect este

if( !IsPlayerAdmin ( playerid ) ) return SendClientMessage( playerid, red, "bla bla bbla ") ;

Si verifica da jucatorul este admin RCON ...

------------------------------------------

Nu stiu cum sa-ti explic sa intelegi ...

Uite:

CMD:ban( playerid, params[ ] )
{
	new
	    g_aString   [ 256 ],
	    g_ID,
	    g_Reason,
	    g_pName     [  24 ],
	    g_aName     [  24 ]
	    ;

	if ( pData [ playerid ] [ pAdmin ] < 2 )
	                    return SendError( playerid, "You are not authorized to use this command! ");
	                    
	if ( sscanf( params, "is[256]", g_ID, g_Reason ) )
	                    return SendUsage( playerid, "/ban [ id ] [ reason ] ");

	if ( !IsPlayerConnected ( g_ID ) )
	                    return SendError( playerid, "That player is not connected ");

	GetPlayerName( playerid, g_pName, sizeof ( g_pName ) );
	GetPlayerName( g_ID,     g_aName, sizeof ( g_aName ) );

	if ( pData [ g_ID ] [ pAdmin ] =< 3 ) // sau levelul maxim ( owner )
	{
		format( g_aString, sizeof ( g_aString ), ">> %s (ID: %d) has been banned by %s (ID: %d), for: %s", g_pName, playerid, g_aName, g_ID );
		SendClientMessageToAll( COLOR_ORANGE, g_aString );

		BanEx ( g_ID, g_Reason );
	}
	else
		return SendError( playerid, "You cannot use this command on this admin! ");

	return 1;
}

Nu am testat-o dar asa ar trebui sa mearga :D

communitylogosml.png

94.23.120.101:7778

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.