[Ajuda] Erro Comando
#1

Eae galera, seguinte, alterei um comando de /setprof pra /setbope, ou seja, comando apenas pra seta a profissгo do bope, segue o comando:
PHP код:
if(strcmp(cmd, "/setbope", true) == 0)
    {
        
format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(
dini_Int(file, "aAdmin") == 5)
        {
            new 
plid, prof;
            if(
sscanf(cmdtext, "s[9]ud", cmd, plid, prof))
            {
                
SendClientMessage(playerid, Vermelho, "Digite: /setbope [id] [8]");
                return 
1;
            }
            if(
IsPlayerConnected(plid))
            {
                if(
prof > 7 && prof < 9)
                {
                    if(
pAdmin[playerid] != 5)
                    {
                        
SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo para setar esta profissaх.");
                        return 
1;
                    }
                }
                
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
                
dini_IntSet(file2, "Profissao", prof);
                
SpawnPlayer(plid);
                
format(string, sizeof(string), "%s te alistou pro BOPE", GetPlayerNameEx(playerid), playerid, prof);
                
SendClientMessage(plid, tcadm, string);
                
format(string, sizeof(string), "Vocк alistou %s para o BOPE", GetPlayerNameEx(plid), plid, prof);
                
SendClientMessage(playerid, Blue, string);
            }
            else
            {
                
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado.");
            }
        }
        else
        {
            
SendClientMessage(playerid, Vermelho, "Vocк nгo й o lнder do BOPE!");
        }
        return 
1;
    } 
Porйm in-game sу fica "VOCК NГO Й LНDER DO BOPE", n sei onde eu errei, se alguйm poder me ajudar aew agradeзo..

OBS: O ID do bope й 8.
Reply
#2

vocк tem que ser admin level 5 para setar cmd /setbope [playerid]
PHP код:
    if(strcmp(cmd, "/setbope", true) == 0)
    {
        
format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(
dini_Int(file, "aAdmin") == 5)
        {
            new 
plid;

            if(
sscanf(cmdtext, "d", plid))
            return 
SendClientMessage(playerid, Vermelho, "Digite: /setbope [id]");

            if(!
IsPlayerConnected(plid))
            return  
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado.");

            
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
               
dini_IntSet(file2, "Profissao", 8);
              
SpawnPlayer(plid);

            
format(string, sizeof(string), "%s te alistou pro BOPE", GetPlayerNameEx(playerid));
               
SendClientMessage(plid, tcadm, string);

            
format(string, sizeof(string), "Vocк alistou %s para o BOPE", GetPlayerNameEx(plid));
               
SendClientMessage(playerid, Blue, string);
        }
        else
        {
            
SendClientMessage(playerid, Vermelho, "Vocк nгo й o lнder do BOPE!");
        }
        return 
1;
    } 
Reply
#3

Quote:
Originally Posted by Whoo
Посмотреть сообщение
vocк tem que ser admin level 5 para setar cmd /setbope [playerid]
PHP код:
    if(strcmp(cmd, "/setbope", true) == 0)
    {
        
format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
        if(
dini_Int(file, "aAdmin") == 5)
        {
            new 
plid;
            if(
sscanf(cmdtext, "d", plid))
            return 
SendClientMessage(playerid, Vermelho, "Digite: /setbope [id]");
            if(!
IsPlayerConnected(plid))
            return  
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado.");
            
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
               
dini_IntSet(file2, "Profissao", 8);
              
SpawnPlayer(plid);
            
format(string, sizeof(string), "%s te alistou pro BOPE", GetPlayerNameEx(playerid));
               
SendClientMessage(plid, tcadm, string);
            
format(string, sizeof(string), "Vocк alistou %s para o BOPE", GetPlayerNameEx(plid));
               
SendClientMessage(playerid, Blue, string);
        }
        else
        {
            
SendClientMessage(playerid, Vermelho, "Vocк nгo й o lнder do BOPE!");
        }
        return 
1;
    } 
Nгo pegou man..
Reply
#4

nгo ? qual foi o problema
Reply
#5

Ao invйs de formatar e pegar o valor:
Quote:

if(dini_Int(file, "aAdmin") == 5)

Por que nгo pega diretamente da variбvel? ou vai dizer q o servidor n tem variavel?
Quote:

if(pAdmin[playerid] == 5)

Reply
#6

Continuou a mesma coisa..
"Vocк nгo й lнder do BOPE" '-'
Reply
#7

Quote:
Originally Posted by MaTheuSs
Посмотреть сообщение
Continuou a mesma coisa..
"Vocк nгo й lнder do BOPE" '-'
tente como ele disse

