Compiler Error
#1

I have a problem because I am trying to compile the code but it gives an error and it appears: Pawn Library Compiler has stopped working.
I researched it, I realized that it could be the keys "{" or "}" but I checked them all, and they're correct, can anyone tell me what it is?
Reply
#2

Check the last thing you did before I gave you that error.
Reply
#3

It's been a long time, but as far as I remember I did not leave anything out of place, if you can check for me:

Код:
// COMANDOS DE ADMINISTRADOR

#include <YSI\y_hooks>


hook OnGameModeInit()
{
	print("\n[OnGameModeInit] Initialising 'Admin/Level4'...");

	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/restart - Reiniciar o servidor\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/status - Ativar ou desativar uma conta\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/setpinglimit - Alterar o limite de ping\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/clima - Alterar o clima\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/setscore - Mudar a score de algum player\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/congelarall - Congelar todos os jogadores\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/descongelarall - Descongelar todos os jogadores\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/status - Desativar ou ativar contas!\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/setmotd - Mudar a mensagem do dia\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/additem - Para gerentes!\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/addveiculo - Para gerentes!\n");
	RegisterAdminCommand(STAFF_LEVEL_LEAD, "/deletar - Para gerentes!\n");
}

ACMD:status[4](playerid, params[])
{
	new
		name[MAX_PLAYER_NAME],
		active;

	if(sscanf(params, "s[24]d", name, active))
	{
		MsgF(playerid, NovoA, "[ > ] Uso correto: /status [nome] [1(ativa) ou 0(desativa)]");
		return 1;
	}

	if(!AccountExists(name))
	{
		Msg(playerid, RED, "[x] Essa conta nгo existe!");
		return 1;
	}

	SetAccountActiveState(name, active);

	MsgF(playerid, NovoA, "[ > ] %s "C_BLUE"'%s' "C_YELLOW"account.", active ? ("Activated") : ("Deactivated"), name);
	return 1;
}



ACMD:setscore[4](playerid, params[])
{
    new
                score,
                Nomee[MAX_PLAYERS],
                Player
        ;

    if ( sscanf ( params , "dd" , Player , score ) )
                return SendClientMessage ( playerid , 0x00C0FFFF , "[ > ] Uso correto: /setscore [id] [score]" ) ;
    if ( !IsPlayerConnected ( Player ) )
                return SendClientMessage ( playerid , 0x00C0FFFF , "[x] Player nao encontrado" ) ;
    SetPlayerScore ( Player , score ) ;
    format ( Str , sizeof ( Str ) , "{349DF9}[ > ] Vocк setou o score do player {FFFFFF}%s {349DF9}para {FFFFFF}%d", Nomee , score ) ;
    SendClientMessage ( playerid , 0x00C0FFFF , Str ) ;
    return 1;
}



ACMD:congelarall[4](playerid, params[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	TogglePlayerControllable(i, 0);
	SendClientMessage(playerid, 0x00C0FFFF , "{349DF9}[ > ] Todos os players do servidor foram congelados!" );
    MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} congelou todos os players do servidor!", playerid);
	return 1;
}

ACMD:descongelarall[4](playerid, params[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	TogglePlayerControllable(i, 1);
	SendClientMessage(playerid, 0x00C0FFFF , "{349DF9}[ > ] Todos os players do servidor foram descongelados!" );
	MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} descongelou todos os players do servidor!", playerid);
	return 1;
}

ACMD:restart[4](playerid, params[])
{
	new duration;

	if(sscanf(params, "d", duration))
	{
		Msg(playerid, NovoA, "[ > ] Uso correto: /restart [segundos] (Sempre dar aos jogadores 5 ~ 10 minutos para se prepararem)");
		return 1;
	}

	MsgF(playerid, NovoA, "[ > ] Reiniciando servidor em {FFFFFF}%02d:%02d", duration / 60, duration % 60);
	SetRestart(duration);
	ToggleWhitelist(true);
	MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} programou o restart do servidor!", playerid);
	return 1;
}


ACMD:setmotd[4](playerid, params[])
{
	if(sscanf(params, "s[128]", gMessageOfTheDay))
	{
		Msg(playerid, NovoA, "[ > ] Uso correto: /setmotd [mensagem]");
		return 1;
	}

	MsgAllF(NovoA, "[ > ] ANЪNCIO atualizado: "C_BLUE"%s", gMessageOfTheDay);
    MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P{00CED1} atualizou a mensagem do dia!", playerid);
	return 1;
}

