/admins - Something wrong here?
#1

I have just started scripting again after a looong break..
I'm kinda confused about how to fix things again.

Is there something wrong with this command? I haven't tested it 100% yet, all I know is that it is working, but anyways saying unknown command at the end.

Код:
COMMAND:admins(playerid, params[])
{
	new string[256];
	new pname[MAX_PLAYER_NAME];
	SendClientMessage(playerid, grey, "Admins Online:");
	for(new i=0;i<=MAX_PLAYERS;i++) {
	if(adminlevel[i] >= 1) {
	GetPlayerName(i, pname, sizeof(pname));
	format(string,sizeof(string),"AdminLevel %d:  %s[%d] ", adminlevel[i], pname, GetPlayerID(pname));
	SendClientMessage(playerid, grey, string);
	}
	}
	return 1;
}
Reply
#2

pawn Код:
COMMAND:admins(playerid, params[])
{
    new string[256];
    new pname[MAX_PLAYER_NAME];
    SendClientMessage(playerid, grey, "Admins Online:");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(adminlevel[i] >= 1)
        {
            GetPlayerName(i, pname, sizeof(pname));
            format(string,sizeof(string),"AdminLevel %d:  %s[%d] ", adminlevel[i], pname, GetPlayerID(pname));
            SendClientMessage(playerid, grey, string);
        }
    }
    return 1;
}
Should do it. ^^
Reply
#3

Yes, but this is better:
Quote:

COMMAND:admins(playerid, params[])
{
foreach(Player, ID)
{
if(adminlevel[ ID ] >= 1)
{
new Stringas[ 67 ], pName[ 24 ];
GetPlayerName( ID, pName, 24 );
format( Stringas , 67 , "Admin %s[ID: %i] Level %i.", adminlevel[ ID ], pName, GetPlayerID( pName ));
}
}
return true;
}

Reply
#4

Thanks Jeffry Problem Solved
Reply
#5

Quote:
Originally Posted by spyr0x
Посмотреть сообщение
Thanks Jeffry Problem Solved
No problem.
Thanks for the feedback. Have fun.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)