[Ajuda] Comando /PROCURADOS
#1

Galera quando eu digito /procurados sу mostra 1, queria que mostra-se todos os procurados do servidor, jб fiz de tudo mas nгo sei oque й.

PHP код:
CMD:procurados(playerid, params[])
{
    new 
contar;
    
SendClientMessage(playerid, 0x00BFFAA, "[SERVER]:{E8E8E8} Vocк abriu o menu de procurados.");
    foreach(new 
i : Player)
    {
        if(
Warlley[i][pProcurado] >= 1)
        {
        
    new 
city[64] = "Nгo identificado";
    switch(
GetPlayerCity(iddele))
    {
        case 
CITY_LS: city = "Los Santos";
        case 
CITY_SF: city = "San Fierro";
        case 
CITY_LV: city = "Las Venturas";
    }
    
contar ++;
    
format(WarlleyS, sizeof WarlleyS, "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{%h}%s{E8E8E8}[ID: %d]\t\t{FFD700}%d\t\t{E8E8E8}%s\n", GetPlayerColor(i) >>> 8, getPName(i), playerid, Warlley[i][pProcurado], city);
    
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", WarlleyS, "Fechar", "");
        }
    }
    if(!
contar)
        
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{E8E8E8} Nгo tem nenhum procurado online\n", "Fechar", "");
    return 
true;
} 
Reply
#2

Mostra todos os /procurados em dialog
Reply
#3

PHP код:
CMD:procurados(playerid, params[]) 
{ 
    new 
contar; 
    
SendClientMessage(playerid, 0x00BFFAA, "[SERVER]:{E8E8E8} Vocк abriu o menu de procurados."); 

    foreach(
Player, i) 
    { 
        if(
Warlley[i][pProcurado] >= 1) 
        { 
         
    new 
city[64] = "Nгo identificado"; 
    switch(
GetPlayerCity(iddele)) 
    { 
        case 
CITY_LS: city = "Los Santos"; 
        case 
CITY_SF: city = "San Fierro"; 
        case 
CITY_LV: city = "Las Venturas"; 
    } 
    
contar ++; 
    
format(WarlleyS, sizeof WarlleyS, "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{%h}%s{E8E8E8}[ID: %d]\t\t{FFD700}%d\t\t{E8E8E8}%s\n", GetPlayerColor(i) >>> 8, getPName(i), playerid, Warlley[i][pProcurado], city); 
    
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", WarlleyS, "Fechar", ""); 
        } 
    } 
    if(!
contar) 
        
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{E8E8E8} Nгo tem nenhum procurado online\n", "Fechar", ""); 

    return 
true; 
} 
Reply
#4

Nгo deu certo
Reply
#5

troque

