[Ajuda] parametros em zcmd!
#1

Gostaria de saber como faz comandos com parametros, como por exemplo!
PHP код:
CMD:setar[ajudante/moderador/corregedor/Admin/Master
Lembrando nгo estou pedindo pra fazerem pra mim, mas sim para me ensinar!
THANKS!
Reply
#2

Simples, vou dar um exemplo. Vocк vai precisar da include sscanf2!
O comando que irei fazer irб ser /msg (ID), irб enviar uma mensagem pro ID que foi escrito no comando.
PHP код:
CMD:msg(playeridparams[])//Vocк define com o "params[]" que o comando usarб parвmetros.
{
      new 
id;//Criar variбvel para armazenar o ID do player.
      
if(sscanf(params"u"ID)) return SendClientMessage(playerid, -1"Use: /msg (ID)"); //Verifica se o comando teve algum parвmetro digitado.
      
SendClientMessage(ID, -1"Olб jogador"); //Irб enviar a mensagem para o jogador que vocк digitou o parвmetro.
       
return 1;

No "if(params(....)" veja que eu usei o "u" mas nem sempre vocк deverб usa-lo! Leia esse tуpico que irб dar as informaзхes necessбrias: https://sampforum.blast.hk/showthread.php?tid=277842
Reply
#3

PHP код:
CMD:helloworld(playerid//quando nгo tem parametros, usa assim
{
    
SendClientMessage(playerid, -1"OIEE");
    return 
1;
}
CMD:setar(playeridparams[]) // quando tem parametros, usa assim
{
    
// comando de apenas um parametro (TEXTO):
    
if(isnull(params)) return SendClientMessage(playerid, -1"Uso correto: /Setar [Cargo]");
    
//isnull => verifica se o params (parametros) й nulo. ou seja, se o jogador digitou nada como parametro
    
if(strcmp(params"ajudante"true) == 0)
    {
        
PlayerInfo[playerid][pAdmin] =  1;
    }
    else if(
strcmp(params"moderador"true) == 0)
    {
        
PlayerInfo[playerid][pAdmin] = 2;
        
    }
    
// por aн vai..
    
else return SendClientMessage(playerid, -1"Cargo incorreto!");
    
SendClientMessage(playerid, -1"Cargo setado com sucesso!");
    return 
1;
}
CMD:numero(playeridparams[])
{
    
//comando de apenas um parametro (NЪMERO)
    
if(isnull(params)) return SendClientMessage(playerid, -1"Uso correto: /Numero [1-10]");
    new 
strval(params); // converte de string para inteiro
    
if(|| 10) return SendClientMessage(playerid, -1"De 1 a 10, parзa!"); // caso o jogador digite um nъmero menor que 1 ou maior que 10
    
new str[30];
    
format(strsizeof(str), "Escolheu o nъmero %d"n); //formata a mensagem, obtendo o valor de n
    
SendClientMessage(playerid, -1str); // exibe a mensagem
    
return 1;
}
/* Para mais que um parametro, й recomendado o uso do plugin/include sscanf, pois facilita muito
a versгo mais atualizada usa plugin, mas existe outra que nгo precisa ...
Em sscanf, vocк irб usar "s" para texto, "d"/"i" para inteiros, "f" para float, como jб se utiliza no "format"
O de diferente aqui vai ser o "u" para jogadores
OBS: eu ia pegar link de tуpicos de tutoriais e do download, mas tб difнcil esse fуrum hoje */
CMD:daradm(playeridparams[])
{
    new 
jogadornivel// cria variбveis onde serгo armazenados o jogador e o nivel de adm
    
if(sscanf(params"ud"jogadornivel)) return SendClientMessage(playerid, -1"Uso correto: /DarAdm [Jogador] [Nivel]"); // verifica se foram digitados os parametros exigidos
    /* na linha acima vc, basicamente, divide a string "params" em 2 coisas..
    u => й pra vc poder usar tanto ID quanto parte do nick / nick completo
    d => usado para inteiros (neste caso, o nнvel de adm)..
    repare que tem que estar na respectiva ordem..
    se o comando fosse /daradm [nivel] [jogador]
    seria: if(sscanf(params, "du", nivel, jogador)) ... */
    
PlayerInfo[jogador][pAdmin] = nivel;  // atribui ao jogador escolhido o nнvel escolhido de admin
    
return 1;
}
CMD:kick(playeridparams[])
{
    new 
jogadormotivo[30]; // cria variбveis onde serгo armazenados o jogador e o motivo do kick
    
if(sscanf(params"us[30]"jogadormotivo)) return SendClientMessage(playerid, -1"Uso correto: /Kick [Jogador] [Motivo]"); // verifica se foram digitados os parametros exigidos
    /* aqui o "params" tbm й dividido em 2 coisas..
    u => jб vimos acima
    s => usado para textos
    quando se usa "s", ou seja, string, no sscanf2, vc deve sempre colocar o "tamanho" em seguida
    */
    
new str[90];
    
format(strsizeof(str), "%s foi kickado por %s. Motivo: %s"PlayerName(jogador), PlayerName(playerid), motivo); // formata a mensagem com o nome do jogador, do adm e o motivo do kick
    
SendClientMessageToAll(-1str); // envia a mensagem para todos
    
    
Kick(jogador); // kicka o jogador escolhido
    
return 1;
}
/*
e por aн vai.... se vc quisesse um comando com mais parametros, й sу adicionar a variбvel e o seu especificador (s, d, u, i, f, etc)
exemplo: /banir [jogador] [dias] [motivo]
temos 3 parвmetros
1 u
1 inteiro (d, i)
1 string (s)
vamos criar a variбvel de cada parametro:
new jogador, dias, motivo[30];
if(sscanf(params, "uds[30]", jogador, dias, motivo)) return SendClientMessage...
*/
PlayerName(playerid)
{
    new 
nome[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnomesizeof(nome));
    return 
nome;

Galera.. O fуrum tambйm estб horrнvel pra vocкs? Misericуrdia. Tб foda!
Reply
#4

Perdao, acho q defini errado, sabe e parametros mesmos, tipo por exemplo:
PHP код:
vou usar um exemplo de cmdcomo o /telefone [ligar/sms], quando eu digita-se ambos comandos aconteceria difirentevou mandar um exemplo em strcmpesse comando foi pega da BMO(brasil mundo online),
    if(!
strcmp(cmd"/setar"true))
    {
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        if(
BMO_GetInt(f(playerid), "AdminL") == 0)
        {
            return 
SendClientMessage(playerid0xFF5E35FF"Este Comando nгo Existe [MUDAISSO] !");
        }
        
tmp strtok(cmdtextidx);
          if(!
strlen(tmp))
          {
              
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [dono/admin/mod/ajud/correg] [ID]");
            return 
1;
        }
        else if(!
strcmp(tmp"dono"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [dono] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
            if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][AdminL] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) dono(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й um dos novos donos do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "AdminL"1);
                
BMO_SaveFile();
                
aInfo[id][AdminL] = 1;
            }
            else if(
aInfo[id][AdminL] == 1)
            {
                 
format(gstringsizeof(gstring), "Vocк removeu %s da lideranзa do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da lideranзa do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "AdminL"0);
                
BMO_SaveFile();
                
aInfo[id][AdminL] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"admin"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [admin] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
            if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Admin] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) administrador(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) administrador(a) do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Administrador"1);
                
BMO_SaveFile();
                
aInfo[id][Admin] = 1;
            }
            else if(
aInfo[id][Admin] == 1)
            {
                 
format(gstringsizeof(gstring), "Vocк removeu %s da administraзгo do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da administraзгo do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Administrador"0);
                
BMO_SaveFile();
                
aInfo[id][Admin] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"mod"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [mod] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
               if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Moderador] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) moderador(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) moderador(a) do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Moderador"1);
                
BMO_SaveFile();
                
aInfo[id][Moderador] = 1;
            }
            else if(
aInfo[id][Moderador] == 1)
            {
                   
format(gstringsizeof(gstring), "Vocк removeu %s da moderaзгo do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da moderaзгo do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Moderador"0);
                
BMO_SaveFile();
                
aInfo[id][Moderador] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"ajud"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [ajud] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
               if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Ajudante] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) ajudante."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) ajudante do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Ajudante"1);
                
