[Ajuda] Comando
#1

Galera eu queria um comando ZCMD de trancar o server.

Tipo o adm digita /ts e seta a senha definida, e quando digita /as tira a senha.

Fiz essa base, mas da erros.
pawn Код:
COMMAND:ts(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        new HostCommand[128];
        format(HostCommand, 128, "[Closed] NOME DO SERVER ");
        SendRconCommand(HostCommand);
        SendRconCommand("password chafik");
        SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");
        return 1;
}
COMMAND:as(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        new HostCommand[128];
        format(HostCommand, 128, "NOME DO SERVER",);
        SendRconCommand(HostCommand);
        SendRconCommand("0");
        SendClientMessage(0x00FF00, "Server Aberto com Sucesso!");
        return 1;
}

Erros:
pawn Код:
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2939) : error 035: argument type mismatch (argument 2)
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2940) : error 079: inconsistent return types (array & non-array)
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2942) : warning 217: loose indentation
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2942) : error 029: invalid expression, assumed zero
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2942) : error 017: undefined symbol "cmd_as"
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2942) : error 029: invalid expression, assumed zero
C:\Users\user\Downloads\pawno\include\PPC_PlayerCommands.inc(2942) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Linhas:
pawn Код:
SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");//2939
        return 1;//2940
}//2941
COMMAND:as(playerid, params[])//2942
Reply
#2

Esqueceu de fechar as chaves...

Код:
COMMAND:ts(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        	new HostCommand[128];
        	format(HostCommand, 128, "[Closed] NOME DO SERVER ");
        	SendRconCommand(HostCommand);
        	SendRconCommand("password chafik");
        	SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");
        	return 1;
	}
    }
}
COMMAND:as(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        	new HostCommand[128];
        	format(HostCommand, 128, "NOME DO SERVER",);
        	SendRconCommand(HostCommand);
        	SendRconCommand("0");
        	SendClientMessage(0x00FF00, "Server Aberto com Sucesso!");
        	return 1;
	}
    }
}
Reply
#3

Quote:
Originally Posted by DogeMan
Посмотреть сообщение
Esqueceu de fechar as chaves...

Код:
COMMAND:ts(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        	new HostCommand[128];
        	format(HostCommand, 128, "[Closed] NOME DO SERVER ");
        	SendRconCommand(HostCommand);
        	SendRconCommand("password chafik");
        	SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");
        	return 1;
	}
    }
}
COMMAND:as(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        	new HostCommand[128];
        	format(HostCommand, 128, "NOME DO SERVER",);
        	SendRconCommand(HostCommand);
        	SendRconCommand("0");
        	SendClientMessage(0x00FF00, "Server Aberto com Sucesso!");
        	return 1;
	}
    }
}
Continua dando erro
Reply
#4

Quote:
Originally Posted by DogeMan
Посмотреть сообщение
Esqueceu de fechar as chaves...

Код:
COMMAND:ts(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        	new HostCommand[128];
        	format(HostCommand, 128, "[Closed] NOME DO SERVER ");
        	SendRconCommand(HostCommand);
        	SendRconCommand("password chafik");
        	SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");
        	return 1;
	}
    }
}
COMMAND:as(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        	new HostCommand[128];
        	format(HostCommand, 128, "NOME DO SERVER",);
        	SendRconCommand(HostCommand);
        	SendRconCommand("0");
        	SendClientMessage(0x00FF00, "Server Aberto com Sucesso!");
        	return 1;
	}
    }
}
pq n tenta

pawn Код:
CMD:ts(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        new HostCommand[128];
        format(HostCommand, 128, "[Closed] NOME DO SERVER ");
        SendRconCommand(HostCommand);
        SendRconCommand("password chafik");
        SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");
        return 1;
}
CMD:as(playerid, params[])
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
        new HostCommand[128];
        format(HostCommand, 128, "NOME DO SERVER",);
        SendRconCommand(HostCommand);
        SendRconCommand("0");
        SendClientMessage(0x00FF00, "Server Aberto com Sucesso!");
        return 1;
}
Reply
#5

@Sobre o cara acima:

Nгo adianta tentar, vai continuar dando erro.

@topic

Os parвmetros de SendClientMessage sгo: playerid, color, message[].
Reply
#6

Quote:
Originally Posted by arakuta
Посмотреть сообщение
@Sobre o cara acima:

Nгo adianta tentar, vai continuar dando erro.

@topic

Os parвmetros de SendClientMessage sгo: playerid, color, message[].
Nem assim deu certo
Reply
#7

pawn Код:
CMD:ts(playerid)
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
            SendRconCommand("password chafik");
            SendClientMessage(0xFF0000, "Server Trancado com Sucesso!");
            return 1;
        }
    }
}

CMD:as(playerid)
{
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 7)
        {
            SendRconCommand("password 0");
            SendClientMessage(0xFF0000, "Server Aberto com Sucesso!");
            return 1;
        }
    }
}
Tenta...
Reply
#8

pawn Код:
COMMAND:ts(playerid)
{
    if(APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] >= 7)
    {
        SendRconCommand("hostname [Closed] NOME DO SERVER");
        SendRconCommand("password chafik");
        SendClientMessage(playerid, 0xFF0000AA, "Server Trancado com Sucesso!");   
    }
    return 1;
}

COMMAND:as(playerid)
{
    if (APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] >= 7)
    {
        SendRconCommand("hostname NOME DO SERVER");
        SendRconCommand("password ");
        SendClientMessage(playerid, 0x00FF00AA, "Server Aberto com Sucesso!");
    }
    return 1;
}
essa galera ta dormindo... erro tao simples.
Reply
#9

Quote:
Originally Posted by PT
Посмотреть сообщение
pawn Код:
COMMAND:ts(playerid)
{
    if(APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] >= 7)
    {
        SendRconCommand("hostname [Closed] NOME DO SERVER");
        SendRconCommand("password chafik");
        SendClientMessage(playerid, 0xFF0000AA, "Server Trancado com Sucesso!");   
    }
    return 1;
}

COMMAND:as(playerid)
{
    if (APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] >= 7)
    {
        SendRconCommand("hostname NOME DO SERVER");
        SendRconCommand("password ");
        SendClientMessage(playerid, 0x00FF00AA, "Server Aberto com Sucesso!");
    }
    return 1;
}
essa galera ta dormindo... erro tao simples.
Obrigado +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)