Грешка при компилиране на furienmod_core

Въпроси и проблеми свързани с AMXModX.
Заключена
Потребителски аватар

Автор на темата
g0gIch Beg
Потребител
Потребител
Мнения: 164
Регистриран: 20 юли 2017, 17:29
Се отблагодари: 9 пъти
Получена благодарност: 3 пъти
Години: 16

Грешка при компилиране на furienmod_core

Мнение от g0gIch Beg » 08 фев 2019, 21:49

Не мога да компилирам нито локално под 1.8.1/2/3 и 1.9.x, нито онлайн. Явно е грешка в кода.

Грешката:

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

undefined symbol "client_print_color"

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

#include <amxmodx>
#include <dhudmessage>
#include <fakemeta>
#include <engine>
#include <hamsandwich>

new const PLUGIN[] = "Furrien Mod: Core";
new const VERSION[] = "2.0";
new const AUTHOR[] = "6u3oH";

const TEAM_TT = 1;
const TEAM_CT = 2;
const TEAM_FURRIEN = 0;
const TEAM_ALLIANCE = 1;
const OFFSET_CURRENT_ITEM = 41;
const OFFSET_ENT_PLAYER = 4;
const OFFSET_MONEY = 115;
const OFFSET_AMMO = 5;
const TASK_SPEED_CHECK = 0x11;
const TASK_CREATE_FOG = 0x12;
const SHOP_ITEMS_LIMIT = 32;
const SHOP_ITEMS_LEN = 64;
const FURRIEN_CLASS_MAX = 8;
const FURRIEN_MENU_LEN = 32;
const FURRIEN_MENU_LEN2 = 128;
const pDataKey_iPlayerItems = 367;
const pData_Player = 5;
const pDataKey_iNext = 42;
const pDataKey_iId = 43;
const OFFSET_KILLHEAD = 75;
const DMG_GRENADE = (1<<24);

// Ядро
new HamHook: g_iFwdBuyZone, g_iMsgFog, g_iMsgMoney, g_iMainMenu, g_iFwdAbility;
new g_iIsFurrienTeam, g_iMaxPlayers, g_iFurrienWin, g_iAllianceWin, g_iWeaponGunsMenu, g_iWeaponPistolsMenu;
new g_iInvisAmmount[33], g_iTypeSelectWeapon[33], g_iColorMsgHud[3] = {255, 255, 255};
new bool: g_bIsFurrien[33], bool: g_bIsBlockSpeed[33];
new g_sName[33][32], g_sTeam[33][16], g_sAddInfo[33][64];
//
const Float: FURRIEN_SPEED = 680.0; // Скорость фурий
const Float: FURRIEN_GRAVITY = 0.405; // Гравитация фурий
new const MODEL_ALLIANCE[] = "alliance"; // ИМЯ: models/player/ИМЯ/ИМЯ.mdl (модель альянса)
new const SOUND_WIN_FURRIEN[] = "furrien_mode/furrien_win"; // Звук победы фуррий
new const SOUND_WIN_ALLIANCE[] = "furrien_mode/alliance_win"; // Звук победы фуррий
const VIP_FLAG = ADMIN_LEVEL_H; // Флаг випа
new const FOG_MODE = 1; // Режим тумана (0 - отключить, 1 - включить)

// Магазин
new g_iShopMenu_Furrien, g_iShopMenu_Alliance;
new g_iNumItem_Furrien, g_iNumItem_Alliance;
new g_sShopNameItems_Furrien[SHOP_ITEMS_LIMIT][SHOP_ITEMS_LEN], g_sShopNameItems_Alliance[SHOP_ITEMS_LIMIT][SHOP_ITEMS_LEN];
new g_iShopCostItems_Furrien[SHOP_ITEMS_LIMIT], g_iShopCostItems_Alliance[SHOP_ITEMS_LIMIT];
new g_iShopFwdItems_Furrien[SHOP_ITEMS_LIMIT], g_iShopFwdItems_Alliance[SHOP_ITEMS_LIMIT];
new g_iShopLimit_Furrien[SHOP_ITEMS_LIMIT], g_iShopLimit_Alliance[SHOP_ITEMS_LIMIT];
new g_iLimit_Furrien[33][SHOP_ITEMS_LIMIT], g_iLimit_Alliance[33][SHOP_ITEMS_LIMIT];
//
new const SHOP_PREFIX[] = "Магазин"; // Префикс

// Классы
new g_iFurrienClassNum[33], g_iFurrienClassChoose[33];
new g_iFurrienClassFlag[FURRIEN_CLASS_MAX];
new g_sFurrienClassName[FURRIEN_CLASS_MAX][FURRIEN_MENU_LEN];
new g_sFurrienClassInfo[FURRIEN_CLASS_MAX][FURRIEN_MENU_LEN2];
new g_sFurrienClassModel[FURRIEN_CLASS_MAX][FURRIEN_MENU_LEN];
new g_iFurrienClassCount, g_iFurrienClassMenu;

// Уровни
new g_iAllianceLvlNum[33], g_iAllianceKillNum[33];
//
const MAX_LVL = 10; // Максимальное кол-во уровней
new const PATH_DATABASE[] = "addons/amxmodx/data/lvl.dat";
new const LVL_KILLS[] = {0, 55, 310, 985, 1705, 3600, 5965, 8760, 10870, 12999}; // Кол-во убийств для переходов на следующие уровни
const POINT_KILL = 1; // Сколько килл-поинтов давать за простое убийство
const POINT_KILL_HEAD = 2; // Сколько килл-поинтов давать за убийство в голову
const POINT_KILL_KNIFE = 3; // Сколько килл-поинтов давать за убийство ножом
const POINT_KILL_GRENADE = 4; // Сколько килл-поинтов давать за убийство гранатой

// Замораживающая граната
new g_iSpriteBeam, g_iMsgScreenFade, g_iModelGlassGibs;
new g_iEntFrostBlock[33];
new Float: g_fCurSpeed[33], Float: g_fCurGravity[33];
//
new const MODEL_FROST_BLOCK[] = "models/furrien_mode/frost_block.mdl";
new const MODEL_FROST_BLOCK_DESTRUCTION[] = "models/furrien_mode/frost_destruction.mdl";
new const SOUND_FROST_EXPLODE[] = "furrien_mode/frost_explode.wav";
new const SOUND_FROST_DESTRUCTION[] = "furrien_mode/frost_explode.wav";
const Float: DIST_FROST_NORMAL = 200.0; // Дистанция для обычной заморозки (юниты от эпицентра)
const Float: DIST_FROST_LONG = 100.0; // Дистанция для длительной заморозки (юниты от эпицентра)
const Float: TIME_FROST_NORMAL = 3.0; // Время обычной заморозки
const Float: TIME_FROST_LONG = 6.0; // Время длительной заморозки
const Float: SPEED_FROST_NORMAL = 50.0; // Скорость для игрока при обычной заморозке
const Float: SPEED_FROST_LONG = -1.0; // Скорость для игрока при длительной заморозке
const Float: DAMAGE_FROST_NORMAL = 3.0; // Урон игроку при обычной заморозке
const Float: DAMAGE_FROST_LONG = 7.0; // Урон игроку при длительной заморозке

