Jump to content
  • 0

Problema


Neculai

Question

Problema intalnita (descriere):am comanda /setlevel dar cand dai cuiva admin se inchide serverul
Ero(area / rile) / warning-(ul / urile):0
Liniile de cod / sursa / script-ul:

CMD:setlevel( playerid, params[ ] )
{
	gsString[ 0 ] = EOS;

	if ( !IsPlayerAdmin( playerid ) && PlayerInfo[ playerid ][ rAdmin ] != 1 )
		return SendError( playerid, "You have to been logged in as RCON Admin to use this command!" );

	new
		Player,
		aLevel
	;
	if ( sscanf( params, "ui", Player, aLevel ) )
		return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/setlevel [PlayerID] [Level]" );

	if ( !IsPlayerConnected( Player ) && Player == INVALID_PLAYER_ID )
		return SendError( playerid, "Player not connected!" );

	if ( PlayerInfo[ Player ][ LoggedIn ] == 0 )
		return SendError( playerid, "Player must be registered and logged in!" );

	if ( aLevel > 10 )
		return SendError( playerid, "Incorrect Level" );

	if ( aLevel == PlayerInfo[ Player ][ Level ] )
		return SendError( playerid, "Player is already have this level" );

    if ( aLevel > 0 )
		format( gsString, sizeof( gsString ), "Administrator %s has set you to administrator status [Level: %d]", PlayerName( playerid ), aLevel );
    else
		format( gsString, sizeof( gsString ), "Administrator %s has set you to player status [Level: %d]", PlayerName( playerid ), aLevel );

	SendClientMessage( Player, COLOR_ABLUE, gsString );

    if ( aLevel > PlayerInfo[ Player ][ Level ] )
		Announce( Player, "~g~Promoted!", 2000, 3 );
    else
		Announce( Player,"~r~Demoted", 2000, 3 );

    FormatMSG( playerid, COLOR_ABLUE, "You have made %s Level %d on %s", PlayerName( Player ), aLevel, zDate( ) );

    format( gsString, sizeof( gsString ),"Administrator %s has made %s Level %d", PlayerName( playerid ), PlayerName( Player ), aLevel );
    SaveToFile( "AdminLog", gsString );
    PlayerInfo[ Player ][ Level ] = aLevel;

    PlayerPlaySound( Player, 1057, 0.0, 0.0, 0.0 );
    return 1;
}

Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da am incercat

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

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.