[Ajuda] Admins
#1

pawn Код:
CMD:admins(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerName(i,nome,sizeof(nome));
if(pInfo[i][adm] > 0)
{
format(String,sizeof(String),"%s = %s",nome,admins(i));
}
}
ShowPlayerDialog(playerid,982,DIALOG_STYLE_MSGBOX ,"Administradores Online",String,"Ok","");
return true;
}
Como faz para quando nгo tiver admin online,mandar a mensagem "Nгo tem administradores on" ?
Reply
#2

Nem testei criei agora mas tenta ae
pawn Код:
CMD:admins(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(pInfo[i][adm] > 0)
        {
            new String[256];
            new Name[100];
            GetPlayerName(i, Name, sizeof(Name));
            format(String,sizeof(String),"Administrador: %s",Name);
            ShowPlayerDialog(playerid,982,DIALOG_STYLE_MSGBOX ,"Administradores Online",String,"Ok","");
        }
        else
        {
            SendClientMessage(playerid,-1,"Nenhum administrador online.");
            return 0;
        }
    }
    return true;
}
Reply
#3

Tente:

pawn Код:
CMD:admins(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        GetPlayerName(i,nome,sizeof(nome));
        if(pInfo[i][adm] > 0)
        {
            format(String,sizeof(String),"%s = %s",nome,admins(i));
        }
    }
    ShowPlayerDialog(playerid,982,DIALOG_STYLE_MSGBOX ,"Administradores Online",String,"Ok","");
    return true;
}
if(!result)
        return SendClientMessage(playerid, -1,"Nгo hб administradores online neste momento!");
    return true;
}
return 0;
}

*To sem pawno rs fiz no bloco de notas mesmo.
Reply
#4

pawn Код:
CMD:admins(playerid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        GetPlayerName(i,nome,sizeof(nome));
        if(pInfo[i][adm] > 0)
        {
            format(String,sizeof(String),"%s = %s",nome,admins(i));
        }
    }
    if(strlen(String) > 0)
    {
        ShowPlayerDialog(playerid,982,DIALOG_STYLE_MSGBOX ,"Administradores Online",String,"Ok","");
    }
    else
        SendClientMessage(playerid, 0xFF0000FF, "Nгo tem administradores online");
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)