public plugin_precache()
{
	if(!g_iFwdBuyZone)
		g_iFwdBuyZone = RegisterHam(Ham_Spawn, "func_buyzone", "fwdHam_SpawnBuyZone_Pre");
	
	static sPath[256];
	
	format(sPath, charsmax(sPath), "models/player/%s/%s.mdl", MODEL_ALLIANCE, MODEL_ALLIANCE);
	precache_model(sPath);
	
	format(sPath, charsmax(sPath), "%s.wav", SOUND_WIN_FURRIEN);
	precache_sound(sPath);
	
	format(sPath, charsmax(sPath), "%s.wav", SOUND_WIN_ALLIANCE);
	precache_sound(sPath);
	
	precache_model(MODEL_FROST_BLOCK);
	precache_model(MODEL_FROST_BLOCK_DESTRUCTION);
	precache_sound(SOUND_FROST_EXPLODE);
	precache_sound(SOUND_FROST_DESTRUCTION);
	g_iSpriteBeam = precache_model("sprites/zbeam3.spr");
	g_iModelGlassGibs = precache_model("models/glassgibs.mdl");
}

public plugin_init()
{
	DisableHamForward(g_iFwdBuyZone);
	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_event("StatusValue", "Event_ShowStatus", "be", "1=2", "2!0");
	register_event("StatusValue", "Event_HideStatus", "be", "1=1", "2=0");
	register_event("TextMsg", "Event_GameRestart", "a", "2&#Game_C");
	register_event("TextMsg", "Event_GameRestart", "a", "2&#Game_will_restart_in");
	register_event("SendAudio", "Event_RoundDraw", "a", "2=%!MRAD_rounddraw");
	register_event("SendAudio", "Event_TerroristWin", "a","2=%!MRAD_terwin");
	register_event("SendAudio", "Event_CTWin", "a", "2=%!MRAD_ctwin");
	register_event("HLTV", "Event_RoundStart", "a", "1=0", "2=0");
	register_event("BarTime", "Event_BombPlanting", "b", "1=0");
	register_event("BarTime", "Event_BombDefusing", "be", "1=5", "1=10", "1=3");
	register_logevent("Event_RoundStart_AfterFreeze", 2, "1=Round_Start");
	
	RegisterHam(Ham_Spawn, "player", "fwHam_SpawnPlayer_Post", true);
	RegisterHam(Ham_Killed, "player", "fwHam_KilledPlayer_Post", true);
	RegisterHam(Ham_Item_PreFrame, "player", "fwHam_ResetSpeedPlayer_Pre");
	RegisterHam(Ham_TakeDamage, "player", "fwHam_TakeDamagePlayer_Pre");
	
	RegisterHam(Ham_Touch, "armoury_entity", "fwHam_TouchWeapon_Pre");
	RegisterHam(Ham_Touch, "weaponbox", "fwHam_TouchWeapon_Pre");
	
	register_forward(FM_SetClientKeyValue, "fwd_SetClientKeyValue_Pre");
	register_forward(FM_PlayerPreThink, "fwd_ThinkPlayer_Pre");
	register_forward(FM_AddToFullPack, "fwd_AddToFullPack_Post", true);
	register_forward(FM_ClientUserInfoChanged, "fwClientUserInfoChanged_Post", true);
	register_forward(FM_SetModel, "fwd_SetModel_Post", true);
	
	register_think("grenade", "Think_Grenade");
	register_think("frost_grenade", "Think_FrostGrenade");
	
	register_clcmd("nightvision", "Clcmd_MainMenu");
	register_clcmd("say /shop", "Clcmd_ShopMenu");
	register_clcmd("say_team /shop", "Clcmd_ShopMenu");
	register_clcmd("shop", "Clcmd_ShopMenu");
	register_clcmd("say /class", "Clcmd_ChooseMenuFurrien");
	register_clcmd("say_team /class", "Clcmd_ChooseMenuFurrien");
	register_clcmd("classes_menu", "Clcmd_ChooseMenuFurrien");
	register_clcmd("drop", "Clcmd_Drop");
	
	g_iFwdAbility = CreateMultiForward("ActiveAbility", ET_IGNORE, FP_CELL)
	g_iShopMenu_Furrien = menu_create("\yМагазин для \rфурий", "ShopMenuFurrien_Handler");
	g_iShopMenu_Alliance = menu_create("\yМагазин для \rальянса", "ShopMenuAlliance_Handler");
	g_iFurrienClassMenu = menu_create("\yКлассы \rфурий", "ChooseMenuFurrien_Handler");
	
	g_iMaxPlayers = get_maxplayers();
	g_iMsgFog = get_user_msgid("Fog");
	g_iMsgMoney = get_user_msgid("Money")
	g_iMsgScreenFade = get_user_msgid("ScreenFade");
	
	set_task(2.0, "Task_Show_HudMsg", .flags = "b");
	
	server_cmd("sv_airaccelerate 9999");
	server_cmd("mp_playerid 2");
	write_file(PATH_DATABASE, "[Furrien Mod] Lvl Data Base [by 6u3oH]", 0);
	
	CreateMainMenu();
	CreateWeaponGunsMenu();
	CreateWeaponPistolsMenu();
}

public client_disconnect(id)
{
	if(FOG_MODE)
		remove_task(id + TASK_CREATE_FOG);
	
	if(is_valid_ent(g_iEntFrostBlock[id]))
	{
		reset_block_speed(id);
		entity_set_int(g_iEntFrostBlock[id], EV_INT_flags, entity_get_int(g_iEntFrostBlock[id], EV_INT_flags) | FL_KILLME);
	}
	
	save_lvl(id);
}

public client_putinserver(id)
{
	get_user_name(id, g_sName[id], 31);
	
	if(FOG_MODE)
		set_task(0.5, "Task_CheckPlayerValid", id + TASK_CREATE_FOG, .flags = "b");
	
	if(g_iFurrienClassCount > 0)
		g_iFurrienClassNum[id] = random_num(0, g_iFurrienClassCount);
		
	get_lvl(id);
}

public Task_CheckPlayerValid(iTask)
{
	new id = iTask - TASK_CREATE_FOG;
	
	if(!is_user_connected(id))
		return;
	
	fog_create(id);
	remove_task(iTask);
}

public fwdHam_SpawnBuyZone_Pre(iEnt)
{
	if(!is_valid_ent(iEnt))
		return HAM_IGNORED;
		
	return HAM_SUPERCEDE;
}

public Event_RoundStart()
{
	for(new id = 1; id < g_iMaxPlayers; id++)
	{
		for(new i; i < SHOP_ITEMS_LIMIT; i++)
		{
			g_iLimit_Furrien[id][i] = g_iShopLimit_Furrien[i];
			g_iLimit_Alliance[id][i] = g_iShopLimit_Alliance[i];
		}
	
		g_bIsBlockSpeed[id] = true;
	}
}

public Event_RoundStart_AfterFreeze()
{
	for(new id = 1; id < g_iMaxPlayers; id++)
	{
		g_bIsBlockSpeed[id] = false;
		
		if(!is_user_alive(id))
			continue;
			
		if(g_bIsFurrien[id])
			entity_set_float(id, EV_FL_maxspeed, FURRIEN_SPEED);
		else
			ExecuteHamB(Ham_Item_PreFrame, id);
	}
}

public Event_ShowStatus(id)
{
	new iPlayer = read_data(2);
	
	if(!is_user_connected(iPlayer))
		return;
	
	static sInfo[64];
	
	if(get_user_team(id) == get_user_team(iPlayer))
	{
		set_hudmessage(0, 255, 0, -1.0, 0.55, 0, 0.1, 5.0, 0.1, 0.1, 2);
		format(sInfo, charsmax(sInfo), "Статус: союзник^n[%i HP | %i AP]", get_user_health(iPlayer), get_user_armor(iPlayer));
	}else{
		if(g_iInvisAmmount[iPlayer] != 255)
			return;
		
		set_hudmessage(255, 0, 0, -1.0, 0.55, 0, 0.1, 5.0, 0.1, 0.1, 2);
		format(sInfo, charsmax(sInfo), "Статус: противник");
	}
	
	show_hudmessage(id, "Игрок: %s^nКоманда: %s^n%s", g_sName[iPlayer], g_sTeam[iPlayer], sInfo);
}

