SA-MP Forums Archive
[Ajuda] Trocar texto comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Trocar texto comando (/showthread.php?tid=595702)



Trocar texto comando - Andelux - 06.12.2015

Como que se faz pra mudar o comando por exemplo
/admins
ai aparecerб uma caixa de diбlogo
e como que faz pro mesmo comando nao ser diбlogo mas aparecer texto no chat do servidor

cуdigo do comando + dialog:

PHP код:
if(strcmp(cmd"/admins"true) == 0)
    {
        new 
str[1000], count 0;
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
admin[i])
                {
                    if(
pAdmin[i] == 1)
                    {
                        
format(strsizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[MOD]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrsizeof(string));
                    }
                    if(
pAdmin[i] == 2)
                    {
                        
format(strsizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[ADM]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrsizeof(string));
                    }
                    if(
pAdmin[i] == 3)
                    {
                        
format(strsizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[Chefe]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrsizeof(string));
                    }
                    if(
pAdmin[i] == 4)
                    {
                        
format(strsizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[Guardiгo]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrsizeof(string));
                    }
                    if(
pAdmin[i] == 5)
                    {
                        
format(strsizeof(str), "{FFFFFF}%s (%d) {FF0000}:: {FFFFFF}[Dono]\n"GetPlayerNameEx(i), i);
                        
strcat(stringstrsizeof(string));
                    }
                    
count++;
                }
            }
        }
        if(
count == 0)
        {
            
ShowPlayerDialog(playeridplayersimpDIALOG_STYLE_MSGBOX".:: - ADM's Online - ::.""{FF0000}Nгo hб ADM's online no momento.""OK""");
        }
        else
        {
            
ShowPlayerDialog(playeridplayersimpDIALOG_STYLE_MSGBOX".:: - ADM's Online - ::."string"OK""");
        }
        return 
1;
    } 
cуdigo dialog:

PHP код:
if(count == 0)
        {
            
ShowPlayerDialog(playeridplayersimpDIALOG_STYLE_MSGBOX".:: - ADM's Online - ::.""{FF0000}Nгo hб ADM's online no momento.""OK""");
        }
        else
        {
            
ShowPlayerDialog(playeridplayersimpDIALOG_STYLE_MSGBOX".:: - ADM's Online - ::."string"OK""");
        }
        return 
1;
    } 



Re: Trocar texto comando - BykiLler - 06.12.2015

to ligado nisso

Quote:

switch (padmin)
{
case 1:
{
}
case 2:
{

}
case 3:
{

}
case 4:
{

}
case 5:
{

}
}




Re: Trocar texto comando - Andelux - 06.12.2015

onde coloco isso? sou novato


Re: Trocar texto comando - BykiLler - 06.12.2015

Voce sabe formatar uma string ?


Re: Trocar texto comando - Andelux - 06.12.2015

nao !