[Ajuda] /Admins Bugado
#1

Bom , estava dando uma olhada em meu sistema de administraзao e reparei que tinha um bug em /admins
esta mostrando asssim : Nome do fulano [ID : Id do fulano] aqui o tipo de admin
ex : Fulano - [ID:0] - Level 1 [Aprendiz] (Esta parte esta Resolvida)

Pedido \/

pawn Код:
YCMD:admins(playerid, params[], help)
{
  if(IsPlayerConnected(playerid))
    {
        new STNG[300];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(P_Data[i][pAdmin] > 1)
                {
                        new admin[60];
                        if(P_Data[i][pAdmin] == 1){ admin = "[Level 1] - Beginner"; }
                        else if(P_Data[i][pAdmin] == 2) { admin = "[Level 2] - Smart"; }
                        else if(P_Data[i][pAdmin] == 3) { admin = "[Level 3] - Clever"; }
                        else if(P_Data[i][pAdmin] == 4) { admin = "[Level 4] - Expert"; }
                        else if(P_Data[i][pAdmin] == 5) { admin = "[Level 5] - Owner"; }
                        new SDNM[MAX_PLAYER_NAME];
                        GetPlayerName(i, SDNM, sizeof(SDNM));
                        format(STNG, 300, "%s {FF0000}- {5252FF}[ID:%d] {FF0000}- {FF0000}%s", SDNM, playerid, admin, i);
                }
            }
        }
        ShowPlayerDialog(playerid, 21323123, DIALOG_STYLE_LIST, "Admins Online:", STNG, "Close", "");
    }
    return 1;
}
Como eu posso colocar uma Dialog Msg Box , no caso de nao ter nenhum adm conectado ?
Reply
#2

ai amigo, vocк so inverteu algumas coisas: teste:
PHP код:
YCMD:ad(playeridparams[], help)
{
  if(
IsPlayerConnected(playerid))
    {
        new 
STNG[300];
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
P_Data[i][pAdmin] > 1)
                {
                        new 
admin[20];
                        if(
P_Data[i][pAdmin] == 1) { admin "[Level 1] Beginner"; }
                        else if(
P_Data[i][pAdmin] == 2) { admin "[Level 2] Smart"; }
                        else if(
P_Data[i][pAdmin] == 3) { admin "[Level 3] Clever"; }
                        else if(
P_Data[i][pAdmin] == 4) { admin "[Level 4] Expert"; }
                        else if(
P_Data[i][pAdmin] == 5) { admin "[Level 5] Owner"; }
                        new 
SDNM[MAX_PLAYER_NAME];
                        
GetPlayerName(iSDNMsizeof(SDNM));
                        
format(STNG300"%s - [ID:%d] - %s"SDNMiadmin);
                }
            }
        }
        
ShowPlayerDialog(playerid21323123DIALOG_STYLE_LIST"Admins Online:"STNG"Close""");
    }
    return 
1;

Ajudei? Da +Rep Jб Me Ajuda Tambйm.
Reply
#3

Quote:
Originally Posted by Patrick141
Посмотреть сообщение
PHP код:
format(STNG300"%s - [ID:%d] - [%s]"SDNMiadmin); 
vк ai se da certo...
Reply
#4

Opa eu vi agora mesmo ..... obrigado .... й poderia me ajudar ? como eu posso colocar uma dialog Msg Box , caso nao tenha nenhum adm online ?

Quote:

" Nao entendi esse i "

O "i" seria no caso de mostrar apenas os admins conectados.
Reply
#5

PHP код:
YCMD:ad(playeridparams[], help)
{
  if(
IsPlayerConnected(playerid))
    {
        new 
STNG[300];
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
P_Data[i][pAdmin] > 1)
                {
                        new 
admin[20];
                        if(
P_Data[i][pAdmin] == 1) { admin "[Level 1] Beginner"; }
                        else if(
P_Data[i][pAdmin] == 2) { admin "[Level 2] Smart"; }
                        else if(
P_Data[i][pAdmin] == 3) { admin "[Level 3] Clever"; }
                        else if(
P_Data[i][pAdmin] == 4) { admin "[Level 4] Expert"; }
                        else if(
P_Data[i][pAdmin] == 5) { admin "[Level 5] Owner"; }
                        new 
SDNM[MAX_PLAYER_NAME];
                        
GetPlayerName(iSDNMsizeof(SDNM));
                        
format(STNG300"%s - [ID:%d] - %s"SDNMiadmin);
                }
                else
                {
                
SendClientMessage(COR_Definida128"Nгo temos nenhum admin online no momento.");
                }
            }
        }
        
ShowPlayerDialog(playerid21323123DIALOG_STYLE_LIST"Admins Online:"STNG"Close""");
    }
    return 
1;

Tenta ae
Reply
#6

Agora o comando nao executa.
Reply
#7

Eu tava olhando o seu e o meu aqui, Nгo Consegui arrumar, mais vocк tem que fazer uma verificaзгo, vendo se hб admins on, se nгo houver, em vez dele abrir a dialog, ele irб apenas returnar a uma mensagem.
Reply
#8