public Event_HideStatus(id)
{	
	set_hudmessage(255, 255, 255, -1.0, 0.60, 0, 0.0, 0.0, 0.0, 0.0, 2);
	show_hudmessage(id, "");
}

public fwHam_SpawnPlayer_Post(id)
{
	if(!is_user_connected(id))
		return;
	
	if(get_user_team(id) == g_iIsFurrienTeam)
	{
		g_bIsFurrien[id] = true;
		
		fm_strip_user_weapons(id);
		fm_give_item(id, "weapon_knife");
		
		if(g_bIsBlockSpeed[id])
			entity_set_float(id, EV_FL_maxspeed, -1.0);
		else
			entity_set_float(id, EV_FL_maxspeed, FURRIEN_SPEED);
		entity_set_float(id, EV_FL_gravity, FURRIEN_GRAVITY);
		
		if(g_iFurrienClassNum[id] != g_iFurrienClassChoose[id])
		{
			g_iFurrienClassNum[id] = g_iFurrienClassChoose[id];
			client_print_color(id, print_team_default, "^1[^4Классы фурий^1] Выбранный ^3класс: ^4%s", g_sFurrienClassName[g_iFurrienClassNum[id]]);
			client_print_color(id, print_team_default, "^1[^4Классы фурий^1] Описание: ^4%s", g_sFurrienClassInfo[g_iFurrienClassNum[id]]);
		}
		
		format(g_sTeam[id], 15, "Фурии");
		format(g_sAddInfo[id], 63, "Класс: %s", g_sFurrienClassName[g_iFurrienClassNum[id]]);
	}else{
		g_bIsFurrien[id] = false;
		
		fm_strip_user_weapons(id);
		fm_give_item(id, "weapon_knife");
		
		g_iTypeSelectWeapon[id] = 0;
		menu_display(id, g_iWeaponGunsMenu);
		
		entity_set_float(id, EV_FL_health, entity_get_float(id, EV_FL_health) + (g_iAllianceLvlNum[id]*2));
		
		if(g_bIsBlockSpeed[id])
			entity_set_float(id, EV_FL_maxspeed, -1.0);
			
		format(g_sTeam[id], 15, "Альянс");
		
		if(g_iAllianceLvlNum[id] == MAX_LVL-1)
			format(g_sAddInfo[id], 63, "Уровень: MAX");
		else
			format(g_sAddInfo[id], 63, "Уровень: %i [%i/%i]", g_iAllianceLvlNum[id]+1, g_iAllianceKillNum[id], LVL_KILLS[g_iAllianceLvlNum[id]+1]);
	}
	
	fm_set_user_model(id, "null");
}

public fwHam_KilledPlayer_Post(iVictim, iAttacker, iCorpse)
{
	if(!is_user_connected(iVictim))
		return;
	
	if(is_valid_ent(g_iEntFrostBlock[iVictim]))
	{
		reset_ent_render(iVictim);
		reset_screen_fade(iVictim);
		reset_block_speed(iVictim);
		entity_set_int(g_iEntFrostBlock[iVictim], EV_INT_flags, entity_get_int(g_iEntFrostBlock[iVictim], EV_INT_flags) | FL_KILLME);
	}
		
	g_iInvisAmmount[iVictim] = 255;
	
	if(!is_user_connected(iAttacker))
		return;
	
	if(g_bIsFurrien[iAttacker])
		return;
	
	if(iVictim == iAttacker)
		return;
		
	if(get_pdata_int(iVictim, pData_Player) & DMG_GRENADE)
		g_iAllianceKillNum[iAttacker] += POINT_KILL_GRENADE;
	else if(iAttacker == entity_get_edict(iVictim, EV_ENT_dmg_inflictor) && get_user_weapon(iAttacker) == CSW_KNIFE)
		g_iAllianceKillNum[iAttacker] += POINT_KILL_KNIFE;
	else if(get_pdata_int(iVictim, OFFSET_KILLHEAD, pData_Player) == HIT_HEAD)
		g_iAllianceKillNum[iAttacker] += POINT_KILL_HEAD;
	else
		g_iAllianceKillNum[iAttacker] += POINT_KILL;
		
	CheckLvl(iAttacker);
}

public fwHam_ResetSpeedPlayer_Pre(id)
{	
	if(!is_user_connected(id))
		return HAM_IGNORED;
	
	if(g_bIsFurrien[id])
		return HAM_SUPERCEDE;
		
	if(g_bIsBlockSpeed[id])
		return HAM_SUPERCEDE;
		
	return HAM_IGNORED;
}

public fwHam_TakeDamagePlayer_Pre(iVictim, iInflictor, iAttacker, Float: fDamage, iDmgBit)
{
	if(!is_user_connected(iAttacker))
		return;
		
	if(g_bIsFurrien[iAttacker])
		return;
		
	SetHamParamFloat(4, fDamage + g_iAllianceLvlNum[iAttacker]);
}

public fwd_SetClientKeyValue_Pre(id, const szInfobuffer[], const szKey[])
{
	if(equal(szKey, "model"))
	{
		if(g_bIsFurrien[id])
			fm_set_user_model(id, g_sFurrienClassModel[g_iFurrienClassNum[id]]);
		else
			fm_set_user_model(id, MODEL_ALLIANCE);

		return FMRES_SUPERCEDE;
	}

	return FMRES_IGNORED;
}

public fwd_ThinkPlayer_Pre(id)
{
	if(!is_user_alive(id))
		return;
	
	static Float: fVelocity[3], Float: fCurSpeed;
	entity_get_vector(id, EV_VEC_velocity, fVelocity);
	fCurSpeed = vector_length(fVelocity);
	
	if(fCurSpeed > 0)
		g_iInvisAmmount[id] = 255;
	else
	{
		static iButton; iButton = entity_get_int(id, EV_INT_button);
		
		if(iButton & IN_DUCK && fCurSpeed > 0)
			g_iInvisAmmount[id] = 150;
		else
			g_iInvisAmmount[id] = 0
	}
}

public fwd_AddToFullPack_Post(es, e, ent, host, hostflags, player, pSet)
{
	if(!player)
		return;
		
	if(!is_user_connected(host))
		return;
		
	if(!is_user_alive(e))
		return;
		
	if(!g_bIsFurrien[e])
		return;

	if(get_user_team(host) == get_user_team(e))
		return;
		
	set_es(es, ES_RenderMode, kRenderTransAlpha);
	set_es(es, ES_RenderAmt, g_iInvisAmmount[e]);
}

public fwClientUserInfoChanged_Post(id, sBuffer)
{
	if(!is_user_connected(id))
		return;
		
	get_user_name(id, g_sName[id], 31);
}

public Event_GameRestart()
{
	g_iIsFurrienTeam = random_num(TEAM_TT, TEAM_CT);
			
	if(g_iIsFurrienTeam == TEAM_TT)		
		g_iColorMsgHud = {255, 0, 0};
	else if(g_iIsFurrienTeam == TEAM_CT)
		g_iColorMsgHud = {0, 255, 0};
}

public fwHam_TouchWeapon_Pre(iWeapon, id)
{
	if(!is_user_connected(id))
		return HAM_IGNORED;
		
	if(!g_bIsFurrien[id])
		return HAM_IGNORED;
	
	static sModel[32];
	entity_get_string(iWeapon, EV_SZ_model, sModel, charsmax(sModel));

	if(equal(sModel, "models/w_backpack.mdl"))
		return HAM_IGNORED;
	
	return HAM_SUPERCEDE;
}

