SA-MP Forums Archive
[AJUDA] Mais de um cmd no gm. - 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] Mais de um cmd no gm. (/showthread.php?tid=181841)



[AJUDA] Mais de um cmd no gm. - Pombo - 07.10.2010

Olб. Eu tф criando um server de parkour, e quero botar uns comandos. Eu fiz os cmd certinho, mas aн eu vou compilar e dб um erro: error 010: invalid function or declaration.
O cmd й:

Код:
public OnPlayerCommandText(playerid, cmdtext[])

  if (strcmp("/curar", cmdtext, true, 10) == 0)
{
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COR_LARANJA, "Vocк foi curado");
}
  if (strcmp("/comandos", cmdtext, true, 10) == 0)
{
	SendClientMessage(playerid, COR_LARANJA, "/ajuda : Mostra a ajuda do jogo");
	SendClientMessage(playerid, COR_LARANJA, "/count [Nъmero] : Comeзa a contagem regressiva");
	SendClientMessage(playerid, COR_LARANJA, "/animlist : Mostra uma lista de animaзхes");
	SendClientMessage(playerid, COR_LARANJA, "/suicidar : Se suicida (caso vocк caia na бgua)";
	SendClientMessage(playerid, COR_LARANJA, "/labguia : Mostra o guia do Labirinto do Pombo");
}
	if (strcmp("/ajuda", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "O objetivo do jogo й chegar no final do percurso. Boa sorte!");

}

  if(strcmp("/suicidar", cmdtext, true) == 0)
{
	SetPlayerHealth(playerid, 0);
	SendClientMessage(playerid, COR_VERMELHA,"Vocк se matou! LOL, tб tгo foda assim?");
}

 if(strcmp("/labguia", cmdtext, true) == 0)
{
	SendClientMessage(playerid, COR_VERMELHA,"Use sempre o guia da mгo esquerda. (Siga sempre a sua mгo esquerda)");
	return 1;
}
Os cmds sгo para: Curar, mostrar os comandos do servidor, mostrar a ajuda, se matar e mostrar o guia do labirinto.
O erro tб nas linhas que tem if.

Quando eu compilo sу com um comando ele dб certo.
Alguйm pode me ajudar aн?


Respuesta: [AJUDA] Mais de um cmd no gm. - Lipepva - 07.10.2010

Acredito que seja assim no final de cada comando vocк estб colocando
pawn Код:
}
vocк deve colocar return 1;
deixe assim exemplo:
pawn Код:
if (strcmp("/curar", cmdtext, true, 10) == 0)
{
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COR_LARANJA, "Vocк foi curado");
    return 1;
}
pawn Код:
if (strcmp("/comandos", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "/ajuda : Mostra a ajuda do jogo");
    SendClientMessage(playerid, COR_LARANJA, "/count [Nъmero] : Comeзa a contagem regressiva");
    SendClientMessage(playerid, COR_LARANJA, "/animlist : Mostra uma lista de animaзхes");
    SendClientMessage(playerid, COR_LARANJA, "/suicidar : Se suicida (caso vocк caia na бgua)";
    SendClientMessage(playerid, COR_LARANJA, "/labguia : Mostra o guia do Labirinto do Pombo");
    return 1;    
}



Re: [AJUDA] Mais de um cmd no gm. - zSuYaNw - 07.10.2010

bota return 1; lol

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])

  if (strcmp("/curar", cmdtext, true, 10) == 0)
{
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COR_LARANJA, "Vocк foi curado");
    return 1;
}
  if (strcmp("/comandos", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "/ajuda : Mostra a ajuda do jogo");
    SendClientMessage(playerid, COR_LARANJA, "/count [Nъmero] : Comeзa a contagem regressiva");
    SendClientMessage(playerid, COR_LARANJA, "/animlist : Mostra uma lista de animaзхes");
    SendClientMessage(playerid, COR_LARANJA, "/suicidar : Se suicida (caso vocк caia na бgua)";
    SendClientMessage(playerid, COR_LARANJA, "/labguia : Mostra o guia do Labirinto do Pombo");
    return 1;
}
    if (strcmp("/ajuda", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "O objetivo do jogo й chegar no final do percurso. Boa sorte!");
    return 1;
}

  if(strcmp("/suicidar", cmdtext, true) == 0)
{
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, COR_VERMELHA,"Vocк se matou! LOL, tб tгo foda assim?");
    return 1;
}

 if(strcmp("/labguia", cmdtext, true) == 0)
{
    SendClientMessage(playerid, COR_VERMELHA,"Use sempre o guia da mгo esquerda. (Siga sempre a sua mгo esquerda)");
    return 1;
}



