MultiJump Work with Time

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

MultiJump Work with Time

Мнение от lantimilan » 08 Мар 2019, 14:26

Hello i have one version from multijump its good to buy multijump with money but i want to add some thing:
1. To set file .txt in direct plugins
2. To make working to set multijump free from 22:00 -- 10:00 and after 10:00 morning normaly to buy with moeny

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <reapi>
#include <multi_jump>

#pragma semicolon 1

new const PLUGIN_VERSION[] = "1.0";

/****************************************************************************************
****************************************************************************************/

#define GetCvarDesc(%0) fmt("%l", %0)

new g_iBuyPrice;
new g_iBuyPriceSteam;
new g_iBuyJumps;

public plugin_init()
{
	register_plugin("Multi Jump: Buy", PLUGIN_VERSION, "w0w");
	register_dictionary("multi_jump_buy.ini");

	// say/say_team commands
	register_saycmd("mj", "func_BuyJumps");
	// console command
	register_clcmd("amx_buymj", "func_BuyJumps");

	new pCvar;

	pCvar = create_cvar("mj_buy_price", "30", FCVAR_NONE, GetCvarDesc("MJ_BUY_CVAR_PRICE"), true, 0.0, true, 2147483520.0);
	bind_pcvar_num(pCvar, g_iBuyPrice);

	pCvar = create_cvar("mj_buy_price_steam", "20", FCVAR_NONE, GetCvarDesc("MJ_BUY_CVAR_PRICE_STEAM"), true, 0.0, true, 2147483520.0);
	hook_cvar_change(pCvar, "hook_CvarChange_PriceSteam");

	pCvar = create_cvar("mj_buy_additional_jumps", "1", FCVAR_NONE, GetCvarDesc("MJ_BUY_CVAR_ADDITIONAL_JUMPS"), true, 1.0);
	bind_pcvar_num(pCvar, g_iBuyJumps);

	AutoExecConfig(true, "multi_jump_buy");
}

public OnConfigsExecuted()
{
	if(g_iBuyPriceSteam && !has_reunion())
		set_fail_state("Reunion is not available to use mj_buy_price_steam CVar. Set the CVar to 0 or disable the plugin.");
}

public func_BuyJumps(id)
{
	if(!func_CanBuyJumps(id))
		return PLUGIN_HANDLED;

	new iMoney;

	rg_add_account(id, -(is_user_steam(id) ? g_iBuyPriceSteam : g_iBuyPrice));

	mj_give_user_jumps(id, g_iBuyJumps);
	rg_add_account(id, -iMoney);
	client_print_color(id, print_team_default, "%l", "MJ_BUY_SUCCESS", mj_get_user_jumps(id));

	return PLUGIN_HANDLED;
}

bool:func_CanBuyJumps(id)
{
	if(!is_user_alive(id))
	{
		client_print_color(id, print_team_red, "%l", "MJ_BUY_ERROR_DEAD");
		return false;
	}

	new iMoney = get_member(id, m_iAccount);

	if(iMoney < g_iBuyPrice)
	{
		client_print_color(id, print_team_red, "%l", "MJ_BUY_ERROR_NEED_MONEY", g_iBuyPrice - iMoney);
		return false;
	}
	return true;
}

public hook_CvarChange_PriceSteam(pCvar, const szOldValue[], szNewValue[])
{
	g_iBuyPriceSteam = str_to_num(szNewValue);

	if(g_iBuyPriceSteam && !has_reunion())
		set_fail_state("Reunion is not available to use mj_buy_price_steam CVar. Set the CVar to 0 or disable the plugin.");
}

// thanks to mx?! (BlackSignature)
stock register_saycmd(szSayCmd[], szFunc[])
{
	new const szPrefix[][] = { "say /", "say_team /", "say .", "say_team ." };

	for(new i, szTemp[MAX_NAME_LENGTH]; i < sizeof(szPrefix); i++)
	{
		formatex(szTemp, charsmax(szTemp), "%s%s", szPrefix[i], szSayCmd);
		register_clcmd(szTemp, szFunc);
	}
}


File .txt

Код за потвърждение: Избери целия код

[en]
MJ_BUY_SUCCESS = ^4* ^1You've successfully done the purchase. Your jumps: ^4%d
MJ_BUY_ERROR_DEAD = ^3* ^1You're dead and can't do the purchase
MJ_BUY_ERROR_NEED_MONEY = ^3* ^1You need ^4%d$ ^1to do the purchase

  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Google [Bot] и 5 госта