Plugin shut down when try sent money

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Отговори
Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 229
Регистриран: 29 ное 2017, 22:49
Се отблагодари: 5 пъти
Получена благодарност: 1 път
Контакти:

Plugin shut down when try sent money

Мнение от lantimilan » 07 юли 2019, 16:05

Hello sorry for my topic name i dont know how to set my problem i have one plugin but i think something is wrong when somebody try to sent money shut down server maybe something its wrong in code can you help me ?
This error : FATAL ERROR (shutting down): PF_MessageBegin_I: Tried to create a message with a bogus message type ( 0 )

Код: Избери всички

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>

new const szChatEventHandlers[][] = { "say", "say_team" };

#define cm(%1) (charsmax(%1))

public plugin_init()
{
	register_plugin("Dhuro Para Chat", "v1.0", "JackEyedJones");

	for(new registercommands = 0; registercommands < sizeof(szChatEventHandlers); registercommands++)
		register_clcmd(szChatEventHandlers[registercommands], "MainEvent");
}

public MainEvent(id)
{
	new szArg[192], szArg_Command[63], szArg_Name[63], szArg_Cashgiven[63];
	read_args(szArg, cm(szArg)); remove_quotes(szArg);

	parse(szArg, szArg_Command, cm(szArg_Command), szArg_Name, cm(szArg_Name), szArg_Cashgiven, cm(szArg_Cashgiven));

	if(equali(szArg_Command, "/dhuro"))
	{
		if(!strlen(szArg_Name) || !strlen(szArg_Cashgiven))
		{
			ColorChat(id, NORMAL, "^1[^4Dhuro Para^1]:^1Si te perdorim: ^4/dhuro <nick> <parat>^1.");
			
			return PLUGIN_HANDLED;
		}

		new target_receiver = cmd_target(id, szArg_Name, 0);
		new money_to_give = str_to_num(szArg_Cashgiven);

		if(!target_receiver)
		{
			ColorChat(id, NORMAL, "^1[^4Dhuro Para^1]:^1Plotesoni te dhenat e marresit te parave^3.");
			
			return PLUGIN_HANDLED;
		}

		if(target_receiver == id)
		{
			ColorChat(id, NORMAL, "^1[^4Dhuro Para^1]:^1Na vjen keq, nuk mund ti dhuroni para vetit tuaj^3.");
			
			return PLUGIN_HANDLED;
		}

		if(cs_get_user_team(target_receiver) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		{
			ColorChat(id, NORMAL, "^1[^4Dhuro Para^1]:^1Te dy lojtaret nuk duhet te jene SHIKUES^3.");
			
			return PLUGIN_HANDLED;
		}

		if(money_to_give > cs_get_user_money(id))
		{
			ColorChat(id, NORMAL, "^1[^4Dhuro Para^1]:^1Vlera parave qe shkruat eshte me e larte nga ajo qe e keni ne llogari, na vjen keq^3.");
			
			return PLUGIN_HANDLED;
		}

		cs_set_user_money(id, cs_get_user_money(id) - money_to_give);
		cs_set_user_money(target_receiver, cs_get_user_money(target_receiver) + money_to_give);

		new names[2][63];
		get_user_name(target_receiver, names[0], cm(names[]));
		get_user_name(id, names[1], cm(names));

		ColorChat(0, NORMAL, "^1[^4Dhuro Para^1]:^4%s ^1dhuroj ^4%d$ ^1per ^4%s^1.", names[1], money_to_give,  names[0]);
	
		return PLUGIN_HANDLED;	
	}
	
	return PLUGIN_CONTINUE;
}

Потребителски аватар

OciXCrom TM
Администратор
Администратор
Мнения: 5320
Регистриран: 06 окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 76 пъти
Получена благодарност: 560 пъти
Години: 21
Контакти:

Plugin shut down when try sent money

Мнение от OciXCrom TM » 07 юли 2019, 16:51

This plugin can't cause such an error. It's likely caused by a plugin that's using the message_begin function.

Отговори

Върни се в “Заявки за плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 5 госта