Re: [AJUDA] Mais de um cmd no gm. - Pombo - 07.10.2010

Fiz isso e deu 8 erros error 010: invalid function or declaration.
(nas linhas com IF e RETURN)


Respuesta: [AJUDA] Mais de um cmd no gm. - BiieL - 07.10.2010

pawn Код:
if(strcmp(cmdtext, "/comando", true) == 0)
    {
        //funзгo aqui
        return 1;
    }



Re: [AJUDA] Mais de um cmd no gm. - Lуs - 07.10.2010

LOL Cara, vocк esqueceu de abrir a chave na stock!

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp(cmdtext,"/curar", true) == 0)
{
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COR_LARANJA, "Vocк foi curado");
    return 1;
}
  if (strcmp(cmdtext,"/comandos", true) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "/ajuda : Mostra a ajuda do jogo");
    SendClientMessage(playerid, COR_LARANJA, "/count [Nъmero] : Comeзa a contagem regressiva");
    SendClientMessage(playerid, COR_LARANJA, "/animlist : Mostra uma lista de animaзхes");
    SendClientMessage(playerid, COR_LARANJA, "/suicidar : Se suicida (caso vocк caia na бgua)";
    SendClientMessage(playerid, COR_LARANJA, "/labguia : Mostra o guia do Labirinto do Pombo");
    return 1;
}
    if (strcmp(cmdtext,"/ajuda", true) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "O objetivo do jogo й chegar no final do percurso. Boa sorte!");
    return 1;
}

  if(strcmp(cmdtext,"/suicidar", true) == 0)
{
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, COR_VERMELHA,"Vocк se matou! LOL, tб tгo foda assim?");
    return 1;
}

 if(strcmp(cmdtext,"/labguia", true) == 0)
{
    SendClientMessage(playerid, COR_VERMELHA,"Use sempre o guia da mгo esquerda. (Siga sempre a sua mгo esquerda)");
    return 1;
}
}
Prontinho


Re: [AJUDA] Mais de um cmd no gm. - Pombo - 07.10.2010

Valeu LOS, agora deu certo.


Re: [AJUDA] Mais de um cmd no gm. - zSuYaNw - 07.10.2010

Quote:
Originally Posted by Los
Посмотреть сообщение
LOL Cara, vocк esqueceu de abrir a chave na stock!

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if (strcmp(cmdtext,"/curar", true) == 0)
{
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COR_LARANJA, "Vocк foi curado");
    return 1;
}
  if (strcmp(cmdtext,"/comandos", true) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "/ajuda : Mostra a ajuda do jogo");
    SendClientMessage(playerid, COR_LARANJA, "/count [Nъmero] : Comeзa a contagem regressiva");
    SendClientMessage(playerid, COR_LARANJA, "/animlist : Mostra uma lista de animaзхes");
    SendClientMessage(playerid, COR_LARANJA, "/suicidar : Se suicida (caso vocк caia na бgua)";
    SendClientMessage(playerid, COR_LARANJA, "/labguia : Mostra o guia do Labirinto do Pombo");
    return 1;
}
    if (strcmp(cmdtext,"/ajuda", true) == 0)
{
    SendClientMessage(playerid, COR_LARANJA, "O objetivo do jogo й chegar no final do percurso. Boa sorte!");
    return 1;
}

  if(strcmp(cmdtext,"/suicidar", true) == 0)
{
    SetPlayerHealth(playerid, 0);
    SendClientMessage(playerid, COR_VERMELHA,"Vocк se matou! LOL, tб tгo foda assim?");
    return 1;
}

 if(strcmp(cmdtext,"/labguia", true) == 0)
{
    SendClientMessage(playerid, COR_VERMELHA,"Use sempre o guia da mгo esquerda. (Siga sempre a sua mгo esquerda)");
    return 1;
}
}
Prontinho
stock! ? acho que й Callback ou public mesmo.


Re: [AJUDA] Mais de um cmd no gm. - Falcon. - 07.10.2010

Todos erram.. rrsrs..