PHP код:
format(WarlleyS, sizeof WarlleyS," 
por

PHP код:
format(WarlleyS, 100, " 
o problema й que a string que й usada neste caso precisa ser zerada, vocк pode mudar nessa parte adicionando 100 celulas ou na parte da String

PHP код:
new str[0]= EOS; 
Reply
#6

Tente agr.
PHP код:
CMD:procurados(playerid, params[])
{
    new 
contar;
    
SendClientMessage(playerid, 0x00BFFAA, "[SERVER]:{E8E8E8} Vocк abriu o menu de procurados.");

    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        if(
Warlley[i][pProcurado] >= 1)
        {

    new 
city[64] = "Nгo identificado";
    switch(
GetPlayerCity(iddele))
    {
        case 
CITY_LS: city = "Los Santos";
        case 
CITY_SF: city = "San Fierro";
        case 
CITY_LV: city = "Las Venturas";
    }
    
contar ++;
    
format(WarlleyS, sizeof WarlleyS, "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{%h}%s{E8E8E8}[ID: %d]\t\t{FFD700}%d\t\t{E8E8E8}%s\n", GetPlayerColor(i) >>> 8, getPName(i), playerid, Warlley[i][pProcurado], city);
    
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", WarlleyS, "Fechar", "");
        }
    }
    if(!
contar)
        
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{E8E8E8} Nгo tem nenhum procurado online\n", "Fechar", "");

    return 
true;
} 
Reply
#7

Quote:
Originally Posted by DarkBr
Посмотреть сообщение
troque

PHP код:
format(WarlleyS, sizeof WarlleyS," 
por

PHP код:
format(WarlleyS, 100, " 
o problema й que a string que й usada neste caso precisa ser zerada, vocк pode mudar nessa parte adicionando 100 celulas ou na parte da String

PHP код:
new str[0]= EOS; 
Vamos lб:

Isso nгo faz sentido, considerando que o tamanho da string deverб ser menor ou, como na maioria das vezes, igual ao da variбvel...
Quote:
Originally Posted by DarkBr
Посмотреть сообщение
PHP код:
format(WarlleyS, 100, " 
Vocк estб criando uma variбvel, e por ela nгo ser estбtica nгo hб necessidade de tornб-la nula, jб que ao ser criada automaticamente seu valor й nulo.
Quote:
Originally Posted by DarkBr
Посмотреть сообщение
PHP код:
new str[0]= EOS; 
Reply
#8

Nгo pegou nenhum, valeu, vou ir tentando aqui, se alguйm conseguir me ajuda aqui
Reply
#9

PHP код:
CMD:procurados(playerid, params[])
{
    new 
contar, strdialog[128];
    
SendClientMessage(playerid, 0x00BFFAA, "[SERVER]:{E8E8E8} Vocк abriu o menu de procurados.");
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        if(
Warlley[i][pProcurado] >= 1)
        {
            new 
city[64] = "Nгo identificado";
            switch(
GetPlayerCity(i))
            {
                case 
CITY_LS: city = "Los Santos";
                case 
CITY_SF: city = "San Fierro";
                case 
CITY_LV: city = "Las Venturas";
            }
            
contar ++;
            
format(strdialog, sizeof(strdialog), "%s{%h}%s{E8E8E8}[ID: %d]\t\t{FFD700}%d\t\t{E8E8E8}%s\n", strdialog, GetPlayerColor(i) >>> 8, getPName(i), playerid, Warlley[i][pProcurado], city);
         }
    }
    
format(WarlleyS, sizeof(WarlleyS), "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n%s", strdialog);
    
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", WarlleyS, "Fechar", "");
    return 
1;
} 
Teste e qualquer erro me avise
Reply
#10

PHP код:
CMD:procurados(playerid) 
{ 
    new 
contar; 
    
SendClientMessage(playerid, 0x00BFFAA, "[SERVER]:{E8E8E8} Vocк abriu o menu de procurados."); 
    foreach(new 
i : Player) 
    { 
        if(
Warlley[i][pProcurado] >= 1) 
        { 
         
            new 
city[64] = "Nгo identificado"; 
            switch(
GetPlayerCity(i)) 
            { 
                case 
CITY_LS: city = "Los Santos"; 
                case 
CITY_SF: city = "San Fierro"; 
                case 
CITY_LV: city = "Las Venturas"; 
            } 
            
contar ++; 
            
format(WarlleyS, sizeof WarlleyS, "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{%h}%s{E8E8E8}[ID: %d]\t\t{FFD700}%d\t\t{E8E8E8}%s\n", GetPlayerColor(i) >>> 8, getPName(i), i, Warlley[i][pProcurado], city); 
            
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", WarlleyS, "Fechar", ""); 
        } 
    } 
    if(!
contar) 
    
ShowPlayerDialog(playerid, DIALOG_PROCURADOS, DIALOG_STYLE_TABLIST_HEADERS, "{CC0000}Todos os procurados:", "{E8E8E8}Nick:\t\t{FFD700}Nнvel de Procura:\t\t{E8E8E8}Localizaзгo:\n\n{E8E8E8} Nгo tem nenhum procurado online\n", "Fechar", "");
    return 
true; 
} 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)