dcmd_admins help.
#1

well, i've currently got this sort of working, but it wont display all the admins, only 1!

Код:
dcmd_admins(playerid, params[])
{
	for (new i = 0; i < MAX_PLAYERS; i++)
	{
		new string[256], name[MAX_PLAYER_NAME];
		SendClientMessage(i, COLOR_GREEN, "Current Admins Online :");
		if (IsPlayerConnected(i))
		{
			if (dini_Int(GetPlayerPath(i), "admin") > 0)
			{
				new level = dini_Int(GetPlayerPath(i), "admin");
				GetPlayerName(i, name, sizeof(name));
				format(string, sizeof(string), "%s - Level %d", name, level);
				SendClientMessage(i, COLOR_WHITE, string);
				return 1;
			}
			else
			{
				SendClientMessage(i, COLOR_WHITE, "Currently No Admins Online.");
				return 1;
			}
		}
	}
	#pragma unused params
	#pragma unused playerid
}
Help is very thankful.
Reply
#2

pawn Код:
if (dini_Int(GetPlayerPath(i), "admin") > 0)
            {
                new level = dini_Int(GetPlayerPath(i), "admin");
                GetPlayerName(i, name, sizeof(name));
                format(string, sizeof(string), "%s - Level %d", name, level);
                SendClientMessage(i, COLOR_WHITE, string);
                return 1;
            }
Remove return 1
Reply
#3

did nothing, just made it show 2 times.
Reply
#4



pawn Код:
dcmd_admins(playerid, params[])
{
    #pragma unused params
    new string[128], name[MAX_PLAYER_NAME];
    string[0]=0;
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if ( IsPlayerConnected( i ) )
        {
            if ( dini_Int( GetPlayerPath(i), "admin" ) >0 )
            {
                if( string[0] == 0 )
                SendClientMessage( playerid, COLOR_GREEN, "Current Admins Online :" );
               
                new level = dini_Int( GetPlayerPath( i ), "admin" );
                GetPlayerName( i, name, MAX_PLAYER_NAME );
                format( string, sizeof( string ), "%s - Level %d", name, level );
                SendClientMessage( playerid, COLOR_WHITE, string );
            }
        }
    }
    if( string[0] == 0 )
    SendClientMessage( playerid, COLOR_WHITE, "Currently No Admins Online.");
   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)