SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 15/05/2018, 09:10 PM   #1
Arleann
Big Clucker
 
Arleann's Avatar
 
Join Date: Feb 2018
Location: Chapadinha-ma
Posts: 56
Reputation: 0
Post /admins em dialog

Bom pessoal eu criei esse sistema de ver os adm's onlines em dialog, mas na dialog quando a 6 ou mais adm's online so aparece 5 na dialog alguem sabe pq isso acontece?

PHP Code:

    
if(strcmp(cmd"/admins"true) == 0)
    {
        new 
count 0;
        new 
strcmd[1000];

        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
format(filesizeof(file), PASTA_ADMINSGetPlayerNameEx(i));
                if(
dini_Int(file"ALevel") == 7)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ DONO™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ DONO™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));

                    }
                }
                else if(
dini_Int(file"ALevel") == 6)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ SUB - DONO™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ SUB - DONO™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                }
                else if(
dini_Int(file"ALevel") == 5)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ GERENTE™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ GERENTE™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                }
                else if(
dini_Int(file"ALevel") == 4)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ ADMINISTRADOR™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ ADMINISTRADOR™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                }
                else if(
dini_Int(file"ALevel") == 3)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ SUB - ADMINISTRADOR™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ SUB - ADMINISTRADOR™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                }
                else if(
dini_Int(file"ALevel") == 2)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ AJUDANTE™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ AJUDANTE™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                }
                else if(
dini_Int(file"ALevel") == 1)
                {
                    if(
AFK[i] == 0)
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ AUXILIAR™ ]\t\t{00FF00}[ ON ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                    else
                    {
                        
format(strcmdsizeof(strcmd), "{828282}%s [ %d ]\t\t{00FF00}[ AUXILIAR™ ]\t\t{FF0000}[ OFF ]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrcmdsizeof(string));
                    }
                }
                
count++;
            }
        }
        if(
count == 0)
        {
            
ShowPlayerDialog(playeridplayersimpDIALOG_STYLE_MSGBOX"{FFFFFF}ADM's Online [ {FF0000}0{FFFFFF} ]""{FF0000}Não há menbros da Administração Online""OK""");
        }
        else
        {
            new 
msg[150],  strcount[1000];
            
format(msgsizeof(msg), "{FFFFFF}ADM's Online [ {00FF00}%d{FFFFFF} ]"count);
            
strcat(strcountmsgsizeof(strcount));

            
ShowPlayerDialog(playeridplayersimpDIALOG_STYLE_MSGBOXstrcountstring"OK""");
        }
        return 
1;
    } 
Agradeço a ajuda. Obrigado pela atenção.

================================================== ======

"Ainda vou ver muita gente se arrependendo pelo que me fez e falou. Hoje você me pisa,
amanhã eu te atropelo..."


Brasil Virtual World™ ® RPG: 192.95.23.88:7777
Arleann is offline   Reply With Quote
Old 15/05/2018, 11:35 PM   #2
DarkBr
Huge Clucker
 
Join Date: Feb 2017
Location: Principat de les Valls d'Andorra
Posts: 427
Reputation: 9
Default Re: /admins em dialog

Testa ai pra ver se funciona