public Event_BombPlanting(id)
{	
	if(!g_bIsFurrien[id])
		return;
	
	if(!task_exists(id + TASK_SPEED_CHECK))
		set_task(1.0, "Task_Speed_Reset", id + TASK_SPEED_CHECK);
}

public Event_BombDefusing(id)
{
	if(!g_bIsFurrien[id])
		return;
	
	if(!task_exists(id + TASK_SPEED_CHECK))
		set_task(1.0, "Task_Speed_Reset", id + TASK_SPEED_CHECK);
}

public Task_Speed_Reset(id)
{
	id -= TASK_SPEED_CHECK;
	
	if(!is_user_alive(id))
		return;
	
	entity_set_float(id, EV_FL_maxspeed, FURRIEN_SPEED);
}

public Event_RoundDraw()
{
	furrien_info_score(-1);
}

public Event_TerroristWin()
{
	furrien_info_score(TEAM_TT);
}

public Event_CTWin()
{
	furrien_info_score(TEAM_CT);
}

public furrien_info_score(iTeamWin)
{
	if(iTeamWin == -1)
	{			
		g_iIsFurrienTeam = random_num(TEAM_TT, TEAM_CT);
		
		if(g_iIsFurrienTeam == TEAM_TT)
			g_iColorMsgHud = {255, 0, 0};
		else if(g_iIsFurrienTeam == TEAM_CT)
			g_iColorMsgHud = {0, 255, 0};
	}
	else
	{
		if(g_iIsFurrienTeam == iTeamWin)
		{
			g_iColorMsgHud = {255, 0, 0};
			g_iFurrienWin++;
			
			client_cmd(0, "spk %s", SOUND_WIN_FURRIEN);
			
			set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.20, 0, 0.1, 5.0, 0.1, 0.1, false);
			show_dhudmessage(0, "Фурии разгромили альянс");
		}else{
			g_iColorMsgHud = {0, 255, 0};
			g_iAllianceWin++;
			
			client_cmd(0, "spk %s", SOUND_WIN_ALLIANCE);
			
			set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.20, 0, 0.1, 5.0, 0.1, 0.1, false);
			show_dhudmessage(0, "Альянс сдержал фурий");
		}
		
		g_iIsFurrienTeam = iTeamWin;
	}
}

public Clcmd_MainMenu(id)
{
	if(!is_user_connected(id))
		return;
		
	menu_display(id, g_iMainMenu);
}

public Clcmd_ShopMenu(id)
{
	if(!is_user_connected(id))
		return;
	
	if(g_bIsFurrien[id])
		menu_display(id, g_iShopMenu_Furrien);
	else
		menu_display(id, g_iShopMenu_Alliance);
}

public ShopMenuFurrien_Handler(id, iMenu, iItem)
{
	if(!is_user_connected(id))
		return;	

	if(iItem == MENU_EXIT)
		return;

	if(!g_iLimit_Furrien[id][iItem])
	{
		client_print_color(id, print_team_default, "^1[^4%s^1] Лимит покупки в этом раунде исчерпан", SHOP_PREFIX);
		return;
	}
		
	new iMoney = fm_get_user_money(id);
	if(iMoney < g_iShopCostItems_Furrien[iItem])
	{
		client_print_color(id, print_team_default, "^1[^4%s^1] У вас не хватает денег для покупки этого предмета", SHOP_PREFIX);
		return;
	}
	
	new bool: bIsResult;
	ExecuteForward(g_iShopFwdItems_Furrien[iItem], bIsResult, id);
	
	if(!bIsResult)
		return;
	
	if(g_iLimit_Furrien[id][iItem] != -1)
		g_iLimit_Furrien[id][iItem]--;
	
	client_print_color(id, print_team_default, "^1[^4%s^1] Вы купили: ^4%s", SHOP_PREFIX, g_sShopNameItems_Furrien[iItem]);
	fm_set_user_money(id, iMoney - g_iShopCostItems_Furrien[iItem]);
	menu_display(id, g_iShopMenu_Furrien);
}

public ShopMenuAlliance_Handler(id, iMenu, iItem)
{
	if(!is_user_connected(id))
		return;	

	if(iItem == MENU_EXIT)
		return;
		
	if(!g_iLimit_Alliance[id][iItem])
	{
		client_print_color(id, print_team_default, "^1[^4%s^1] Лимит покупки в этом раунде исчерпан", SHOP_PREFIX);
		return;
	}

	new iMoney = fm_get_user_money(id);
	if(iMoney < g_iShopCostItems_Alliance[iItem])
	{
		client_print_color(id, print_team_default, "^1[^4%s^1] У вас не хватает денег для покупки этого предмета", SHOP_PREFIX);
		return;
	}
	
	new bool: bIsResult;
	ExecuteForward(g_iShopFwdItems_Alliance[iItem], bIsResult, id);
	
	if(!bIsResult)
		return;
	
	if(g_iLimit_Alliance[id][iItem] != -1)
		g_iLimit_Alliance[id][iItem]--;
	
	client_print_color(id, print_team_default, "^1[^4%s^1] Вы купили: ^4%s", SHOP_PREFIX, g_sShopNameItems_Alliance[iItem]);
	fm_set_user_money(id, iMoney - g_iShopCostItems_Alliance[iItem]);
	menu_display(id, g_iShopMenu_Alliance);
}

public Clcmd_ChooseMenuFurrien(id)
{
	if(!is_user_connected(id))
		return;
		
	menu_display(id, g_iFurrienClassMenu);
}

public ChooseMenuFurrien_Handler(id, iMenu, iItem)
{
	if(!is_user_connected(id))
		return;
	
	if(iItem == MENU_EXIT)
		return;
	
	if(g_iFurrienClassNum[id] == iItem)
	{
		client_print_color(id, print_team_default, "^1[^4Классы фурий^1] Выбранный ^4класс ^1является вашим ^3текущим");
		return;
	}
	
	if(~get_user_flags(id) & g_iFurrienClassFlag[iItem] && g_iFurrienClassFlag[iItem] != -1)
	{
		client_print_color(id, print_team_default, "^1[^4Классы фурий^1] Выбранный ^4класс ^1вам ^3недоступен");
		return;		
	}
	
	g_iFurrienClassChoose[id] = iItem;
	client_print_color(id, print_team_default, "^1[^4Классы фурий^1] Класс ^3будет сменён ^1при ^3возрождении ^1в виде ^4фурии");
}

public Task_Show_HudMsg()
{
	set_hudmessage(0, 255, 0, 0.01, 0.17, 0, 0.1, 2.0, 0.1, 0.1, 1);
	set_dhudmessage(g_iColorMsgHud[0], g_iColorMsgHud[1], g_iColorMsgHud[2], -1.0, 0.01, 0, 0.1, 2.0, 0.1, 0.1, false);
	
	for(new id = 1; id <= g_iMaxPlayers; id++)
	{
		if(!is_user_alive(id))
			continue;
		
		show_hudmessage(id, "Имя: %s^nКоманда: %s^n%s", g_sName[id], g_sTeam[id], g_sAddInfo[id]);
		show_dhudmessage(0, "Фурии [%i] vs Альянс [%i]", g_iFurrienWin, g_iAllianceWin);
	}
}

public CreateMainMenu()
{
	g_iMainMenu = menu_create("\yГлавное меню", "MainMenu_Handler");
	
	menu_additem(g_iMainMenu, "\wВыбор оружия");
	menu_additem(g_iMainMenu, "\wВыбор класса фурии");
	menu_additem(g_iMainMenu, "\wМагазин");
	
	menu_setprop(g_iMainMenu, MPROP_EXITNAME, "Выход");
	menu_setprop(g_iMainMenu, MPROP_BACKNAME, "Назад");
	menu_setprop(g_iMainMenu, MPROP_NEXTNAME, "Далее");
}

