[Ajuda] Comando bugado
#1

Sempre que digito /admins, os nomes dos adms vгo se multiplicando oO

Codigo:

pawn Код:
CMD:admins(playerid) {

    new str[500], count = 0;

    for(new targetid = 0; targetid < MAX_PLAYERS; targetid++)
    {
        if(IsPlayerConnected(targetid))
        {
            if(gPlayerInfo[targetid][playerAdmin] > 0)
            {
                format(str, sizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[%s]\n", gPlayerInfo[targetid][playerName], targetid, GetLevelAdminName(gPlayerInfo[targetid][playerAdmin]));
                strcat(string2, str, sizeof(string2));
            }
            count++;
        }
    }
    if(count == 0)
    {
        ShowPlayerDialog(playerid, dialogadm, DIALOG_STYLE_MSGBOX, ".:: - ADM's Online - ::.", "{FF0000}Nгo hб ADM's online no momento.", "OK", "");
    }
    else
    {
        ShowPlayerDialog(playerid, dialogadm, DIALOG_STYLE_MSGBOX, ".:: - ADM's Online - ::.", string2, "OK", "");
    }
    return true;
}
Reply
#2

pawn Код:
CMD:admins(playerid)
{
    new str[50], string2[500], count = 0;
    for(new i = 0, j = GetMaxPlayers(); i < j; ++i)
    {
        if(IsPlayerConnected(i))
        {
            if(gPlayerInfo[i][playerAdmin] > 0)
            {
                format(str, sizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[%s]\n", gPlayerInfo[targetid][playerName], targetid, GetLevelAdminName(gPlayerInfo[targetid][playerAdmin]));
                strcat(string2, str);
                count ++;
            }
        }
    }
    if(count == 0)
    {
        ShowPlayerDialog(playerid, dialogadm, DIALOG_STYLE_MSGBOX, ".:: - ADM's Online - ::.", "{FF0000}Nгo hб ADM's online no momento.", "OK", "");
    }
    else
    {
        ShowPlayerDialog(playerid, dialogadm, DIALOG_STYLE_MSGBOX, ".:: - ADM's Online - ::.", string2, "OK", "");
    }
    return 1;
}
Reply
#3

Funcionou, rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)