ACMD:setpinglimit[4](playerid, params[])
{
	new val = strval(params);

	if(!(300 < val < 1500))
	{
		Msg(playerid, RED, "[x] Limite de ping deve estar entre 300 e 1500");
		return 1;
	}

	gPingLimit = strval(params);
	MsgF(playerid, NovoA, "[ > ] O limite de ping foi alterado para {FFFFFF}%d", gPingLimit);
    MsgAdminsF(1, NovoA, "{00CED1}[ > ] O(a) administrador(a) %P {00CED1}definiu o limite de ping para {FFFFFF}%d!", playerid, gPingLimit);
	return 1;
}


ACMD:clima[4](playerid, params[])
{
	if(strlen(params) > 2)
	{
		for(new i; i < sizeof(WeatherData); i++)
		{
			if(strfind(WeatherData[i][weather_name], params, true) != -1)
			{
				foreach(new j : Player)
				{
					SetPlayerWeather(j, i);
				}

				SetGlobalWeather(i);
				MsgAdminsF(GetPlayerAdminLevel(playerid), NovoA, "[ > ] Clima setado para %s", WeatherData[i]);

				return 1;
			}
		}

		Msg(playerid, RED, "[x] Clima invalido!");
	}

	return 1;
}


/*==============================================================================

	Debug stuff (SIF mostly)

==============================================================================*/


CMD:debug(playerid, params[])
{
	new
		handlername[32],
		level,
		handler;

	if(sscanf(params, "s[32]d", handlername, level))
	{
		Msg(playerid, YELLOW, " >  Usage: /sifdebug [handlername] [level]");
		return 1;
	}

	handler = debug_handler_search(handlername);

	if(handler == -1)
	{
		Msg(playerid, YELLOW, "Invalid handler");
		return 1;
	}

	if(!(0 <= level <= 10))
	{
		Msg(playerid, YELLOW, "Invalid level");
		return 1;
	}

	debug_get_handler_name(handler, handlername);

	debug_set_level(handler, level);

	MsgF(playerid, YELLOW, " >  SS debug level for '%s': %d", handlername, level);

	return 1;
}

CMD:sifdebug(playerid, params[])
{
	new
		handlername[32],
		level,
		handler;

	if(sscanf(params, "s[32]d", handlername, level))
	{
		Msg(playerid, YELLOW, " >  Usage: /sifdebug [handlername] [level]");
		return 1;
	}

	handler = sif_debug_handler_search(handlername);

	if(handler == -1)
	{
		Msg(playerid, YELLOW, "Invalid handler");
		return 1;
	}

	if(!(0 <= level <= 10))
	{
		Msg(playerid, YELLOW, "Invalid level");
		return 1;
	}

	sif_debug_get_handler_name(handler, handlername);

	sif_debug_plevel(playerid, handler, level);

	MsgF(playerid, YELLOW, " >  SIF debug level for '%s': %d", handlername, level);

	return 1;
}

ACMD:sifgdebug[4](playerid, params[])
{
	new
		handlername[32],
		level,
		handler;

	if(sscanf(params, "s[32]d", handlername, level))
	{
		Msg(playerid, YELLOW, " >  Usage: /sifdebug [handlername] [level]");
		return 1;
	}

	handler = sif_debug_handler_search(handlername);

	if(handler == -1)
	{
		Msg(playerid, YELLOW, "Invalid handler");
		return 1;
	}

	if(!(0 <= level <= 10))
	{
		Msg(playerid, YELLOW, "Invalid level");
		return 1;
	}

	sif_debug_get_handler_name(handler, handlername);

	sif_debug_level(handler, level);

	MsgF(playerid, YELLOW, " >  Global SIF debug level for '%s': %d", handlername, level);

	return 1;
}

ACMD:dbl[3](playerid, params[])
{
	#if defined SIF_USE_DEBUG_LABELS
		if(IsPlayerToggledAllDebugLabels(playerid))
		{
			HideAllDebugLabelsForPlayer(playerid);
			Msg(playerid, YELLOW, " >  Debug labels toggled off.");
		}
		else
		{
			ShowAllDebugLabelsForPlayer(playerid);
			Msg(playerid, YELLOW, " >  Debug labels toggled on.");
		}
	#else
		Msg(playerid, YELLOW, " >  Debug labels are not compiled.");
	#endif

	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)