public MainMenu_Handler(id, iMenu, iItem)
{
	if(!is_user_connected(id))
		return;
		
	switch(iItem)
	{
		case 0:
		{
			if(g_bIsFurrien[id])
			{
				client_print_color(id, print_team_default, "^4Выбор оружия ^1только для ^3альянса");
				return;
			}
		
			if(!is_user_alive(id))
			{
				client_print_color(id, print_team_default, "^4Выбор оружия ^1только для ^3живых");
				return;
			}
			
			switch(g_iTypeSelectWeapon[id])
			{
				case 0: menu_display(id, g_iWeaponGunsMenu);
				case 1: menu_display(id, g_iWeaponPistolsMenu);
				case 2: client_print_color(id, print_team_default, "^1Вы уже выбирали ^4оружие");
			}
		}
		
		case 1: Clcmd_ChooseMenuFurrien(id);
		case 2: Clcmd_ShopMenu(id);
	}
}

public CreateWeaponGunsMenu()
{
	g_iWeaponGunsMenu = menu_create("\yМеню оружия^n\rВыбор основного оружия\w", "WeaponGunsMenu_Handler");
	
	menu_additem(g_iWeaponGunsMenu, "M3");
	menu_additem(g_iWeaponGunsMenu, "Xm1014");
	menu_additem(g_iWeaponGunsMenu, "Mp5Navy");
	menu_additem(g_iWeaponGunsMenu, "P90");
	menu_additem(g_iWeaponGunsMenu, "Famas");
	menu_additem(g_iWeaponGunsMenu, "Galil");	
	menu_additem(g_iWeaponGunsMenu, "Scout");
	menu_additem(g_iWeaponGunsMenu, "M4a1 \d[\yVIP\d]");
	menu_additem(g_iWeaponGunsMenu, "AK-47 \d[\yVIP\d]");
	menu_additem(g_iWeaponGunsMenu, "AWP \d[\yVIP\d]");
	menu_additem(g_iWeaponGunsMenu, "M249 \d[\yVIP\d]");	
	
	menu_setprop(g_iWeaponGunsMenu, MPROP_EXITNAME, "Выход");
	menu_setprop(g_iWeaponGunsMenu, MPROP_BACKNAME, "Назад");
	menu_setprop(g_iWeaponGunsMenu, MPROP_NEXTNAME, "Далее");	
}

public WeaponGunsMenu_Handler(id, iMenu, iItem)
{
	if(!is_user_alive(id))
		return;
	
	if(iItem == MENU_EXIT)
		return;

	fm_drop_weapon(id, 1);
	
	switch(iItem)
	{
		case 0: fm_give_item(id, "weapon_m3"), fm_set_user_bpammo(id, CSW_M3, 32);
		case 1: fm_give_item(id, "weapon_xm1014"), fm_set_user_bpammo(id, CSW_XM1014, 32);
		case 2: fm_give_item(id, "weapon_mp5navy"), fm_set_user_bpammo(id, CSW_MP5NAVY, 120);
		case 3: fm_give_item(id, "weapon_p90"), fm_set_user_bpammo(id, CSW_P90, 100);
		case 4: fm_give_item(id, "weapon_famas"), fm_set_user_bpammo(id, CSW_FAMAS, 90);
		case 5: fm_give_item(id, "weapon_galil"), fm_set_user_bpammo(id, CSW_GALIL, 90);
		case 6: fm_give_item(id, "weapon_scout"), fm_set_user_bpammo(id, CSW_SCOUT, 90);
		case 7:
		{
			if(get_user_flags(id) & VIP_FLAG)
			{
				fm_give_item(id, "weapon_m4a1");
				fm_set_user_bpammo(id, CSW_M4A1, 90);
			}else{
				client_print_color(id, print_team_default, "^1Доступно только для ^4VIP");
				return;
			}
		}
		case 8:
		{
			if(get_user_flags(id) & VIP_FLAG)
			{
				fm_give_item(id, "weapon_ak47");
				fm_set_user_bpammo(id, CSW_AK47, 90);
			}else{
				client_print_color(id, print_team_default, "^1Доступно только для ^4VIP");
				return;
			}
		}
		case 9:
		{
			if(get_user_flags(id) & VIP_FLAG)
			{
				fm_give_item(id, "weapon_awp");
				fm_set_user_bpammo(id, CSW_AWP, 30);
			}else{
				client_print_color(id, print_team_default, "^1Доступно только для ^4VIP");
				return;
			}
		}
		case 10:
		{
			if(get_user_flags(id) & VIP_FLAG)
			{
				fm_give_item(id, "weapon_m249");
				fm_set_user_bpammo(id, CSW_M249, 200);
			}else{
				client_print_color(id, print_team_default, "^1Доступно только для ^4VIP");
				return;
			}
		}
	}
	
	g_iTypeSelectWeapon[id]++;
	menu_display(id, g_iWeaponPistolsMenu);
}

public CreateWeaponPistolsMenu()
{
	g_iWeaponPistolsMenu = menu_create("\yМеню оружия^n\rВыбор дополнительного оружия\w", "WeaponPistolsMenu_Handler");
	
	menu_additem(g_iWeaponPistolsMenu, "Glock");
	menu_additem(g_iWeaponPistolsMenu, "Usp");
	menu_additem(g_iWeaponPistolsMenu, "P228");
	menu_additem(g_iWeaponPistolsMenu, "Fiveseven");
	menu_additem(g_iWeaponPistolsMenu, "Deagle \d[\yVIP\d]");
	menu_additem(g_iWeaponPistolsMenu, "Elite \d[\yVIP\d]");

	menu_setprop(g_iWeaponPistolsMenu, MPROP_EXITNAME, "Выход");
	menu_setprop(g_iWeaponPistolsMenu, MPROP_BACKNAME, "Назад");
	menu_setprop(g_iWeaponPistolsMenu, MPROP_NEXTNAME, "Далее");
}

public WeaponPistolsMenu_Handler(id, iMenu, iItem)
{
	if(!is_user_alive(id))
		return;
	
	if(iItem == MENU_EXIT)
		return;

	fm_drop_weapon(id, 2);
	
	switch(iItem)
	{
		case 0: fm_give_item(id, "weapon_glock18"), fm_set_user_bpammo(id, CSW_GLOCK18, 120);
		case 1: fm_give_item(id, "weapon_usp"), fm_set_user_bpammo(id, CSW_USP, 100);
		case 2: fm_give_item(id, "weapon_p228"), fm_set_user_bpammo(id, CSW_P228, 52);
		case 3: fm_give_item(id, "weapon_fiveseven"), fm_set_user_bpammo(id, CSW_FIVESEVEN, 100);
		case 4:
		{
			if(get_user_flags(id) & VIP_FLAG)
			{
				fm_give_item(id, "weapon_deagle");
				fm_set_user_bpammo(id, CSW_DEAGLE, 35);
			}else{
				client_print_color(id, print_team_default, "^1Доступно только для ^4VIP");
				return;
			}
		}
		case 5:
		{
			if(get_user_flags(id) & VIP_FLAG)
			{
				fm_give_item(id, "weapon_elite");
				fm_set_user_bpammo(id, CSW_ELITE, 120);
			}else{
				client_print_color(id, print_team_default, "^1Доступно только для ^4VIP");
				return;
			}
		}
	}
	
	g_iTypeSelectWeapon[id]++;
}