PHP код:
if(strcmp(cmd, "/setbope", true) == 0)
{
    
    
format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
    if(
pAdmin[playerid] == 5)
    {
        
        new 
plid;
        if(
sscanf(cmdtext, "d", plid))
        return 
SendClientMessage(playerid, Vermelho, "Digite: /setbope [id]");
        if(!
IsPlayerConnected(plid))
        return  
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado.");
        
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
        
dini_IntSet(file2, "Profissao", 8);
        
SpawnPlayer(plid);
        
format(string, sizeof(string), "%s te alistou pro BOPE", GetPlayerNameEx(playerid));
        
SendClientMessage(plid, tcadm, string);
        
format(string, sizeof(string), "Vocк alistou %s para o BOPE", GetPlayerNameEx(plid));
        
SendClientMessage(playerid, Blue, string);
    }
    else
    {
        
        
SendClientMessage(playerid, Vermelho, "Vocк nгo й o lнder do BOPE!");
    }
    return 
1;
} 
Reply
#8

Consegui, +rep pra vocкs dois, valeu mesmo mano, agora posso criar meu sistema.
Reply
#9

Quote:
Originally Posted by Whoo
Посмотреть сообщение
tente como ele disse

PHP код:
if(strcmp(cmd, "/setbope", true) == 0)
{
    
    
format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(playerid));
    if(
pAdmin[playerid] == 5)
    {
        
        new 
plid;
        if(
sscanf(cmdtext, "d", plid))
        return 
SendClientMessage(playerid, Vermelho, "Digite: /setbope [id]");
        if(!
IsPlayerConnected(plid))
        return  
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado.");
        
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid));
        
dini_IntSet(file2, "Profissao", 8);
        
SpawnPlayer(plid);
        
format(string, sizeof(string), "%s te alistou pro BOPE", GetPlayerNameEx(playerid));
        
SendClientMessage(plid, tcadm, string);
        
format(string, sizeof(string), "Vocк alistou %s para o BOPE", GetPlayerNameEx(plid));
        
SendClientMessage(playerid, Blue, string);
    }
    else
    {
        
        
SendClientMessage(playerid, Vermelho, "Vocк nгo й o lнder do BOPE!");
    }
    return 
1;
} 
Vocк usou a minha vбriavel de exemplo, se ele n souber aplicar no GM a variбvelvai dar erro...

Segue:

topo do GM
PHP код:
new pAdmin[MAX_PLAYERS]; 
Comando /setbope
PHP код:
if(strcmp(cmd, "/setbope", true) == 0) 
{ 
    if(
pAdmin[playerid] == 5) 
    { 
         
        new 
plid; 
        if(
sscanf(cmdtext, "d", plid)) 
        return 
SendClientMessage(playerid, Vermelho, "Digite: /setbope [id]"); 
        if(!
IsPlayerConnected(plid)) 
        return  
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado."); 
        
format(file2, sizeof(file2), PASTA_CONTAS, GetPlayerNameEx(plid)); 
        
dini_IntSet(file2, "Profissao", 8); 
        
SpawnPlayer(plid); 
        
format(string, sizeof(string), "%s te alistou pro BOPE", GetPlayerNameEx(playerid)); 
        
SendClientMessage(plid, tcadm, string); 
        
format(string, sizeof(string), "Vocк alistou %s para o BOPE", GetPlayerNameEx(plid)); 
        
SendClientMessage(playerid, Blue, string); 
    } 
    else 
    { 
         
        
SendClientMessage(playerid, Vermelho, "Vocк nгo й o lнder do BOPE!"); 
    } 
    return 
1; 
} 
comando setar admin com a variбvel:
PHP код:
if(strcmp(cmd, "/setadmin", true) == 0) 
{ 
    new 
Target, Level;
    if(
pAdmin[playerid] == 5) 
    { 
        if(
sscanf(cmdtext, "ui", Target, Level)) 
        return 
SendClientMessage(playerid, Vermelho, "Digite: /setadmin [id] [level]"); 
        if(!
IsPlayerConnected(plid)) 
        return  
SendClientMessage(playerid, Vermelho, "Jogador nгo conectado."); 
        
format(file, sizeof(file), PASTA_CONTAS, GetPlayerNameEx(Target)); 
        
dini_IntSet(file2, "aAdmin", Level);
        
pAdmin[Target] = Level;
        
format(string, sizeof(string), "Admin %s setou o level de %s para %i", GetPlayerNameEx(playerid),
GetPlayerNameEx(Target), Level); 
        
SendClientMessage(playerid, Blue, string); 
    } 
    else 
    { 
         
        
SendClientMessage(playerid, Vermelho, "Vocк nгo й um ADMIN level 5!"); 
    } 
    return 
1; 
} 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)