VIP Boost Банери Кредити
Основно Начало Сървъри Marketplace Новини Форум Сървъри
Общности Хостинг Добави Boost
Ресурси
Библиотеки Карти Видеа Магазин
Инструменти
Builder Demo CFG HUD
AMXX API
Вход Регистрация
/ Библиотеки / hnsxp_stocks.inc

hnsxp_stocks.inc

.inc 1.3 KB 53 реда 04.04.2026
Pawn / AMX Mod X
#if defined _hnsxp_stocks_included
	#endinput
#endif
#define _hnsxp_stocks_included

/*
 * Calculates the XP required to buy a certain item's level
 * 
 * @param		first_xp - The xp required for the first level
 * @param		interval - The interval between levels
 * @param		level - The level to find xp required
 * 
 * @return		Returns the XP required.
 * 
 */
stock hnsxp_calculate_xp(const first_xp, const interval, const level)
{
	if( level == 0 )
	{
		return 0;
	}
	
	new xp = first_xp;
	if( interval == XP_INTERVAL_EXPONENTIAL )
	{
		xp *= (1 << (level - 1));
	}
	else if( interval != XP_INTERVAL_NONE && interval > 0 )
	{
		xp += (interval * (level - 1));
	}
	
	return xp;
}

/* 
 * Calculates the value of the item based on the current level, max level, and max value.
 * 
 * @param		level - The level of which the value is being found
 * @param		max_level - The maximum level of the item
 * @param		max_value - The value acquired on the maximum level
 * 
 * @return		The value of the item for the given level
 * 
 */
stock hnsxp_calculate_value(const level, const max_level, const max_value)
{
	return (max_value * level / max_level);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang11274\\ f0\\ fs16 \n\\ par }
*/
РЕКЛАМИРАЙ ПРИ НАС!
AMXX-BG.INFO
КАК ДА ИЗПОЛЗВАМ
Добави в началото на .sma файла:
#include <hnsxp_stocks>
1. Изтегли
Свали файла от бутона по-горе
2. Копирай
Постави в scripting/include/
3. Включи
Добави #include директивата
4. Компилирай
Използвай amxxpc или scripting/compile.exe