SA-MP Forums Archive
[Ajuda]Comandos Invalidos - 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]Comandos Invalidos (/showthread.php?tid=322880)



[Ajuda]Comandos Invalidos - guizaofb - 03.03.2012

Olб Galera, to com um probleminha aqui... Tipo eu digito o comando certo (/rank) e no serve aparece como se estivesse errado -.-' (Este Comando nгo Existe).

pawn Код:
if(!strcmp(cmdtext, "/rank", true))
    {
        new
            Scor[MAX_PLAYERS],
            string[128],
            Nome[24]
        ;

        for(new i; i != MAX_PLAYERS; ++i) Scor[i] = GetPlayerScore(i);

        BubbleSort(Scor, sizeof(Scor));

        for(new i; i != 10; i++)
        {
            GetPlayerName(playerid, Nome, 24);
            format(string, sizeof(string),"NЄ %i Nome: %s Level: %d", i+1, Nome, Scor[i]);
            SendClientMessage(playerid, -1, string);
        }
        return 1;
    }
jб tentei outros comandos e alguns da o mesmo problema, os ъnicos que estгo funcionando й de um FS de ADM e o comando /handsup

pawn Код:
if(!strcmp(cmd, "/handsup", true))
    {
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
        return 1;
    }
ME AJUDEM PF !!!



Re: [Ajuda]Comandos Invalidos - GuiihCamargo - 03.03.2012

Tente Este:
pawn Код:
if(!strcmp(cmdtext, "/rank", true))
{
new
Scor[MAX_PLAYERS],
string[128],
Nome[24]
;
for(new i; i != MAX_PLAYERS; ++i) Scor[i] = GetPlayerScore(i);
BubbleSort(Scor, sizeof(Scor));
for(new i; i != 10; i++)
{
GetPlayerName(playerid, Nome, 24);
format(string, sizeof(string),"NЄ %i Nome: %s Level: %d", i+1, Nome, Scor[i]);
SendClientMessage(playerid, -1, string);
}
return 1;
}



Re: [Ajuda]Comandos Invalidos - Đeagle - 03.03.2012

Quote:
Originally Posted by GuiihCamargo
Посмотреть сообщение
Tente Este:
if(!strcmp(cmdtext, "/rank", true))
{
new
Scor[MAX_PLAYERS],
string[128],
Nome[24]
;
for(new i; i != MAX_PLAYERS; ++i) Scor[i] = GetPlayerScore(i);
BubbleSort(Scor, sizeof(Scor));
for(new i; i != 10; i++)
{
GetPlayerName(playerid, Nome, 24);
format(string, sizeof(string),"NЄ %i Nome: %s Level: %d", i+1, Nome, Scor[i]);
SendClientMessage(playerid, -1, string);
}
return 1;
}[/pawn]
Oque vocк mudou?

Tenta assim:
PHP код:
if(!strcmp("/rank"cmdtexttrue))