BMO_SaveFile();
                
aInfo[id][Ajudante] = 1;
            }
            else if(
aInfo[id][Ajudante] == 1)
            {
                   
format(gstringsizeof(gstring), "Vocк removeu %s do cargo de ajudante."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou o cargo de ajudante."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Ajudante"0);
                
BMO_SaveFile();
                
aInfo[id][Ajudante] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"correg"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [correg] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
               if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Corregedor] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) corregedor(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) corregedor(a) do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Corregedor"1);
                
BMO_SaveFile();
                
aInfo[id][Corregedor] = 1;
            }
            else if(
aInfo[id][Corregedor] == 1)
            {
                   
format(gstringsizeof(gstring), "Vocк removeu %s da corregedoria do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da corregedoria do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Corregedor"0);
                
BMO_SaveFile();
                
aInfo[id][Corregedor] = 0;
            }
            return 
1;
        }
        return 
1;
    } 
teria como fazer esse comando, por exemplo, em zcmd, com parametros diferentes!
Reply
#5

Quote:
Originally Posted by vitinhosamp
Посмотреть сообщение
Perdao, acho q defini errado, sabe e parametros mesmos, tipo por exemplo:
PHP код:
vou usar um exemplo de cmdcomo o /telefone [ligar/sms], quando eu digita-se ambos comandos aconteceria difirentevou mandar um exemplo em strcmpesse comando foi pega da BMO(brasil mundo online),
    if(!
strcmp(cmd"/setar"true))
    {
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        if(
BMO_GetInt(f(playerid), "AdminL") == 0)
        {
            return 
SendClientMessage(playerid0xFF5E35FF"Este Comando nгo Existe [MUDAISSO] !");
        }
        
tmp strtok(cmdtextidx);
          if(!
strlen(tmp))
          {
              
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [dono/admin/mod/ajud/correg] [ID]");
            return 
1;
        }
        else if(!
strcmp(tmp"dono"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [dono] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
            if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][AdminL] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) dono(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й um dos novos donos do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "AdminL"1);
                
BMO_SaveFile();
                
aInfo[id][AdminL] = 1;
            }
            else if(
aInfo[id][AdminL] == 1)
            {
                 
format(gstringsizeof(gstring), "Vocк removeu %s da lideranзa do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da lideranзa do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "AdminL"0);
                
BMO_SaveFile();
                
aInfo[id][AdminL] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"admin"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [admin] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
            if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Admin] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) administrador(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) administrador(a) do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Administrador"1);
                
