SA-MP Forums Archive
[Ajuda] Bug no comando ajuda ai plz ! - 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] Bug no comando ajuda ai plz ! (/showthread.php?tid=388696)



Bug no comando ajuda ai plz ! - Thung_. - 30.10.2012



eu digito o comando /calar coloco o id e o motivo mais fica aparecendo essa msm messagem por favor me ajudem sou meio newbie aki em pawn

Код:
command(calar, playerid, params[])
{
	new Jogadorid, Motivo, Nome[MAX_PLAYER_NAME], Nome2[MAX_PLAYER_NAME], string[128];
	if(sscanf(params, "iii", Jogadorid, Motivo)) return SendClientMessage(playerid,-1,"Uso Correto: /calar [ID de Jogador(a)] [Motivo]");
	if(!IsPlayerConnected(Jogadorid)) return SendClientMessage(playerid,-1,"Jogador(a) nгo connectado!");
	GetPlayerName(playerid, Nome, sizeof(Nome));
	GetPlayerName(Jogadorid, Nome2, sizeof(Nome2));
	PlayerInfo[Jogadorid][pCalado] = 1;
	format(string, sizeof(string)," O Administrador(a) %s calou o Jogador(a) %s, Motivo:%s",Nome, Nome2, Motivo);
	SendClientMessageToAll(-1,string);
	return 1;
}



Re: Bug no comando ajuda ai plz ! - Ouro - 30.10.2012

pawn Код:
if(sscanf(params, "us[128]"...
"u" = Vocк pega um ID e/ou nome de um certo jogador.
"s[128]" = Vocк pega uma string com uma deteminada cйlula, no caso uma mensagem/texto


Re: Bug no comando ajuda ai plz ! - Thung_. - 30.10.2012



Agr aparece isso eu jб testei o comando em min e tб bugado ainda :/


Re: Bug no comando ajuda ai plz ! - Ouro - 30.10.2012

pawn Код:
new Jogadorid, Motivo[128], Nome[MAX_PLAYER_NAME], Nome2[MAX_PLAYER_NAME], string[128];
Tente.


Re: Bug no comando ajuda ai plz ! - Thung_. - 30.10.2012

mudou nada :/


Re: Bug no comando ajuda ai plz ! - zSuYaNw - 30.10.2012

Olhe a tabela do SSCANF:
iInteradores(nъmeros somente)
s[size]Strings, textos(use s[tamanho_string])
uPlayer Nome ou Id

Aqui:
pawn Код:
command(calar, playerid, params[])
{
    new
        Jogadorid,
        Motivo[50]
    ;

    if(sscanf(params, "is[50]", Jogadorid, Motivo)) // Note que "s[50]" й o mesmo tamanho da declaraзгo (new Motivo[50]).
        return SendClientMessage(playerid,-1,"Uso Correto: /calar [ID de Jogador(a)] [Motivo]");
       
    if(!IsPlayerConnected(Jogadorid))
        return SendClientMessage(playerid,-1,"Jogador(a) nгo connectado!");
       

    new
        Nome[MAX_PLAYER_NAME],
        Nome2[MAX_PLAYER_NAME],
        string[128]
    ;
   
    GetPlayerName(playerid, Nome, sizeof(Nome));
    GetPlayerName(Jogadorid, Nome2, sizeof(Nome2));
   
    PlayerInfo[Jogadorid][pCalado] = 1;
   
    format(string, sizeof(string)," O Administrador(a) %s calou o Jogador(a) %s, Motivo:%s",Nome, Nome2, Motivo);
   
    SendClientMessageToAll(-1,string);
    return 1;
}



Re: Bug no comando ajuda ai plz ! - Ouro - 30.10.2012

Exatamente garfield, u = ID ou nome do player. --'
E o cara que pegar o ID do jogador para assim usar o comando nele.


Re: Bug no comando ajuda ai plz ! - Thung_. - 30.10.2012

Obrigado


Re: Bug no comando ajuda ai plz ! - zSuYaNw - 30.10.2012

Quote:
Originally Posted by Ouro
Посмотреть сообщение
Exatamente garfield, u = ID ou nome do player. --'
E o cara que pegar o ID do jogador para assim usar o comando nele.
Exactly!

aconselho ler este tutorial: https://sampforum.blast.hk/showthread.php?tid=277842 (em portuguкs).


Re: Bug no comando ajuda ai plz ! - Thung_. - 30.10.2012

Droga ainda cuntinua o bug :/