[AJUDA] Mais de um cmd no gm.
#1

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н?
Reply
#2

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;    
}
Reply
#3

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;
}
Reply
#4

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

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

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
Reply
#7

Valeu LOS, agora deu certo.
Reply
#8

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.
Reply
#9

Todos erram.. rrsrs..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)