BMO_SaveFile();
                
aInfo[id][Admin] = 1;
            }
            else if(
aInfo[id][Admin] == 1)
            {
                 
format(gstringsizeof(gstring), "Vocк removeu %s da administraзгo do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da administraзгo do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Administrador"0);
                
BMO_SaveFile();
                
aInfo[id][Admin] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"mod"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [mod] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
               if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Moderador] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) moderador(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) moderador(a) do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Moderador"1);
                
BMO_SaveFile();
                
aInfo[id][Moderador] = 1;
            }
            else if(
aInfo[id][Moderador] == 1)
            {
                   
format(gstringsizeof(gstring), "Vocк removeu %s da moderaзгo do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da moderaзгo do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Moderador"0);
                
BMO_SaveFile();
                
aInfo[id][Moderador] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"ajud"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [ajud] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
               if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Ajudante] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) ajudante."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) ajudante do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Ajudante"1);
                
BMO_SaveFile();
                
aInfo[id][Ajudante] = 1;
            }
            else if(
aInfo[id][Ajudante] == 1)
            {
                   
format(gstringsizeof(gstring), "Vocк removeu %s do cargo de ajudante."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou o cargo de ajudante."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Ajudante"0);
                
BMO_SaveFile();
                
aInfo[id][Ajudante] = 0;
            }
            return 
1;
        }
        else if(!
strcmp(tmp"correg"true))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOR_ERRO"Uso vбlido: /Setar [correg] [ID]");
                return 
1;
            }
            new
                
id strval(tmp)
            ;
               if(!
IsPlayerConnected(id))
            {
                
SendClientMessage(playeridCOR_ERRO"Jogador(a) nгo conectado(a)!");
                return 
1;
            }
            if(
aInfo[id][Corregedor] == 0)
            {
                
format(gstringsizeof(gstring), "Vocк tornou %s um(a) corregedor(a)."PlayerName(id));
                
SendClientMessage(playeridAZUL_BMOgstring);
                   
format(gstringsizeof(gstring), "Parabйns! Vocк й o(a) novo(a) corregedor(a) do servidor, promovido(a) por %s."PlayerName(playerid));
                
SendClientMessage(idAZUL_BMOgstring);
                
BMO_SetInt(f(id), "Corregedor"1);
                
BMO_SaveFile();
                
aInfo[id][Corregedor] = 1;
            }
            else if(
aInfo[id][Corregedor] == 1)
            {
                   
format(gstringsizeof(gstring), "Vocк removeu %s da corregedoria do servidor."PlayerName(id));
                
SendClientMessage(playeridVERMELHO_BMOgstring);
                   
format(gstringsizeof(gstring), "%s lhe retirou da corregedoria do servidor."PlayerName(playerid));
                
SendClientMessage(idVERMELHO_BMOgstring);
                
BMO_SetInt(f(id), "Corregedor"0);
                
BMO_SaveFile();
                
aInfo[id][Corregedor] = 0;
            }
            return 
1;
        }
        return 
1;
    } 
teria como fazer esse comando, por exemplo, em zcmd, com parametros diferentes!
Olha o meu /setar. Й basicamente aquilo.
Vocк continua usando "strcmp" para comparar a string, mas em vez de "tmp" (usado no exemplo que vocк deu), vocк usa "params".

PHP код:
if(strcmp(params"opcao"true) == 0)
{
}
else if(
strcmp(params,"opcao2"true) == 0)
{

Reply
#6

Ajudou mto, ++ rep com certeza! o forum caiu umas 10x hoje, mas agr to sem o problema do meu login sair toda hora
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)