Code:
if(strcmp(cmd, "/admins", true) == 0) 
    { 
        new count=0, strcmd[128], int_val, cargo[27], pstate[9], strdest[500];

        for(new j=GetPlayerPoolSize(),i; i!=j; ++i)
        { 
            if(IsPlayerConnected(i)) 
            { 
                format(file, sizeof(file), PASTA_ADMINS, GetPlayerNameEx(i));

                if(!fexist(file))
                	continue;

                count++;
                
                int_val = dini_Int(file, "ALevel");

                switch(int_val) {

                case 1:cargo="[ AUXILIAR™ ]";
                case 2:cargo="[ AJUDANTE™ ]";
                case 3:cargo="[ SUB - ADMINISTRADOR™ ]";
                case 4:cargo="[ ADMINISTRADOR™ ]";
                case 5:cargo="[ GERENTE™ ]";
                case 6:cargo="[ SUB - DONO™ ]";
                case 7:cargo="[ DONO™ ]";
            	}
                pstate=((AFK[i]==0)?("[ OFF ]"):("[ ON ]"));

                format(strcmd, sizeof strcmd, "{828282}%s [ %d ]\t\t{00FF00}%s\t\t{00FF00}%s", GetPlayerNameEx(i), i,cargo, pstate);
           		strcat(strdest, strcmd, sizeof strdest);
             
            } 
        } 
        if(!count) 
        { 
            ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, "{FFFFFF}ADM's Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Não há menbros da Administração Online", "OK", ""); 
        } 
        else 
        { 
            new msg[50];
            format(msg, sizeof(msg), "{FFFFFF}ADM's Online [ {00FF00}%d{FFFFFF} ]", count); 
        
            ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, msg, strdest, "OK", ""); 
        } 
        return 1; 
    }
DarkBr is offline   Reply With Quote
Old 16/05/2018, 11:16 PM   #3
Arleann
Big Clucker
 
Arleann's Avatar
 
Join Date: Feb 2018
Location: Chapadinha-ma
Posts: 56
Reputation: 0
Post Re: /admins em dialog

Quote:
Originally Posted by DarkBr View Post
Testa ai pra ver se funciona

Code:
if(strcmp(cmd, "/admins", true) == 0) 
    { 
        new count=0, strcmd[128], int_val, cargo[27], pstate[9], strdest[500];

        for(new j=GetPlayerPoolSize(),i; i!=j; ++i)
        { 
            if(IsPlayerConnected(i)) 
            { 
                format(file, sizeof(file), PASTA_ADMINS, GetPlayerNameEx(i));

                if(!fexist(file))
                	continue;

                count++;
                
                int_val = dini_Int(file, "ALevel");

                switch(int_val) {

                case 1:cargo="[ AUXILIAR™ ]";
                case 2:cargo="[ AJUDANTE™ ]";
                case 3:cargo="[ SUB - ADMINISTRADOR™ ]";
                case 4:cargo="[ ADMINISTRADOR™ ]";
                case 5:cargo="[ GERENTE™ ]";
                case 6:cargo="[ SUB - DONO™ ]";
                case 7:cargo="[ DONO™ ]";
            	}
                pstate=((AFK[i]==0)?("[ OFF ]"):("[ ON ]"));

                format(strcmd, sizeof strcmd, "{828282}%s [ %d ]\t\t{00FF00}%s\t\t{00FF00}%s", GetPlayerNameEx(i), i,cargo, pstate);
           		strcat(strdest, strcmd, sizeof strdest);
             
            } 
        } 
        if(!count) 
        { 
            ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, "{FFFFFF}ADM's Online [ {FF0000}0{FFFFFF} ]", "{FF0000}Não há menbros da Administração Online", "OK", ""); 
        } 
        else 
        { 
            new msg[50];
            format(msg, sizeof(msg), "{FFFFFF}ADM's Online [ {00FF00}%d{FFFFFF} ]", count); 
        
            ShowPlayerDialog(playerid, playersimp, DIALOG_STYLE_MSGBOX, msg, strdest, "OK", ""); 
        } 
        return 1; 
    }
deu esse erro:

Code:
C:\Users\ARLEAN\Desktop\Brasil Virtual World\gamemodes\B.V.W.pwn(14487) : error 017: undefined symbol "GetPlayerPoolSize"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Arleann is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Admins em Dialog /Admins GuiKommander Português/Portuguese 15 08/01/2017 04:35 PM
/admins dialog help JawsPlus Scripting Help 7 08/11/2014 12:35 PM
Online admins dialog /admins help please. SilentSoul Scripting Help 8 28/08/2013 08:33 PM
Admins Dialog? JimmyNeonHD Scripting Help 5 08/03/2013 04:12 PM
/admins dialog Total online admins do help:( y@sin1 Scripting Help 10 14/01/2012 03:58 PM


All times are GMT. The time now is 05:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.