PHP код:
YCMD:admins(playeridparams[], help)
{
    if(
IsPlayerConnected(playerid))
    {
        
        new 
STNG[300];
        for(new 
0MAX_PLAYERSi++)
        {
            
            if(
IsPlayerConnected(i))
            {
                
                if(
P_Data[i][pAdmin] > 1)
                {
                    
                    new 
admin[60];
                    if(
P_Data[i][pAdmin] == 1){ admin "[Level 1] - Beginner"; }
                    else if(
P_Data[i][pAdmin] == 2) { admin "[Level 2] - Smart"; }
                    else if(
P_Data[i][pAdmin] == 3) { admin "[Level 3] - Clever"; }
                    else if(
P_Data[i][pAdmin] == 4) { admin "[Level 4] - Expert"; }
                    else if(
P_Data[i][pAdmin] == 5) { admin "[Level 5] - Owner"; }
                    new 
SDNM[MAX_PLAYER_NAME];
                    
GetPlayerName(iSDNMsizeof(SDNM));
                    
format(STNG300"%s {FF0000}- {5252FF}[ID:%d] {FF0000}- {FF0000}%s"SDNMplayeridadmin);
                    
ShowPlayerDialog(playerid21323123DIALOG_STYLE_LIST"Admins Online:"STNG"Close""");
                }
                else
                {
                    
                    
ShowPlayerDialog(playerid21323123DIALOG_STYLE_LIST"Admins Online:""Nenhum Administrador Online neste momento.""Close""");
                }
            }
        }
    }
    return 
1;

Reply
#9

Saudaзхes !

PHP код:
YCMD:admins(playeridparams[], help)
{
    if(
IsPlayerConnected(playerid)){
        new 
box300 ];
        
        static
            
STNG[80],
            
bool:Count false
        
;
        
        for(new 
0GetMaxPlayers(); i++){
            if(
IsPlayerConnected(i)){
                if(
P_Data[i][pAdmin] > 0){
                    new 
admin25 ];
                    switch(
P_Data[i][pAdmin]){
                        case 
1admin "[Level 1] - Beginner";
                        case 
2admin "[Level 2] - Smart";
                        case 
3admin "[Level 3] - Clever";
                        case 
4admin "[Level 4] - Expert";
                        case 
5admin "[Level 5] - Owner";
                    }
                    
Count true;
                    new 
SDNM[MAX_PLAYER_NAME];
                    
GetPlayerName(iSDNMsizeof(SDNM));
                    
format(STNG300"%s {FF0000}- {5252FF}[ID:%d] {FF0000}- {FF0000}%s\n"SDNMiadmin);
                    
strcat(STNGbox);
                }
            }
        }
        if(!
Count == true)
            
ShowPlayerDialog(playerid21323123DIALOG_STYLE_MSGBOX"Admins Online:""{FF0000}Nгo hб Admins online no momento!""Close""");
        else
            
ShowPlayerDialog(playerid21323123DIALOG_STYLE_LIST"Admins Online:"box"Close""");
    }
    return 
true;

Reply
#10

Bom obrigado , por tentar me ajudar.

Dei uma boa pesquisada , e encontrei um /admins , e editei para que fique ao meu modo.
Porem , eu queria saber..... como eu posso colocar aquele pequena funзao anterior ? para que mostre o tipo de adm , do o comando que eu postei la no inicio ? ex : Fulano [ID:0] - [Level 1] - Beginner , pois neste comando mostra apenas o nome do Adm o ID e o Level
comando :
pawn Код:
YCMD:admins(playerid, params[], help)
{
new Adms[650];
new ADMsDialog[810];
new Name[MAX_PLAYER_NAME];
new level;
new admscount;
for(new i,a = GetMaxPlayers();i < a;i++)
{
    if(IsPlayerConnected(i))
    {
        if(P_Data[i][pAdmin] > 0)
        {
        if(P_Data[playerid][pAdmin] > 0)
            {
            level = P_Data[i][pAdmin];
            GetPlayerName(i, Name, sizeof(Name));
            if(admscount < 15) format(Adms, sizeof(Adms), "%s\n%s (%i) - [Level %i]", Adms,Name,i,level);
            admscount++;
            }
        }
    }
}
if(admscount > 0)
format(ADMsDialog, sizeof(ADMsDialog), "{FFFFFF}Total Administrators Online: {FFFF00}%i{FFFFFF}{09D19B}\n%s\n\n{FFFFFF}Use: /Report to Report any Player \nWho Broke the {FFFF00}/Rules", admscount,Adms);
else
format(ADMsDialog, sizeof(ADMsDialog), "{FF0000}Admins are Offline !\n\n{FFFFFF}If you see someone with Cheats, Take a \nPrint and Post them in our Forum", admscount,Adms);
ShowPlayerDialog(playerid,1003420,DIALOG_STYLE_MSGBOX,"Administrators Offline :",ADMsDialog,"Close", "");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)