new 
Scor[MAX_PLAYERS], 
string[128], 
Nome[24

for(new 
i!= MAX_PLAYERS; ++iScor[i] = GetPlayerScore(i); 
BubbleSort(Scorsizeof(Scor)); 
for(new 
i!= 10i++) 

GetPlayerName(playeridNome24); 
format(stringsizeof(string),"NЄ %i Nome: %s Level: %d"i+1NomeScor[i]); 
SendClientMessage(playerid, -1string); 

return 
1




Re: [Ajuda]Comandos Invalidos - GuiihCamargo - 03.03.2012

Quote:
Originally Posted by Đeagle
Посмотреть сообщение
Oque vocк mudou?
Eu mudei o jeito de ele por, pra conseguir pegar o comando


Re: [Ajuda]Comandos Invalidos - guizaofb - 03.03.2012

jah tentei o comando de vcs 2 e continuo mesma coisa =X

edit__

ta valendo +rep =D (se q alguns nem ligam mais й o mбximo que posso agradecer)


Re: [Ajuda]Comandos Invalidos - Đeagle - 03.03.2012

Olha, eu ainda sou novato em pawn, mais tenta assim

PHP код:
if(!strcmp("/rank"cmdtexttrue))

new 
Scor[MAX_PLAYERS], 
new 
string[128], 
new 
Nome[24

for(new 
i!= MAX_PLAYERS; ++iScor[i] = GetPlayerScore(i); 
BubbleSort(Scorsizeof(Scor)); 
for(new 
i!= 10i++) 

GetPlayerName(playeridNome24); 
format(stringsizeof(string),"NЄ %i Nome: %s Level: %d"i+1NomeScor[i]); 
SendClientMessage(playerid, -1string); 

return 
1




Re: [Ajuda]Comandos Invalidos - Edu_Oliveira - 03.03.2012

Pelo que li, seu comando estava jб programado para mostrar invalido quando vocк pediu que ele verificasse a existкncia dele antes de cria-lo. Posso estar falando besteira, mas acho que era o if(!strcmp(...
Testa oque eu coloquei ai... Talvez dк certo.

pawn Код:
if(strcmp("/rank", cmdtext, true))
{  
new  
Scor[MAX_PLAYERS],  
string[128],  
Nome[24]  
;  
for(new i; i != MAX_PLAYERS; ++i) Scor[i] = GetPlayerScore(i);  
BubbleSort(Scor, sizeof(Scor));  
for(new i; i != 10; i++)  
{  
GetPlayerName(playerid, Nome, 24);  
format(string, sizeof(string),"NЄ %i Nome: %s Level: %d", i+1, Nome, Scor[i]);  
SendClientMessage(playerid, -1, string);  
}  
return 1;  
}



Re: [Ajuda]Comandos Invalidos - guizaofb - 03.03.2012

Quote:
Originally Posted by Edu_Oliveira
Посмотреть сообщение
Pelo que li, seu comando estava jб programado para mostrar invalido quando vocк pediu que ele verificasse a existкncia dele antes de cria-lo. Posso estar falando besteira, mas acho que era o if(!strcmp(...
Testa oque eu coloquei ai... Talvez dк certo.

pawn Код:
if(strcmp("/rank", cmdtext, true))
{  
new  
Scor[MAX_PLAYERS],  
string[128],  
Nome[24]  
;  
for(new i; i != MAX_PLAYERS; ++i) Scor[i] = GetPlayerScore(i);  
BubbleSort(Scor, sizeof(Scor));  
for(new i; i != 10; i++)  
{  
GetPlayerName(playerid, Nome, 24);  
format(string, sizeof(string),"NЄ %i Nome: %s Level: %d", i+1, Nome, Scor[i]);  
SendClientMessage(playerid, -1, string);  
}  
return 1;  
}
so tirar o "!" neh

edit____ tirei o "!" e fico mesma coisa, se n me engano foi a primeira coisa q tentei =X

e tbm jah tentei ctrl + c ctrl + v no seu codigo e nada tbm


Re: [Ajuda]Comandos Invalidos - Edu_Oliveira - 03.03.2012

Sim... O ! serve para verificar a existencia. Ele chama a existencia do que vocк coloca a frente, e se nгo existe, ele anula. Ali o GM estб parando de verificar antes de executar o comando, pois vocк esta buscando algo que nгo existe.


Re: [Ajuda]Comandos Invalidos - guizaofb - 03.03.2012

Quote:
Originally Posted by guizaofb
Посмотреть сообщение
so tirar o "!" neh

edit____ tirei o "!" e fico mesma coisa, se n me engano foi a primeira coisa q tentei =X

e tbm jah tentei ctrl + c ctrl + v no seu codigo e nada tbm
como disse acima entгo "tirei o "!" e fico mesma coisa, se n me engano foi a primeira coisa q tentei =X

e tbm jah tentei ctrl + c ctrl + v no seu codigo e nada tbm"