Help /Admins
#1

Help me pls how i can repair this it have 0 error but doesn't work

dcmd_Admins(playerid, params[])
{
#pragma unused params
if (InDm[playerid] >= 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR:You can't use this command in a dm/event.");
new sendername[MAX_PLAYER_NAME], string2[256], string[256], count;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (GetPlayerName(i, sendername, sizeof(sendername)) && PlayerInfo[i][Admin] >= 1) return format(string, sizeof (string), "%s{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d\n", string, sendername, i, PlayerInfo[i][Admin]);
if(GetPlayerName(i, sendername, sizeof(sendername)) && PlayerInfo[i][Admin] >= 1 && IsPlayerAdmin(i)) return format(string2, sizeof (string2), "%s{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d {FFBF00}(RCON)\n", string2, sendername, i, PlayerInfo[i][Admin]);
++count;
if (count) ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_LIST, "Admins Online", string, string2, "Close");
else SendClientMessage(playerid, 0xFF0000FF, "No admins online.");
}
return 1;
}
Reply
#2

What message do you get in-game?
Reply
#3

Never return in a loop unless you want to stop it.

PHP код:
dcmd_test(playeridparams[])
{
    
#pragma unused params
    
    
if (InDm[playerid] >= 1) return SendClientMessage(playerid0xFF0000FF"ERROR:You can't use this command in a dm/event.");
    
    new 
sendername[MAX_PLAYER_NAME], string2[256], count;
    for (new 
0MAX_PLAYERSi++) //foreach(new i : Player)
    
{
        if (
GetPlayerName(isendernamesizeof(sendername)) && PlayerInfo[i][Admin] >= 1)
        {
            
format(string2sizeof (string2), "%s{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d%s\n"string2sendernameiPlayerInfo[i][Admin], (IsPlayerAdmin(i)) ? (" {FFBF00}(RCON)") : (""));
            ++
count;
        }
    }
    if (
countShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_LIST"Admins Online"string2"Close""");
    else 
SendClientMessage(playerid0xFF0000FF"No admins online.");
    return 
1;

Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Never return in a loop unless you want to stop it.

PHP код:
dcmd_test(playeridparams[])
{
    
#pragma unused params
    
    
if (InDm[playerid] >= 1) return SendClientMessage(playerid0xFF0000FF"ERROR:You can't use this command in a dm/event.");
    
    new 
sendername[MAX_PLAYER_NAME], string2[256], count;
    for (new 
0MAX_PLAYERSi++) //foreach(new i : Player)
    
{
        if (
GetPlayerName(isendernamesizeof(sendername)) && PlayerInfo[i][Admin] >= 1)
        {
            
format(string2sizeof (string2), "%s{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d%s\n"string2sendernameiPlayerInfo[i][Admin], (IsPlayerAdmin(i)) ? (" {FFBF00}(RCON)") : (""));
            ++
count;
        }
    }
    if (
countShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_LIST"Admins Online"string2"Close""");
    else 
SendClientMessage(playerid0xFF0000FF"No admins online.");
    return 
1;

thx you !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)