public fwd_SetModel_Post(iEnt, sModel[])
{
	if(!is_valid_ent(iEnt))
		return FMRES_IGNORED;
	
	if(!equali(sModel, "models/w_smokegrenade.mdl")) 
		return FMRES_IGNORED;
	
	if(!is_user_connected(entity_get_edict(iEnt, EV_ENT_owner)))
		return FMRES_IGNORED;
	
	set_task(1.6, "Grenade_Explode", iEnt);
	return FMRES_SUPERCEDE;
}

public Grenade_Explode(iGrenade)
{
	if(!is_valid_ent(iGrenade))
		return;

	new Float: fOrigin[3]
	entity_get_vector(iGrenade, EV_VEC_origin, fOrigin);
	
	create_beam_cylinder(fOrigin, 0, 128, 255);
	
	entity_set_int(iGrenade, EV_INT_flags, entity_get_int(iGrenade, EV_INT_flags) | FL_KILLME);
	emit_sound(iGrenade, CHAN_AUTO, SOUND_FROST_EXPLODE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	
	new iVictim = FM_NULLENT, iOwner = entity_get_edict(iGrenade, EV_ENT_owner), Float: fOriginID[3];
	while((iVictim = find_ent_in_sphere(iVictim, fOrigin, DIST_FROST_NORMAL)))
	{
		if(!is_user_alive(iVictim))
			continue;
			
		if(get_user_team(iOwner) == get_user_team(iVictim))
			continue;
		
		g_fCurSpeed[iVictim] = entity_get_float(iVictim, EV_FL_maxspeed);
		g_fCurGravity[iVictim] = entity_get_float(iVictim, EV_FL_gravity);
		
		set_ent_render(iVictim, 0, 128, 255);
		set_screen_fade(iVictim, 0, 128, 255);
		set_block_speed(iVictim);
		
		g_iEntFrostBlock[iVictim] = create_entity("info_null");
		entity_set_string(g_iEntFrostBlock[iVictim], EV_SZ_classname, "frost_grenade");
		entity_get_vector(iVictim, EV_VEC_origin, fOriginID);
		entity_set_vector(g_iEntFrostBlock[iVictim], EV_VEC_origin, fOriginID);
		entity_set_model(g_iEntFrostBlock[iVictim], MODEL_FROST_BLOCK);
		entity_set_int(g_iEntFrostBlock[iVictim], EV_INT_iuser1, iVictim);
		set_ent_animation(g_iEntFrostBlock[iVictim], 0, 1.0, 1.0);
		
		if(get_distance_f(fOrigin, fOriginID) < DIST_FROST_LONG)
		{
			entity_set_float(iVictim, EV_FL_maxspeed, SPEED_FROST_LONG);
			entity_set_float(iVictim, EV_FL_gravity, 0.01);
			
			ExecuteHamB(Ham_TakeDamage, iVictim, g_iEntFrostBlock[iVictim], iOwner, DAMAGE_FROST_NORMAL, DMG_FREEZE);
			entity_set_int(g_iEntFrostBlock[iVictim], EV_INT_iuser2, 1);
			entity_set_float(g_iEntFrostBlock[iVictim], EV_FL_fuser1, TIME_FROST_LONG + (random_num(1, 10) / 10));
		}else{
			trail_msg(iVictim, 0, 128, 255, floatround(DAMAGE_FROST_NORMAL));
			entity_set_float(iVictim, EV_FL_maxspeed, SPEED_FROST_NORMAL);
			entity_set_float(iVictim, EV_FL_gravity, 0.01);
			
			ExecuteHamB(Ham_TakeDamage, iVictim, g_iEntFrostBlock[iVictim], iOwner, DAMAGE_FROST_LONG, DMG_FREEZE);
			entity_set_float(g_iEntFrostBlock[iVictim], EV_FL_fuser1, TIME_FROST_NORMAL + (random_num(1, 10) / 10));
		}

		entity_set_float(g_iEntFrostBlock[iVictim], EV_FL_nextthink, get_gametime() + 0.1);
	}
}

public Think_Grenade(iEnt)
{
	if(!is_valid_ent(iEnt))
		return PLUGIN_CONTINUE;
		
	static sModel[32];
	entity_get_string(iEnt, EV_SZ_model, sModel, charsmax(sModel));
	
	if(equal(sModel, "models/w_smokegrenade.mdl"))
		return PLUGIN_HANDLED;
		
	return PLUGIN_CONTINUE;
}

public Think_FrostGrenade(iEnt)
{
	if(!is_valid_ent(iEnt))
		return;
		
	static id; id = entity_get_int(iEnt, EV_INT_iuser1);
	static iType; iType = entity_get_int(iEnt, EV_INT_iuser2);
	static Float: fEndTime; fEndTime = entity_get_float(iEnt, EV_FL_fuser1) - 0.1;
	
	if(iType)
	{
		if(fEndTime < TIME_FROST_NORMAL)
		{
			emit_sound(iEnt, CHAN_AUTO, SOUND_FROST_DESTRUCTION, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
			trail_msg(id, 0, 128, 255, floatround(DAMAGE_FROST_NORMAL));
			create_break_model(iEnt);
			entity_set_int(iEnt, EV_INT_iuser2, 0)
			entity_set_model(iEnt, MODEL_FROST_BLOCK_DESTRUCTION);
			set_ent_animation(iEnt, 0, 1.0, 1.0);
			entity_set_float(id, EV_FL_maxspeed, SPEED_FROST_NORMAL);
			entity_set_float(id, EV_FL_gravity, 0.01);
		}
	}else{
		if(fEndTime < 0)
		{
			message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
			write_byte(TE_KILLBEAM);
			write_short(id);
			message_end();
			
			entity_set_float(id, EV_FL_maxspeed, g_fCurSpeed[id]);
			entity_set_float(id, EV_FL_gravity, g_fCurGravity[id]);
			
			reset_ent_render(id);
			reset_screen_fade(id);
			reset_block_speed(id);
			
			entity_set_int(iEnt, EV_INT_flags, entity_get_int(iEnt, EV_INT_flags) | FL_KILLME);
			return;
		}

	}
	
	static Float: fOrigin[3];
	entity_get_vector(id, EV_VEC_origin, fOrigin);
	fOrigin[2] -= entity_get_int(id, EV_INT_button) & IN_DUCK ? 18.0 : 36.0;
	entity_set_vector(iEnt, EV_VEC_origin, fOrigin);
	entity_set_float(iEnt, EV_FL_fuser1, fEndTime);
	entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 0.1);
}

public fog_create(id)
{
	message_begin(MSG_ONE, g_iMsgFog, _, id);
	write_byte(64);
	write_byte(64);
	write_byte(64);	
	write_byte(0);
	write_byte(0);
	write_byte(150);
	write_byte(58);
	message_end();
}

public plugin_natives()
{
	register_native("is_user_furrien", "is_user_furrien", true);
	register_native("set_block_speed", "set_block_speed", true);
	register_native("reset_block_speed", "reset_block_speed", true);
	register_native("get_user_class", "get_user_class", true);
	register_native("set_user_class", "set_user_class", true);
	register_native("get_user_lvl", "get_user_lvl", true);
	register_native("set_user_lvl", "set_user_lvl", true);	
}

public is_user_furrien(id)
{
	return g_bIsFurrien[id];
}

public set_block_speed(id)
{
	if(g_bIsBlockSpeed[id])
		return;
	
	g_bIsBlockSpeed[id] = true;
}

public reset_block_speed(id)
{
	if(!g_bIsBlockSpeed[id])
		return;	
	
	g_bIsBlockSpeed[id] = false;
}

public get_user_class(id)
{
	return g_iFurrienClassNum[id];
}

public set_user_class(id, iNum)
{
	if(g_iFurrienClassCount > iNum)
	{
		g_iFurrienClassNum[id] = iNum;
		return true;
	}
	
	log_amx("Error: This class does not exist");
	return false;
}

public get_user_lvl(id)
{
	return g_iAllianceLvlNum[id];
}

public set_user_lvl(id, iNum)
{
	if(iNum > MAX_LVL-1 && iNum)
	{
		g_iAllianceLvlNum[id] = iNum;
		g_iAllianceKillNum[id] = LVL_KILLS[g_iAllianceLvlNum[id]+1];
		return true;
	}
	
	log_amx("Error: it is impossible to establish such a level");
	return false;
}

public register_furrien_class(const sName[], const sInfo[], const sModel[], iFlag)
{
	if(g_iFurrienClassCount == FURRIEN_CLASS_MAX-1)
	{
		log_amx("Error: The maximum number of classes in the classes of furrien");
		return -1;
	}
	
	format(g_sFurrienClassName[g_iFurrienClassCount], FURRIEN_MENU_LEN-1, "%s", sName);
	format(g_sFurrienClassInfo[g_iFurrienClassCount], FURRIEN_MENU_LEN2-1, "%s", sInfo);
	format(g_sFurrienClassModel[g_iFurrienClassCount], FURRIEN_MENU_LEN-1, "%s", sModel);
	g_iFurrienClassFlag[g_iFurrienClassCount] = iFlag;

	new sItem[128];
	format(sItem, charsmax(sItem), "\w%s \r[\y%s\r]", sName, sInfo);
	menu_additem(g_iFurrienClassMenu, sItem);
	g_iFurrienClassCount++;
	
	return g_iFurrienClassCount-1;
}

public register_item_to_shop(iTeam, sNameItem[], iCostItem, iLimitItem, sCallFuncItem[])
{
	if(iTeam == TEAM_FURRIEN)
	{
		if(g_iNumItem_Furrien == SHOP_ITEMS_LIMIT)
			log_amx("Error: The maximum number of items in the shop of furrien");
		else
		{
			format(g_sShopNameItems_Furrien[g_iNumItem_Furrien], SHOP_ITEMS_LEN-1, "%s", sNameItem);
			g_iShopCostItems_Furrien[g_iNumItem_Furrien] = iCostItem;
			g_iShopFwdItems_Furrien[g_iNumItem_Furrien] = CreateMultiForward(sCallFuncItem, ET_CONTINUE, FP_CELL);
			g_iShopLimit_Furrien[g_iNumItem_Furrien] = iLimitItem;
			
			new sItem[128];
			format(sItem, charsmax(sItem), "\w%s \d[\y%i\r$\d]", g_sShopNameItems_Furrien[g_iNumItem_Furrien], g_iShopCostItems_Furrien[g_iNumItem_Furrien]);
			menu_additem(g_iShopMenu_Furrien, sItem);
			
			g_iNumItem_Furrien++;
		}
	}
	else if(iTeam == TEAM_ALLIANCE)
	{
		if(g_iNumItem_Alliance == SHOP_ITEMS_LIMIT)
			log_amx("Error: The maximum number of items in the shop of alliance");
		else
		{		
			format(g_sShopNameItems_Alliance[g_iNumItem_Alliance], SHOP_ITEMS_LEN-1, "%s", sNameItem);
			g_iShopCostItems_Alliance[g_iNumItem_Alliance] = iCostItem;
			g_iShopFwdItems_Alliance[g_iNumItem_Alliance] = CreateMultiForward(sCallFuncItem, ET_CONTINUE, FP_CELL);
			g_iShopLimit_Alliance[g_iNumItem_Alliance] = iLimitItem;
			
			new sItem[128];
			format(sItem, charsmax(sItem), "\w%s \d[\y%i\r$\d]", g_sShopNameItems_Alliance[g_iNumItem_Alliance], g_iShopCostItems_Alliance[g_iNumItem_Alliance]);
			menu_additem(g_iShopMenu_Alliance, sItem);
			
			g_iNumItem_Alliance++;
		}
	}
	else
		log_amx("Error: There is only team 0 (furrien) and 1 (alliance), but not %i (???)", iTeam);
}

public Clcmd_Drop(id)
{
	if(!is_user_alive(id))
		return PLUGIN_CONTINUE;

	if(get_user_weapon(id) == CSW_KNIFE)
	{
		new iTemp;
		ExecuteForward(g_iFwdAbility, iTemp, id);
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}

public get_lvl(id)
{
	new iLine = 1, iLen, sData[64], sKey[38], sAuthID[38];
	get_user_authid(id, sAuthID, charsmax(sAuthID));
	
	while((iLine = read_file(PATH_DATABASE, iLine, sData, charsmax(sData), iLen)))
	{
		parse(sData, sKey, charsmax(sKey));
		
		if(equal(sKey, sAuthID))
		{
			parse(sData, sKey, charsmax(sKey), sKey, charsmax(sKey));
			g_iAllianceKillNum[id] = str_to_num(sKey);
			
			new i;
			while(g_iAllianceKillNum[id] > LVL_KILLS[i] && i < MAX_LVL-1)
			{
				g_iAllianceLvlNum[id]++
				i++;
			}
			
			return;
		}
	}
	
	g_iAllianceKillNum[id] = 0;
}

public save_lvl(id)
{
	new iLine = 1, iLen, sData[64], sKey[38], sAuthID[38];
	get_user_authid(id, sAuthID, charsmax(sAuthID));
	
	while((iLine = read_file(PATH_DATABASE, iLine, sData, charsmax(sData), iLen)))
	{
		parse(sData, sKey, charsmax(sKey));
		
		if(equal(sKey, sAuthID))
		{
			format(sData, charsmax(sData), "%s %i", sAuthID, g_iAllianceKillNum[id]);
			write_file(PATH_DATABASE, sData, iLine-1);
			return;
		}
	}
	
	format(sData, charsmax(sData), "%s %i", sAuthID, g_iAllianceKillNum[id]);
	write_file(PATH_DATABASE, sData, -1);
}

public CheckLvl(id)
{	
	if(g_iAllianceLvlNum[id] == MAX_LVL-1)
	{
		format(g_sAddInfo[id], 63, "Уровень: MAX");
		return;
	}
	
	if(g_iAllianceKillNum[id] >= LVL_KILLS[g_iAllianceLvlNum[id]+1])
	{
		g_iAllianceLvlNum[id]++;
		client_print_color(id, print_team_default, "^1Позрдавляем, вы получили ^4%i ^3уровень", g_iAllianceLvlNum[id]+1);
		save_lvl(id);
	}
	
	format(g_sAddInfo[id], 63, "Уровень: %i [%i/%i]", g_iAllianceLvlNum[id]+1, g_iAllianceKillNum[id], LVL_KILLS[g_iAllianceLvlNum[id]+1]);
}

stock fm_set_user_model(id, const sModel[])
{
	engfunc(EngFunc_SetClientKeyValue, id, engfunc(EngFunc_GetInfoKeyBuffer, id), "model", sModel);
}

stock fm_strip_user_weapons(id)
{
	new iEnt = create_entity("player_weaponstrip");

	dllfunc(DLLFunc_Spawn, iEnt);
	dllfunc(DLLFunc_Use, iEnt, id);
	engfunc(EngFunc_RemoveEntity, iEnt);
}

stock fm_give_item(id, const sItem[])
{
	new iEnt = create_entity(sItem);

	new Float: fOrigin[3];
	entity_get_vector(id, EV_VEC_origin, fOrigin);
	entity_set_vector(iEnt, EV_VEC_origin, fOrigin);
	entity_set_int(iEnt, EV_INT_spawnflags, entity_get_int(iEnt, EV_INT_spawnflags) | SF_NORESPAWN);
	dllfunc(DLLFunc_Spawn, iEnt);
	dllfunc(DLLFunc_Touch, iEnt, id);
}

stock fm_set_user_bpammo(id, iWpnID, iAmmo)
{ 
	static iOffset; 
	
	switch(iWpnID) 
	{
		case CSW_AWP: iOffset = 377; 
		case CSW_SCOUT, CSW_AK47, CSW_G3SG1: iOffset = 378; 
		case CSW_M249: iOffset = 379;         
		case CSW_FAMAS, CSW_M4A1, CSW_AUG, CSW_SG550, CSW_GALI, CSW_SG552: iOffset = 380; 
		case CSW_M3, CSW_XM1014: iOffset = 381; 
		case CSW_USP, CSW_UMP45, CSW_MAC10: iOffset = 382; 
		case CSW_FIVESEVEN, CSW_P90: iOffset = 383; 
		case CSW_DEAGLE: iOffset = 384; 
		case CSW_P228: iOffset = 385; 
		case CSW_GLOCK18, CSW_MP5NAVY, CSW_TMP, CSW_ELITE: iOffset = 386; 
		case CSW_FLASHBANG: iOffset = 387; 
		case CSW_HEGRENADE: iOffset = 388; 
		case CSW_SMOKEGRENADE: iOffset = 389; 
		default: return;
	}
	
	set_pdata_int(id, iOffset, iAmmo, OFFSET_AMMO);
}

stock fm_drop_weapon(id, iSlot)
{
	static iEntity; iEntity = get_pdata_cbase(id, (pDataKey_iPlayerItems + iSlot), pData_Player);
	if(iEntity > 0)
	{
		static iNext, szWeaponName[32];
		do
		{
			iNext = get_pdata_cbase(iEntity, pDataKey_iNext, 4);
			if(get_weaponname(get_pdata_int(iEntity, pDataKey_iId, 4), szWeaponName, 31))
				engclient_cmd(id, "drop", szWeaponName)
		} while((iEntity = iNext) > 0);
	}
}

stock fm_get_user_money(id)
{
	return get_pdata_int(id, OFFSET_MONEY);
}

stock fm_set_user_money(id, iMoney)
{
	set_pdata_int(id, OFFSET_MONEY, iMoney);
	message_begin(MSG_ONE, g_iMsgMoney, {0, 0, 0}, id);
	write_long(iMoney);
	write_byte(1);
	message_end();
}

stock create_beam_cylinder(Float: fOrigin[3], r, g, b)
{
	engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fOrigin, 0);
	write_byte(TE_BEAMCYLINDER);
	engfunc(EngFunc_WriteCoord, fOrigin[0]);
	engfunc(EngFunc_WriteCoord, fOrigin[1]);
	engfunc(EngFunc_WriteCoord, fOrigin[2]);
	engfunc(EngFunc_WriteCoord, fOrigin[0]);
	engfunc(EngFunc_WriteCoord, fOrigin[1]);
	engfunc(EngFunc_WriteCoord, fOrigin[2] + 300);
	write_short(g_iSpriteBeam);
	write_byte(0);
	write_byte(0);
	write_byte(4);
	write_byte(60);
	write_byte(0);
	write_byte(r);
	write_byte(g);
	write_byte(b);
	write_byte(1000);
	write_byte(0);
	message_end();
}

stock set_screen_fade(id, r, g, b)
{
	message_begin(MSG_ONE, g_iMsgScreenFade, _, id);
	write_short(1<<12);
	write_short(1<<8);
	write_short(1<<2);
	write_byte(r);
	write_byte(g);
	write_byte(b);
	write_byte(50);
	message_end();
}

stock reset_screen_fade(id)
{
	message_begin(MSG_ONE, g_iMsgScreenFade, _, id);
	write_short(1<<12);
	write_short(1<<8);
	write_short(1<<4);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	message_end();	
}

stock trail_msg(iEnt, r, g, b, iLife)
{
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(TE_BEAMFOLLOW);
	write_short(iEnt);
	write_short(g_iSpriteBeam);
	write_byte(iLife*10);
	write_byte(8);
	write_byte(r);
	write_byte(g);
	write_byte(b);
	write_byte(150);
	message_end();
}

stock create_break_model(iEnt)
{
	new Float: fOrigin[3];
	entity_get_vector(iEnt, EV_VEC_origin, fOrigin);
	
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(TE_BREAKMODEL);
	engfunc(EngFunc_WriteCoord, fOrigin[0]);
	engfunc(EngFunc_WriteCoord, fOrigin[1]);
	engfunc(EngFunc_WriteCoord, fOrigin[2] + 24);
	write_coord(16);
	write_coord(16);
	write_coord(16);
	write_coord(random_num(-50,50));
	write_coord(random_num(-50,50));
	write_coord(25);
	write_byte(10);
	write_short(g_iModelGlassGibs);
	write_byte(10);
	write_byte(25);
	write_byte(0x01);
	message_end();	
}

stock set_ent_render(id, r, g, b)
{
	new Float: fRenderColor[3];
	fRenderColor[0] = float(r);
	fRenderColor[1] = float(g);
	fRenderColor[2] = float(b);
	
	set_pev(id, pev_renderfx, kRenderFxGlowShell);
	set_pev(id, pev_rendercolor, fRenderColor);
	set_pev(id, pev_rendermode, kRenderNormal);
	set_pev(id, pev_renderamt, 16.0);
}

stock reset_ent_render(id)
{
	set_pev(id, pev_renderfx, kRenderFxNone);
	set_pev(id, pev_rendercolor, Float: {255.0, 255.0, 255.0});
	set_pev(id, pev_rendermode, kRenderNormal);
	set_pev(id, pev_renderamt, 16.0);
}

stock set_ent_animation(iEnt, iAnim, Float: fAnimTime, Float: fFrame)
{
	entity_set_int(iEnt, EV_INT_sequence, iAnim);
	entity_set_float(iEnt, EV_FL_animtime, fAnimTime);
	entity_set_float(iEnt, EV_FL_framerate, fFrame);
	entity_set_float(iEnt, EV_FL_frame, 0.0);
}
Последна промяна от g0gIch Beg на 08 фев 2019, 22:50, променено общо 1 път.

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

stambeto2006
Тестов модератор
Тестов модератор
Мнения: 364
Регистриран: 06 окт 2016, 15:44
Се отблагодари: 18 пъти
Получена благодарност: 25 пъти
Години: 24
Контакти:

Помощ за компилиране

Мнение от stambeto2006 » 08 фев 2019, 22:05

1. Оправи заглавието на темата, което да отговоря точна на проблема ти в темата.
2. При мен плъгина се компилира без никакви проблеми, на всяка версия.
Прикачени файлове
Capture.PNG
Capture.PNG (6.03 KиБ) Видяна 155 пъти
Capture.PNG
Capture.PNG (6.03 KиБ) Видяна 155 пъти
ИзображениеИзображение

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

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

Грешка при компилиране на furienmod_core

Мнение от OciXCrom TM » 09 фев 2019, 00:12

Плъгинът изисква АМХХ 1.9.

@stambeto2006 - няма как да се компилира на 1.8.2 защото там няма client_print_color функция, а и на 1.9 няма да се компилира защото има #include <dhudmessage> в кода което трябва да бъде премахнато.

Или обнови до 1.9, или добави #include <cromchat>.

Заключена

Върни се в “Поддръжка / Помощ”

Кой е на линия

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