Menu_display bug??

Ако имате затруднения при изработката/преработката на даден плъгин - пишете тук, ще се опитаме да ви помогнем!
Аватар
Adryyy
Извън линия
Foreigner
Foreigner
Мнения: 9
Регистриран на: 29 Окт 2019, 22:04
Се отблагодари: 7 пъти

Menu_display bug??

Мнение от Adryyy » 29 Окт 2019, 22:10

Hi. I tried to use new menus style with menu_display, to create menu for some guns. They are for the exact level, or all to the player level. I don't know why, but when i'm on server and i get menu on spawn, this get pressed himslef -3/9/random keys, i blocked with menu_handler for key==menu_exit with display or task. For task, i can't see the next page, for menu_display i get error 'Plugin called menu_display when item=MENU_EXIT'. I don't now if is from my code, or server..

Full error log:

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

L 10/29/2019 - 21:59:50: Start of error session.
L 10/29/2019 - 21:59:50: Info (map "ze_area51_lg") (file "addons/amxmodx/logs/error_20191029.log")
L 10/29/2019 - 21:59:50: Plugin called menu_display when item=MENU_EXIT
L 10/29/2019 - 21:59:50: [AMXX] Displaying debug trace (plugin "ze_level.amxx", version "2.1X")
L 10/29/2019 - 21:59:50: [AMXX] Run time error 10: native error (native "menu_display")
L 10/29/2019 - 21:59:50: [AMXX]    [0] ze_level.sma::SHOWWEAPONSP (line 1715)
L 10/29/2019 - 21:59:50: [AMXX]    [1] ze_level.sma::Show_Menu_Buy_Primary (line 1662)
L 10/29/2019 - 21:59:50: [AMXX]    [2] ze_level.sma::Show_Available_Buy_Menus (line 1607)
L 10/29/2019 - 21:59:50: [AMXX]    [3] ze_level.sma::player_spawn (line 1310)
L 10/29/2019 - 21:59:51: Plugin called menu_display when item=MENU_EXIT
L 10/29/2019 - 21:59:51: [AMXX] Displaying debug trace (plugin "ze_level.amxx", version "2.1X")
L 10/29/2019 - 21:59:51: [AMXX] Run time error 10: native error (native "menu_display")
L 10/29/2019 - 21:59:51: [AMXX]    [0] ze_level.sma::SHOWWEAPONSP (line 1715)
L 10/29/2019 - 21:59:51: [AMXX]    [1] ze_level.sma::Show_Menu_Buy_Primary (line 1662)
L 10/29/2019 - 21:59:51: [AMXX]    [2] ze_level.sma::Show_Available_Buy_Menus (line 1607)
L 10/29/2019 - 21:59:51: [AMXX]    [3] ze_level.sma::player_spawn (line 1310)
SMA

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

#pragma tabsize 0

#include <amxmodx>
#define EVO
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <csx>
#include <vault>
#include <cs_player_models_api>
#include <zombie_escape>
#include <colorchat_lang>


/*		CSO SECUNDARE		*/
native ze_give_cdeagle(id)//	-	lv 10 secundar
native ze_give_cdeagle2(id)//	-	lv 20 secundar
native ze_give_celite(id)//	-	lv 30 secundar
/*		CSO SECUNDARE		*/

/*			CSO PRIMARE			*/
native ze_give_cak47(id)//	-	lv 10 primar
native ze_give_cump45(id)//	-	lv 15 primar
native ze_give_cm249(id)//	-	lv 20 primar
native ze_give_cm4a1(id)//	-	lv 25 primar
native ze_give_cm3(id)//		-	lv 30 primar
/*			CSO PRIMARE			*/

/*			CSO CUȚITE			*/
native ze_give_cknife(id)
/*			CSO CUȚITE			*/

#define DENUMIRE "^3[ZE.THEXFORCE.RO-STATS]^1"

static const
	PLUGIN[] = "Simple Level Mod",
	VERSION[] = "2.1X",
	AUTHOR[] = "scosmyn&Askhanar";//edit


#define TASK_pentru	06091993
#define	MagicWordTask		112233
#define	MagicWordSecondTask	332211
#define	UniqueWordTask		221133
#define	UniqueWordSecondTask	113322
new g_iCvarTREnable,g_iCvarTRMinutes,g_iCvarTRXP,g_iUserTime[ 33 ];

enum
{
	EVENT_HAPPY_HOUR,
	EVENT_FREEGIFTS_HOUR,
	EVENT_LUCKY_HOUR,
	EVENT_SHOPPING_HOUR
}

new const g_szSmallLetters[    ] =
{
	'a','b','c','d',
	'e','f','g','h',
	'i','j','k','l',
	'm','n','o','p',
	'q','r','s','t',
	'u','v','w','x',
	'y','z'
};
new const g_szLargeLetters[    ] =
{
	'A','B','C','D',
	'E','F','G','H',
	'I','J','K','L',
	'M','N','O','P',
	'Q','R','S','T',
	'U','V','W','X',
	'Y','Z'
};
new const g_szNumbers[    ]  =  
{
	'0','1',
	'2','3',
	'4','5',
	'6','7',
	'8','9'
};
new const g_szSymbols[    ]  =  
{
	'!','@','$',
	'&','*','(',
	')','_','-','+',
	'=','\','|','[',
	'{',']','}',':',
	',','<','.','>',
	'/','?'
};
new const g_szFmuEventBegin[    ]  =  "zombie_escape/ze_eventbegin.wav";

new gCvarEnableHappyHour;
new gCvarHappyHours;
new gCvarEnableFreeGiftsHour;
new gCvarFreeGiftsHours;
new gCvarEnableLuckyHour;
new gCvarLuckyHours;
new gCvarEnableShoppingHour;
new gCvarShoppingHours;
new gCvarMagicWordIterval;
new gCvarMagicWordAnswerTime;
new gCvarMagicWordXP;
new gCvarUniqueWordDelay;
new gCvarUniqueWordAnswerTime;
new gCvarUniqueWordXP;
new xp_spawn

new g_iMWAnswerTime = 0;
new g_szMagicWord[ 32 ];
new g_iUQAnswerTime = 0;
new g_szUniqueWord[ 35 ];

new bool:g_bHappyHourEvent;
new bool:g_bFreeGiftsHourEvent;
new bool:g_bLuckyHourEvent;
new bool:g_bShoppingHourEvent;
new bool:g_bPlayersCanAnswerForMW  =  false;
new bool:g_bPlayersCanAnswerForUQW  =  false;

new SyncHudMessage;
new SyncHudMessage1;
new SyncHudMessage2;
new SyncHudMessage3;
new SyncHudMessage4;
new SyncHudMessage5;


#define INFO_ZERO 0
#define NTOP 15
#define TIME 100.0
new topxp[33],toplevels[33];
new topnames[33][32];
new Data[64]
new const g_szImageLink[ ] = "http://i.imgur.com/LjMtGpv.png";
new const g_szEndMessage[ ] = "Daca esti in clasementu asta esti tare .<br>Viziteaza si wWw.thexforce.ro";

enum _:GM
{
	mLV,
	hmP[32],
	zmP[32]
}
new const e_GM[][GM]=
{
//	LVL		MODEL HM				MODEL ZM
	{2,		"hm_skin_lvl2",			"zm_skin_lvl2"},
	{4,		"hm_skin_lvl4",			"zm_skin_lvl4"},
	{6,		"hm_skin_lvl6",			"zm_skin_lvl6"},
	{8,		"hm_skin_lvl8",			"zm_skin_lvl8"},
	{10,	"hm_skin_lvl10",		"zm_skin_lvl10"},
	{12,	"hm_skin_lvl12",		"zm_skin_lvl12"},
	{14,	"hm_skin_lvl14",		"zm_skin_lvl14"},
	{16,	"hm_skin_lvl16",		"zm_skin_lvl16"},
	{18,	"hm_skin_lvl18",		"zm_skin_lvl18"},
	{20,	"hm_skin_lvl20",		"zm_skin_lvl20"},
	{22,	"hm_skin_lvl22",		"zm_skin_lvl22"},
	{24,	"hm_skin_lvl24",		"zm_skin_lvl24"},
	{26,	"hm_skin_lvl26",		"zm_skin_lvl26"},
	{28,	"hm_skin_lvl28",		"zm_skin_lvl28"},
	{30,    "hm_skin_lvl30", 		"zm_skin_lvl30"}
}

// Modele pt playeri zm/hm sunt în felul următor : [ models/player -> folder pt hm & zm - hm_skin_lvl1, respectiv zm_skin_lvl1 -> modelul - hm_skin_lvl1.mdl respectiv zm_skin_lvl1.mdl ]
// Modele pt v_knife pt zm sunt în models : [ v_knife_zm_lvl1 , fiecare clasa de zm de la lvl 1 până la lvl 14 are câte un model de knife ] xdd

#define MAX_LEVELS 30
new const Xp[MAX_LEVELS] =//aici trb xp-ul pt a trece la urm nivel
{
	0,						//1 
	100,					//2
	355,					//3 
	455,					//4
	555,					//5 
	655,					//6
	700,					//7
	800,					//8
	950,					//9 
	1000,					//10	
	1100,					//11
	1500,					//12
	2500,					//13 
	3500,					//14
	4500,					//15 
	6500,					//16
	7500,					//17  
	8500,					//18
	9500,					//19 
	10000,					//20
	15000,					//21 
	25000,					//22 
	35000,					//23
	45000,					//24 
	55000,					//25 
	60000,					//26 
	65000,					//27	
	70000,					//28 
	75000,					//29  
	80000,					//30 
}
new Level[33],XP[33],Points[33],name[32],
pcvar_wh,pcvar_wz,pcvar_az,pcvar_ah,pcvar_hdmg,pcvar_pwh,pcvar_pwz,pcvar_pah,pcvar_paz,pcvar_phdmg,pcvar_hdmgnum,pcvar_phdmgnum
//new pcvar_efect,pcvar_r,pcvar_g,pcvar_b

new daune_provocate[33],daune_provocate2[33];
//new pcvar_hs,pcvar_xp,pcvar_knife,pcvar_he
enum _:e_K
{
	kName[32],
	kVM[32],
	kPM[32],
	kLV,
	kN[32]
}
new const e_kB[][e_K] =
{
/**		NUME KNIFE									V MODEL					P MODEL						LVL		URM. MODEL		**/
		{"Spada Luminata",							"hm_knife_lvl2",		"hm_knife_lvl2",			2,		"Topor Inflacarat"},
		{"Topor Inflacarat",						"hm_knife_lvl4",		"hm_knife_lvl4",			4,		"Topor Inghetat"},
		{"Topor Inghetat",							"hm_knife_lvl6",		"hm_knife_lvl6",			6,		"Topor Auriu"},
		{"Topor Auriu",								"hm_knife_lvl8",		"hm_knife_lvl8",			8,		"Dual Katana"},
		{"Dual Katana",								"hm_knife_lvl10",		"hm_knife_lvl10",			10,		"Dual Katana Transparente"},
		{"Dual Katana Transparente",				"hm_knife_lvl12",		"hm_knife_lvl12",			12,		"Ciocan Rosu"},
		{"Ciocan Rosu",								"hm_knife_lvl14",		"hm_knife_lvl14",			14,		"Ciocan Alb"},
		{"Ciocan Alb",								"hm_knife_lvl16",		"hm_knife_lvl16",			16,		"Buzdugan De Aur"},
		{"Buzdugan De Aur",							"hm_knife_lvl18",		"hm_knife_lvl18",			18,		"Pumni De Robot"},
		{"Pumni De Robot",							"hm_knife_lvl20",		"hm_knife_lvl20",			20,		"Pumni Mecanici"},
		{"Pumni Mecanici",							"hm_knife_lvl22",		"hm_knife_lvl22",			22,		"Baston De Aur"},
		{"Baston De Aur",							"hm_knife_lvl24",		"hm_knife_lvl24",			24,		"Ciocan"},
		{"Ciocan",									"hm_knife_lvl26x",		"hm_knife_lvl26x",			26,		"Sabie Aurie"},
		{"Sabie Aurie",								"hm_knife_lvl28",		"hm_knife_lvl28",			28,		"Thantos"},
		{"Thantos", 								"",						"",							30,		""}
}
new bool:g_bBoughtKnife[33]

enum _:e_P
{
	pName[32],
	pLV,
	pBPA,
	pN[32],
	pC,
	pG[32]
}
new const e_pB[][e_P] =
{
/**		NUME ARMĂ PRIMARĂ	LVL		BP-AMMO		URM. MODEL			CSW_			GIVE				**/
		{"MP5NAVY",			0,		150,		"FAMAS",			CSW_MP5NAVY,    "weapon_mp5navy"}, 
		{"FAMAS",			2,		150,		"GALIL",			CSW_FAMAS,		"weapon_famas"},  
		{"GALIL",			4,		150,		"M4A1",				CSW_GALIL,		"weapon_galil"},
		{"M4A1",			6,		150,		"AK47",				CSW_M4A1,	  	"weapon_m4a1"},
		{"AK47",			8,		150,		"PlasmaGun",		CSW_AK47,		"weapon_ak47"},		
/** ==================================== | Sfârşitul armelor clasice | ========================== **/
		{"PlasmaGun",		10,		0,			"Ethereal",		 	CSW_KNIFE,		"weapon_knife"},
		{"Ethereal",		15,		0,			"Thanatos-7",		CSW_KNIFE,		"weapon_knife"},
		{"Thanatos-VII",	20,		0,			"Janus-5",			CSW_KNIFE,		"weapon_knife"},
		{"Janus-V",			25,		0,			"M32",				CSW_KNIFE,		"weapon_knife"},
		{"M32",				30,		0,			"",				    CSW_KNIFE,		"weapon_knife"}
/** =================================== | Sfârşitul armelor cu puteri | ========================== **/
}
enum _:e_S
{
	sName[32],
	sLV,
	sBPA,
	sN[32],
	sC,
	sG[32]
}
new const e_sB[][e_S] =
{
/**		NUME ARMĂ SECUNDARĂ	LVL		BP-AMMO		URM. MODEL			CSW_			GIVE				**/
		{"GLOCK18",			0,		120,		"USP",				CSW_GLOCK18,	"weapon_glock18"},
		{"USP",				4,		120,		"FIVESEVEN",		CSW_USP,		"weapon_usp"},
		{"FIVESEVEN",		8,		120,		"BloodHunter",		CSW_FIVESEVEN,	"weapon_fiveseven"},
/** ================================= | Sfârştiul pistoalelor clasice | ========================= **/		
		{"BloodHunter",		10,		0,			"Cyclone",			CSW_KNIFE,		"weapon_knife"},
		{"Cyclone",			20,		0,			"DualInfinity",		CSW_KNIFE,		"weapon_knife"},
		{"DualIninity",		30,		0,			"",					CSW_KNIFE,		"weapon_knife"}
/** ================================ | Sfârşitul pistoalelor cu puteri | ======================== **/
}
new bool:g_bBoughtPrimary[33], 
		bool:g_bBoughtSecondary[33]

new g_pCvarHEGrenade, 
	g_pCvarSmokeGrenade, 
	g_pCvarFlashGrenade, 
	g_pCvarBlockWeapLowLvl
public plugin_precache()
{
	g_pCvarHEGrenade = register_cvar("ze_give_HE_nade", "1") // 0 Nothing || 1 Give HE
	g_pCvarSmokeGrenade = register_cvar("ze_give_SM_nade", "1")
	g_pCvarFlashGrenade = register_cvar("ze_give_FB_nade", "1")
	g_pCvarBlockWeapLowLvl = register_cvar("ze_block_weapons_lowlvl", "0")

	gCvarMagicWordIterval  =  register_cvar( "ze_mw_interval",  "180"  );
	gCvarMagicWordAnswerTime  =  register_cvar( "ze_mw_answertime",  "25"  );
	g_iCvarTREnable = register_cvar( "ze_tr_enable", "1" );
	g_iCvarTRMinutes = register_cvar( "ze_tr_minutes", "5" );
	g_iCvarTRXP = register_cvar( "ze_tr_xp", "15" );
	gCvarEnableHappyHour  =  register_cvar(  "ze_enable_happyhour",  "1"  );
	gCvarHappyHours  =  register_cvar(  "ze_happy_hours", "4 6 8 10 12" );//maxim 5 ore diferite??
	gCvarEnableFreeGiftsHour  =  register_cvar(  "ze_enable_freegiftshour",  "1"  );
	gCvarFreeGiftsHours  =  register_cvar(  "ze_freegifts_hours", "14 16 18 20 22"  );//19
	gCvarEnableLuckyHour  =  register_cvar(  "ze_enable_luckyhour",  "1"  );
	gCvarLuckyHours  =  register_cvar(  "ze_lucky_hours", "5 7 9 11 13" );//21
	gCvarEnableShoppingHour  =  register_cvar(  "ze_enable_Shoppinghour",  "1"  );
	gCvarShoppingHours  =  register_cvar(  "ze_shopping_hours",  "24 3 2 1 17"  );//23
	gCvarMagicWordXP  =  register_cvar( "ze_mw_xp",  "450"  );
	gCvarUniqueWordDelay  =  register_cvar( "ze_uqw_delay",  "560"  );
	gCvarUniqueWordAnswerTime  =  register_cvar( "ze_uqw_answertime",  "75"  );
	gCvarUniqueWordXP  =  register_cvar( "ze_uqw_xp",  "2750"  );
	xp_spawn=register_cvar("xp_spawn","1")

	pcvar_wh= register_cvar("ze_xp_wh","50")
	pcvar_wz= register_cvar("ze_xp_wz","50")
	pcvar_az= register_cvar("ze_xp_az","10")
	pcvar_ah= register_cvar("ze_xp_ah","10")
	pcvar_hdmgnum= register_cvar("ze_xp_hdmg_num","700")
	pcvar_hdmg= register_cvar("ze_xp_hdmg","5")
	pcvar_pwh= register_cvar("ze_pts_wh","60")
	pcvar_pwz= register_cvar("ze_pts_wz","50")
	pcvar_pah= register_cvar("ze_pts_ah","10")
	pcvar_paz= register_cvar("ze_pts_az","10")
	pcvar_phdmg= register_cvar("ze_pts_phdmg","1")
	pcvar_phdmgnum= register_cvar("ze_xp_phdmg_num","800")


	/*pcvar_hs = register_cvar("cvar_hs_bonus","4")
	pcvar_kill = register_cvar("cvar_normal_bonus","1")
	pcvar_knife = register_cvar("cvar_knife_bonus","2")
	pcvar_he = register_cvar("cvar_he_bonus","3")
	pcvar_efect = register_cvar("cvar_effect_lvl","3")
	pcvar_r = register_cvar("cvar_red","255")
	pcvar_g = register_cvar("cvar_green","0")
	pcvar_b = register_cvar("cvar_blue","0")*/


	new szFile[128]
	for(new i; i < sizeof(e_kB); i++)
	{
		if(strlen(e_kB[i][kVM]))
		{
			formatex(szFile, charsmax(szFile), "models/v_%s.mdl", e_kB[i][kVM])
			precache_model(szFile)
		}
		if(strlen(e_kB[i][kPM]))
		{
			formatex(szFile, charsmax(szFile), "models/p_%s.mdl", e_kB[i][kPM])
			precache_model(szFile)
		}
	}

	for(new i; i < sizeof(e_GM); i++)
	{
		precache_player_model(e_GM[i][hmP])
		precache_player_model(e_GM[i][zmP])
	}

	engfunc(EngFunc_PrecacheSound,  g_szFmuEventBegin  );
	engfunc(EngFunc_PrecacheSound,  "vox/doop.wav"  );
	engfunc(EngFunc_PrecacheSound,  "vox/woop.wav"  );
}
precache_player_model(szModel[])
{
    static szFile[128]
    formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)
    precache_model(szFile)

    replace(szFile, charsmax(szFile), ".mdl", "T.mdl")
    if(file_exists(szFile))	precache_model(szFile)
}

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR)

	register_event("DeathMsg","ev_msg","a")
	register_event("SendAudio", "WIN_ZM", "a", "2&%!MRAD_terwin")
	register_event("SendAudio", "WIN_HM", "a", "2&%!MRAD_ctwin")

	// Hams
	//RegisterHam(Ham_Touch, "weaponbox", "Fw_TouchWeapon_Pre", 0)
	//RegisterHam(Ham_Touch, "armoury_entity", "Fw_TouchWeapon_Pre", 0)
	//RegisterHam(Ham_Touch, "weapon_shield", "Fw_TouchWeapon_Pre", 0)
	RegisterHam(Ham_TakeDamage, "player", "ham_take_dmg", 1)
	RegisterHam(Ham_Spawn,"player","player_spawn",1)
	RegisterHam( Ham_Item_Deploy, "weapon_knife", "Knife_Model" , 1)

	new iEnt;
	iEnt  =  create_entity(  "info_target"  );
	entity_set_string(  iEnt,  EV_SZ_classname,  "EventsEntity"  );
	entity_set_float(  iEnt, EV_FL_nextthink,  get_gametime(    )  +  0.1  );
	register_think(  "EventsEntity",  "CheckForEvents"  );
	set_task(  10.0,  "ChooseRandomMagicWord",  MagicWordTask  );
	set_task(  float( get_pcvar_num( gCvarUniqueWordDelay )  ),  "ChooseRandomUniqueWord",  UniqueWordTask  );
	set_task( 1.0, "task_PTRFunction", TASK_pentru, _, _, "b", 0 );

	// CHAT COMMANDS //
	register_clcmd("say", "hook_say");
	register_clcmd("say_team", "hook_say");
	register_clcmd("amx_rank", "ShowPlayerLevel");

	// Give & Remove XP //
	register_concmd ( "ze_exp_give", "CmdAddXP", ADMIN_RCON, "<nick, #userid, authid | @all> <XP>" )
	register_concmd ( "ze_exp_remove", "CmdRemoveXP", ADMIN_RCON, "<nick, #userid, authid | @all> <XP>" )
	register_concmd ( "ze_lv", "CmdGiveLv", ADMIN_RCON, "<tinta> <LVL>" )
	register_concmd ( "ze_xp", "CmdGiveXp", ADMIN_RCON, "<tinta> <XP>" )
	register_concmd( "amx_magicword", "ClCmdMagicWord"  );
	register_concmd( "amx_uniqueword", "ClCmdUniqueWord"  );

	SyncHudMessage = CreateHudSyncObj( );
	SyncHudMessage1 = CreateHudSyncObj( );
	SyncHudMessage2  =  CreateHudSyncObj(  );
	SyncHudMessage3  =  CreateHudSyncObj(  );
	SyncHudMessage4  =  CreateHudSyncObj(  );
	SyncHudMessage5  =  CreateHudSyncObj(  );

	get_datadir(Data, 63);
	read_top();
}

public GivePlayerGift(  id  )
{
	switch(  random_num(1,4)  )
	{
		case 1:
		{
			set_user_health(  id,  get_user_health(  id  )  +  25  );
			client_print_color(id,DontChange,  "%s Fiind eventul^x04 Lucky Hour^x01 activ, ai primit +^4 25HP",  DENUMIRE );
		}
		case 2:
		{
			set_user_armor(  id,  get_user_armor(  id  )  +  25 );
			client_print_color(id,DontChange,  "%s^x01 Fiind eventul^x04 Lucky Hour^x01 activ, ai primit +^4 25AP",  DENUMIRE );
		}
		case 3:
		{
			set_user_health(  id,  get_user_health(  id  )  + 25  );
			set_user_armor(  id,  get_user_armor(  id  )  + 25  );
			
			client_print_color(id,DontChange,  "%s Fiind eventul^x04 Lucky Hour^x01 activ, ai primit +^4 25HP^1 &^4 25AP",  DENUMIRE );
		}
		case 4:
		{
			XP[id]+= 150
			client_print_color(id,DontChange,  "%s Fiind eventul^x04 Lucky Hour^x01 activ, ai primit +^4 150XP",  DENUMIRE );
		}
	}
}
public CheckForEvents(  iEnt  )
{
	entity_set_float(  iEnt,  EV_FL_nextthink,  get_gametime(    )  +  1.0  );
	if(  get_pcvar_num(  gCvarEnableHappyHour  )  ==  1  )	CheckForEvent( EVENT_HAPPY_HOUR  );
	if(  get_pcvar_num(  gCvarEnableFreeGiftsHour  )  ==  1  )	CheckForEvent( EVENT_FREEGIFTS_HOUR  );
	if(  get_pcvar_num(  gCvarEnableLuckyHour  )  ==  1  )	CheckForEvent( EVENT_LUCKY_HOUR  );
	if(  get_pcvar_num(  gCvarEnableShoppingHour  )  ==  1  )	CheckForEvent( EVENT_SHOPPING_HOUR );
}
public CheckForEvent( const iCheckedEvent )
{
	static _EventHours[ 64 ], iHours[ 5 ], szHours[ 5 ][  10  ], _hour[ 5 ], minute[ 5 ];
	GetCvarString(  iCheckedEvent,  _EventHours,  sizeof ( _EventHours ) -1  );
	
	parse(  _EventHours,  szHours[ 0 ],  sizeof (  szHours[]  )  -1,
			szHours[ 1 ],  sizeof (  szHours[]  )  -1,
			szHours[ 2 ],  sizeof (  szHours[]  )  -1,
			szHours[ 3 ],  sizeof (  szHours[]  )  -1,
			szHours[ 4 ],  sizeof (  szHours[]  )  -1);

	//get_time("%H",_hour, sizeof( _hour ) - 1)
	format_time( _hour, sizeof( _hour ) - 1, "%H",-1 );
	//get_time("%M",minute, sizeof( minute ) - 1)
	format_time( minute, sizeof( minute ) - 1, "%M",-1 );
	
	new c_hour = str_to_num( _hour );

	for(  new i = 0; i < 5; i++  )	iHours[ i ] = str_to_num(  szHours[ i ] );
	
	if( !IsEventActive(  iCheckedEvent  ) )
	{
		if(  c_hour  ==  iHours[  0  ]  ||  c_hour  ==  iHours[  1  ]  ||  c_hour  ==  iHours[  2  ] 
			||  c_hour  ==  iHours[  3  ] ||  c_hour  ==  iHours[  4  ] )	ActivateEvent(  iCheckedEvent,  c_hour, minute  );
	}
	else if( IsEventActive(  iCheckedEvent )  )//ss..
	{
		if(  c_hour  ==  iHours[  0  ]  ||  c_hour  ==  iHours[  1  ]  ||  c_hour  ==  iHours[  2  ] 
			||  c_hour  ==  iHours[  3  ] ||  c_hour  ==  iHours[  4  ] )	return 1;
			
		DeActivateEvent(  iCheckedEvent  );
	}

	return 0
}
GetCvarString(  const iCheckedEvent, _EventHours[   ],  iLen  )
{
	new szCvarString[ 32 ];
	switch(  iCheckedEvent  )
	{
		case EVENT_HAPPY_HOUR:	get_pcvar_string(  gCvarHappyHours, szCvarString,  sizeof ( szCvarString ) -1  );
		case EVENT_FREEGIFTS_HOUR:	get_pcvar_string(  gCvarFreeGiftsHours, szCvarString,  sizeof ( szCvarString ) -1  );
		case EVENT_LUCKY_HOUR:	get_pcvar_string(  gCvarLuckyHours, szCvarString,  sizeof ( szCvarString ) -1  );
		case EVENT_SHOPPING_HOUR:	get_pcvar_string(  gCvarShoppingHours, szCvarString,  sizeof ( szCvarString ) -1  );
	}
	
	formatex(  _EventHours,  iLen, "%s", szCvarString  );//return..
}
bool:IsEventActive(  const iCheckedEvent  )
{
	new bool:ValueToReturn = false;
	switch(  iCheckedEvent  )
	{
		case EVENT_HAPPY_HOUR:	ValueToReturn = g_bHappyHourEvent;
		case EVENT_FREEGIFTS_HOUR:	ValueToReturn = g_bFreeGiftsHourEvent;
		case EVENT_LUCKY_HOUR:	ValueToReturn = g_bLuckyHourEvent;
		case EVENT_SHOPPING_HOUR:	ValueToReturn = g_bShoppingHourEvent;
	}
	return ValueToReturn;
}
ActivateEvent(  const iEvent,  const c_hour,  const minute[    ]  )
{
	switch(  iEvent  )
	{
		case EVENT_HAPPY_HOUR:
		{
			g_bHappyHourEvent  =  true;
			
			set_hudmessage(  0,  255,  0,  -1.0, 0.05,  0,  0.0 ,10.0,  0.0,  0.1,  3  );
			ShowSyncHudMsg(  0,  SyncHudMessage,  "Este ora %d:%d !^nEventul Happy Hour a inceput !^nIn aceasta ora veti primi XP dublu !",  c_hour, minute );
			
			client_print_color(0,DontChange,  "%s Este ora^x04 %d:%d^x01 !",  DENUMIRE,  c_hour, minute  );
			client_print_color(0,DontChange,  "%s Eventul^x04 Happy Hour^x01 a inceput !",  DENUMIRE );
			client_print_color(0,DontChange,  "%s In aceasta ora veti primi^x04 XP^x01 dublu !",  DENUMIRE  );
			for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i, g_szFmuEventBegin  );
			
		}
		case EVENT_FREEGIFTS_HOUR:
		{
			g_bFreeGiftsHourEvent  =  true;
			
			set_hudmessage(  0,  255,  0,  -1.0, 0.25,  0,  0.0 ,10.0,  0.0,  0.1,  1  );
			ShowSyncHudMsg(  0,  SyncHudMessage1,  "Este ora %d:%d !^nEventul Free Gifts Hour a inceput !^nIn aceasta ora veti primi %dXP la fiecare spawn !",  c_hour, minute,get_pcvar_num(xp_spawn) );
			
			client_print_color(0,DontChange,  "%s Este ora^x04 %d:%d^x01 !",  DENUMIRE,  c_hour, minute  );
			client_print_color(0,DontChange,  "%s Eventul^x04 Free Gifts Hour^x01 a inceput !",  DENUMIRE );
			client_print_color(0,DontChange,  "%s In aceasta ora veti primi^x04 %dXP^x01 la fiecare spawn !",  DENUMIRE,get_pcvar_num(xp_spawn)  );
			for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i,g_szFmuEventBegin  );
		}
		case EVENT_LUCKY_HOUR:
		{
			g_bLuckyHourEvent  =  true;
			
			set_hudmessage(  0,  255,  0,  -1.0, 0.45,  0,  0.0 ,10.0,  0.0,  0.1,  4  );
			ShowSyncHudMsg(  0,  SyncHudMessage2,  "Este ora %d:%d !^nEventul Lucky Hour a inceput !^nIn aceasta ora aveti 75% sanse sa primiti un cadou la spawn !",  c_hour, minute );
			
			client_print_color(0,DontChange,  "%s Este ora^x04 %d:%d^x01 !",  DENUMIRE,  c_hour, minute  );
			client_print_color(0,DontChange,  "%s Eventul^x04 Lucky Hour^x01 a inceput !",  DENUMIRE );
			client_print_color(0,DontChange,  "%s In aceasta ora aveti^x04 75%^x01 sanse sa primiti un cadou la spawn !",  DENUMIRE  );
			for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i, g_szFmuEventBegin  );
		}
		case EVENT_SHOPPING_HOUR:
		{
			g_bShoppingHourEvent  =  true;
			
			set_hudmessage(  0,  255,  0,  -1.0, 0.65,  0,  0.0 ,10.0,  0.0,  0.1,  2  );
			ShowSyncHudMsg(  0,  SyncHudMessage5,  "Este ora %d:%d !^nEventul Shopping Hour a inceput !^nIn aceasta ora cumparati orice item din shop la jumatate de pret!",  c_hour, minute );
			
			client_print_color(0,DontChange,  "%s Este ora^x04 %d:%d^x01 !",  DENUMIRE,  c_hour, minute  );
			client_print_color(0,DontChange,  "%s Eventul^x04 Lucky Hour^x01 a inceput !",  DENUMIRE );
			client_print_color(0,DontChange,  "%s In aceasta ora cumparati orice item din shop la jumatate de pret !",  DENUMIRE  );
			for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i,g_szFmuEventBegin  );
		}
	}
}

DeActivateEvent(  const iEvent )
{
	switch(  iEvent  )
	{
		case EVENT_HAPPY_HOUR:
		{
			g_bHappyHourEvent  =  false;
		
			set_hudmessage(  0,  255,  0,  -1.0,  0.05,  0,  0.0 ,10.0,  0.0,  0.1,  3  );
			ShowSyncHudMsg(  0,  SyncHudMessage,  "Eventul Happy Hour s-a incheiat !" );
			
			client_print_color(0,DontChange,  "%s Eventul^x04 Happy Hour^x01 s-a incheat !",  DENUMIRE );
		}
		case EVENT_FREEGIFTS_HOUR:
		{
			g_bFreeGiftsHourEvent  =  false;
		
			set_hudmessage(  0,  255,  0,  -1.0, 0.25,  0,  0.0 ,10.0,  0.0,  0.1,  1  );
			ShowSyncHudMsg(  0,  SyncHudMessage1,  "Eventul Free Gifts Hour s-a incheiat !" );
			
			client_print_color(0,DontChange,  "%s Eventul^x04 Free Gifts Hour^x01 s-a incheat !",  DENUMIRE );
		}
		case EVENT_LUCKY_HOUR:
		{
			g_bLuckyHourEvent  =  false;
			set_hudmessage(  0,  255,  0,  -1.0,  0.45,  0,  0.0 ,10.0,  0.0,  0.1,  4  );
			ShowSyncHudMsg(  0,  SyncHudMessage2,  "Eventul Lucky Hour s-a incheiat !" );
			
			client_print_color(0,DontChange,  "%s Eventul^x04 Lucky Hour^x01 s-a incheat !",  DENUMIRE );
		}
		case EVENT_SHOPPING_HOUR:
		{
			g_bShoppingHourEvent  =  false;
			set_hudmessage(  0,  255,  0,  -1.0,  0.65,  0,  0.0 ,10.0,  0.0,  0.1,  2  );
			ShowSyncHudMsg(  0,  SyncHudMessage5,  "Eventul Shopping Hour s-a incheiat !" );
			
			client_print_color(0,DontChange,  "%s Eventul^x04 Shopping Hour^x01 s-a incheat !",  DENUMIRE );
		}
	}
}
public ClCmdSayEvents( id )
{
	new  menu  =  menu_create(  "\rZE Events", "FmuEventsMenuHandler");
	new szHappyHour[ 64 ], szFreeGiftsHour[ 64 ], szLuckyHour[ 64 ], szShoppingHour[ 64 ];
	
	formatex(  szHappyHour,  sizeof ( szHappyHour ) -1, "\wHappy Hour \r- %s", g_bHappyHourEvent ? "\yInceput" : "\dTerminat"  );
	formatex(  szFreeGiftsHour,  sizeof ( szFreeGiftsHour ) -1, "\wFree Gifts Hour \r- %s", g_bFreeGiftsHourEvent ? "\yInceput" : "\dTerminat"  );
	formatex(  szLuckyHour,  sizeof ( szLuckyHour ) -1, "\wLucky Hour \r- %s", g_bLuckyHourEvent ? "\yInceput" : "\dTerminat"  );
	formatex(  szShoppingHour,  sizeof ( szShoppingHour ) -1, "\wShopping Hour \r- %s", g_bShoppingHourEvent ? "\yInceput" : "\dTerminat"  );
	
	menu_additem(  menu,  "\wMagic Word \r- \yActiv" ,  "1",  0  );
	menu_additem(  menu,  "\wUnique Word \r- \yActiv",  "2",  0  );
	menu_additem(  menu,  szHappyHour,  "3",  0  );
	menu_additem(  menu,  szFreeGiftsHour,  "4",  0  );
	menu_additem(  menu,  szLuckyHour,  "5",  0  );
	menu_additem(  menu,  szShoppingHour,  "6",  0  );
	
	menu_setprop(  menu,  MPROP_EXITNAME, "\wIesire" );
	menu_display(  id, menu  );
}
public FmuEventsMenuHandler(  id,  menu,  item)
{
	if(  item  ==  MENU_EXIT  )
	{
		menu_destroy(  menu  );
		return 1;
	}
	
	static _access, info[4], callback;
	menu_item_getinfo(  menu,  item,  _access,  info,  sizeof  (  info  )  -  1,  _,  _,  callback  );
	//menu_destroy(  menu  );
	
	new iKey  =  str_to_num(  info  );
	switch(  iKey  )
	{
		case 1:	ShowMWInfo( id );
		case 2:	ShowUQWInfo( id );
		case 3:	ShowHappyHourInfo( id );
		case 4:	ShowFreeGiftsHourInfo( id );
		case 5: ShowLuckyHourInfo( id );
		case 6: ShowShoppingHourInfo( id );
	}
	
	return 0;
}
public ShowMWInfo(  id  )
{
	static motd[  2500  ];
	new len = formatex( motd, sizeof ( motd )  - 1,	"<html>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<style type=^"text/css^">"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "body{background-image: url(^"http://i52.tinypic.com/qoukhx.png^");font-family:Tahoma;font-size:15px;color:#FFFFFF;}</style>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<body><center><font face=^"Verdana^" size=^"2^"><b><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<font size=^"4^" color=^"#F08080^">Magic Word</font><br><br><br><br><br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Acest event consta intr-un cuvant generat la intamplare care,<br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,   "are o dimensiune cuprinsa intre 10 si 15 caractere si, apare la fiecare %i de secunde.<br><br>" , get_pcvar_num( gCvarMagicWordIterval )  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Primul jucator care il scrie exact asa cum a fost generat, va primi un premiu in valoare de %iXP.<br>", get_pcvar_num( gCvarMagicWordXP ) );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "XP-ul va fi dublat in cazul in care eventul Happy Hour este Activ sau jucatorul respectiv este VIP iar,<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "cand ambele cazuri sunt intalnite, acesta v-a primi de 3x XP-ul respectiv.<br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Deasemenea jucatorii au la dispozitie %i secunde sa scrie Cuvantul Magic.<br>", get_pcvar_num( gCvarMagicWordAnswerTime )  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Eventul mai poate fi activat instant de un manager prin comanda 'amx_magicword'.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center></body></html>"  );
	
	show_motd(  id,  motd,  "Magic Word Info");
}
public ShowUQWInfo(  id  )
{
	static motd[  2500  ];
	new len = formatex( motd, sizeof ( motd )  - 1,	"<html>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<style type=^"text/css^">"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "body{background-image: url(^"http://i52.tinypic.com/qoukhx.png^");font-family:Tahoma;font-size:15px;color:#FFFFFF;}</style>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<body><center><font face=^"Verdana^" size=^"2^"><b><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<font size=^"4^" color=^"#F08080^">Unique Word</font><br><br><br><br><br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Acest event consta intr-un cuvant generat la intamplare care are o dimensiune cuprinsa intre 30 si 35 caractere si,<br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "care apare o singura data pe harta atunci cand au trecut %i de secunde de la inceputul hartii.<br><br>" , get_pcvar_num( gCvarUniqueWordDelay )  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Primul jucator care il scrie exact asa cum a fost generat, va primi un premiu in valoare de %iXP<br>", get_pcvar_num( gCvarUniqueWordXP )  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "XP-ul va fi dublat in cazul in care eventul Happy Hour este Activ sau jucatorul respectiv este VIP iar,<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "cand ambele cazuri sunt intalnite, acesta v-a primi de 3x XP-ul respectiv.<br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Deasemenea jucatorii au la dispozitie %i secunde sa scrie acest Cuvant Unic.<br>", get_pcvar_num( gCvarUniqueWordAnswerTime )  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Eventul mai poate fi activat instant de un manager prin comanda 'amx_uniqueword'.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center></body></html>"  );
	
	show_motd(  id,  motd,  "Unique Word Info");
}
public ShowHappyHourInfo(  id  )
{
	static motd[  2500  ];
	new len = formatex( motd, sizeof ( motd )  - 1,	"<html>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<style type=^"text/css^">"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "body{background-image: url(^"http://i52.tinypic.com/qoukhx.png^");font-family:Tahoma;font-size:15px;color:#FFFFFF;}"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "table{font-family:Tahoma;font-size:10px;color:#FFFFFF;}</style>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<body><center><font face=^"Verdana^" size=^"2^"><b><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<font size=^"4^" color=^"#F08080^">Happy Hour</font><br><br><br><br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Acest event face ca orice xp primesti( mai putin cel prin transfer sau givexp ) sa fie dublat.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "In tabelul ce urmeaza veti gasi orele la care eventul incepe si orele la care se termina.<br><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center><table align=center width=40%% cellpadding=1 cellspacing=0>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><th width=20%%>Incepe la <th width=20%%>Se termina la"  );
	
	static _EventHours[ 64 ], iHours[ 5 ], szHours[ 5 ][  10  ];//aiurea....tot
	GetCvarString(  EVENT_HAPPY_HOUR,  _EventHours,  sizeof ( _EventHours ) -1  );
	
	parse(  _EventHours,  szHours[ 0 ],  sizeof (  szHours[]  )  -1,
			szHours[ 1 ],  sizeof (  szHours[]  )  -1,
			szHours[ 2 ],  sizeof (  szHours[]  )  -1,
			szHours[ 3 ],  sizeof (  szHours[]  )  -1,
			szHours[ 4 ],  sizeof (  szHours[]  )  -1);
	
	for(  new i = 0; i < 5; i++  )
	{
		iHours[ i ] = str_to_num(  szHours[ i ] );
		len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><td>%d:00</td><td>%d:00</td>",  iHours[ i ], iHours[ i ] + 1  );
	}
	
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</table><center><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Daca esti VIP si Happy Hour este activ, orice XP vei primi se va multiplica de 3x.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center></body></html>"  );
	
	show_motd(  id,  motd,  "Happy Hour Info");
}
public ShowFreeGiftsHourInfo(  id  )
{
	static motd[  2500  ];
	new len = formatex( motd, sizeof ( motd )  - 1,	"<html>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<style type=^"text/css^">"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "body{background-image: url(^"http://i52.tinypic.com/qoukhx.png^");font-family:Tahoma;font-size:15px;color:#FFFFFF;}"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "table{font-family:Tahoma;font-size:10px;color:#FFFFFF;}</style>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<body><center><font face=^"Verdana^" size=^"2^"><b><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<font size=^"4^" color=^"#F08080^">Free Gifts Hour</font><br><br><br><br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Acest event face ca orice la fiecare spawn sa primesti %dXP..<br>",get_pcvar_num(xp_spawn)  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "In tabelul ce urmeaza veti gasi orele la care eventul incepe si orele la care se termina.<br><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center><table align=center width=40%% cellpadding=1 cellspacing=0 >"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><th width=20%%>Incepe la <th width=20%%>Se incheie la"  );
	
	static _EventHours[ 64 ], iHours[ 5 ], szHours[ 5 ][  10  ];
	GetCvarString(  EVENT_FREEGIFTS_HOUR,  _EventHours,  sizeof ( _EventHours ) -1  );
	
	parse(  _EventHours,  szHours[ 0 ],  sizeof (  szHours[]  )  -1,
			szHours[ 1 ],  sizeof (  szHours[]  )  -1,
			szHours[ 2 ],  sizeof (  szHours[]  )  -1,
			szHours[ 3 ],  sizeof (  szHours[]  )  -1,
			szHours[ 4 ],  sizeof (  szHours[]  )  -1);
	
	for(  new i = 0; i < 5; i++  )
	{
		iHours[ i ] = str_to_num(  szHours[ i ] );
		len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><td>%d:00</td><td>%d:00</td>",  iHours[ i ], iHours[ i ] + 1  );
	}

	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</table><center><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Daca esti VIP sau Happy Hour este activ, valoarea XP-ului va fi aceeasi.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center></body></html>"  );
	
	show_motd(  id,  motd,  "Free Gifts Hour Info");
}
public ShowLuckyHourInfo(  id  )
{
	static motd[  2500  ];
	new len = formatex( motd, sizeof ( motd )  - 1,	"<html>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<style type=^"text/css^">"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "body{background-image: url(^"http://i52.tinypic.com/qoukhx.png^");font-family:Tahoma;font-size:15px;color:#FFFFFF;}"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "table{font-family:Tahoma;font-size:10px;color:#FFFFFF;}</style>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<body><center><font face=^"Verdana^" size=^"2^"><b><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<font size=^"4^" color=^"#F08080^">Lucky Hour</font><br><br><br><br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Cand acest event este inceput, la fiecare spawn ai 50% sanse sa primesti un cadou.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Acest cadou poate fi: 150XP, 25HP, 25AP, 25HP si 25AP.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "In tabelul ce urmeaza veti gasi orele la care eventul incepe si orele la care se termina.<br><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center><table align=center width=40%% cellpadding=1 cellspacing=0>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><th width=20%%>Incepe la <th width=20%%>Se termina la"  );
	
	static _EventHours[ 64 ], iHours[ 5 ], szHours[ 5 ][  10  ];
	GetCvarString(  EVENT_LUCKY_HOUR,  _EventHours,  sizeof ( _EventHours ) -1  );
	
	parse(  _EventHours,  szHours[ 0 ],  sizeof (  szHours[]  )  -1,
			szHours[ 1 ],  sizeof (  szHours[]  )  -1,
			szHours[ 2 ],  sizeof (  szHours[]  )  -1,
			szHours[ 3 ],  sizeof (  szHours[]  )  -1,
			szHours[ 4 ],  sizeof (  szHours[]  )  -1);
	
	for(  new i = 0; i < 5; i++  )
	{
		iHours[ i ] = str_to_num(  szHours[ i ] );
		len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><td>%d:00</td><td>%d:00</td>",  iHours[ i ], iHours[ i ] + 1  );
	}
	
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</table><center><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Daca esti VIP sau Happy Hour este activ, valorile XP-ului sau a Banilor vor fi aceleasi.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center></body></html>"  );
	
	show_motd(  id,  motd,  "Lucky Hour Info");
}
public ShowShoppingHourInfo(  id  )
{
	static motd[  2500  ];
	new len = formatex( motd, sizeof ( motd )  - 1,	"<html>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<style type=^"text/css^">"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "body{background-image: url(^"http://i52.tinypic.com/qoukhx.png^");font-family:Tahoma;font-size:15px;color:#FFFFFF;}"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "table{font-family:Tahoma;font-size:10px;color:#FFFFFF;}</style>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<body><center><font face=^"Verdana^" size=^"2^"><b><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<font size=^"4^" color=^"#F08080^">Shopping Hour</font><br><br><br><br>" );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Cand acest event este inceput, cumperi orice item din shop la jumatate de pret.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "Deasemenea in cazul in care castigi un premiu in bani la Magic Word, vei primi de 2x suma.<br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "In tabelul ce urmeaza veti gasi orele la care eventul incepe si orele la care se termina.<br><br><br>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</center><table align=center width=40%% cellpadding=1 cellspacing=0>"  );
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><th width=20%%>Incepe la <th width=20%%>Se termina la"  );
	
	static _EventHours[ 64 ], iHours[ 5 ], szHours[ 5 ][  10  ];
	GetCvarString(  EVENT_SHOPPING_HOUR,  _EventHours,  sizeof ( _EventHours ) -1  );
	
	parse(  _EventHours,  szHours[ 0 ],  sizeof (  szHours[]  )  -1,
			szHours[ 1 ],  sizeof (  szHours[]  )  -1,
			szHours[ 2 ],  sizeof (  szHours[]  )  -1,
			szHours[ 3 ],  sizeof (  szHours[]  )  -1,
			szHours[ 4 ],  sizeof (  szHours[]  )  -1);
	
	for(  new i = 0; i < 5; i++  )
	{
		iHours[ i ] = str_to_num(  szHours[ i ] );
		len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "<tr align=center><td>%d:00</td><td>%d:00</td>",  iHours[ i ], iHours[ i ] + 1  );
	}
	
	len += format(  motd[ len ],  sizeof ( motd ) - len - 1,	 "</table></body></html>"  );	
	show_motd(  id,  motd,  "Shopping Hour Info");
}
public ClCmdMagicWord(  id  )
{
	if( !UserHasFullAcces(  id  )  )
	{
		console_print(  id, "Nu ai acces la aceasta comanda !" );
		return 1;
	}
	
	read_argv(  1, g_szMagicWord, 14  );
	if( equal(  g_szMagicWord,  ""  )  )
	{
		remove_task( MagicWordTask );
		remove_task( MagicWordSecondTask );
		g_bPlayersCanAnswerForMW = false;
	
		ChooseRandomMagicWord(    );
	}
	else
	{
		remove_task( MagicWordTask );
		remove_task( MagicWordSecondTask );
		g_bPlayersCanAnswerForMW = false;
	
		DisplayMagicWord(    );
	}
	
	return 1;
}
public ClCmdUniqueWord(  id  )
{
	if( !UserHasFullAcces(  id  )  )
	{
		console_print(  id, "Nu ai acces la aceasta comanda !" );
		return 1;
	}
	
	remove_task( UniqueWordTask );
	remove_task( UniqueWordSecondTask );
	g_bPlayersCanAnswerForUQW = false;
	
	ChooseRandomUniqueWord(    );
	
	return 1;
}
public ChooseRandomMagicWord(    )
{
	if( !get_playersnum( ) ) return;
	
	new iLen  =  random_num(  10,  15  );
	format(  g_szMagicWord, sizeof ( g_szMagicWord ) -1, ""  );
	
	for(  new i = 0; i < iLen; i++ )	g_szMagicWord[ i ] = GetRandomCharacter(  );
	
	StartMagicWord(    );

	for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i,  "vox/doop.wav"  );
	//CheckUserStatus(id)
	
	set_task ( float(  get_pcvar_num(  gCvarMagicWordIterval  )  ), "ChooseRandomMagicWord", MagicWordTask  );
}
public DisplayMagicWord(    )
{
	if( !get_playersnum( ) ) return;
	
	StartMagicWord(    );
	for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i,  "vox/doop.wav"  );
	
	set_task ( float(  get_pcvar_num(  gCvarMagicWordIterval  )  ), "ChooseRandomMagicWord", MagicWordTask  );
}
public ChooseRandomUniqueWord(    )
{
	if( !get_playersnum( ) ) return;
	
	remove_task( UniqueWordTask );
	remove_task( UniqueWordSecondTask );
	
	new iLen  =  random_num(  30,  35  );
	format(  g_szUniqueWord, sizeof ( g_szUniqueWord ) -1, ""  );
	
	for(  new i = 0; i < iLen; i++ )	g_szUniqueWord[ i ] = GetRandomCharacter(  );
	
	StartUniqueWord(    );
	for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i, g_szFmuEventBegin  );
}
GetRandomCharacter(    )
{
	new Float:fRandom  =  random_float(  1.0,  100.0  );
	if(  fRandom  <=  25.0  )	return g_szSmallLetters[  random(  sizeof ( g_szSmallLetters )  )  ];
	else if(  fRandom  >  25.0  &&  fRandom  <=  50.0  )	return g_szLargeLetters[  random(  sizeof ( g_szLargeLetters )  )  ];
	else if(  fRandom  >  50.0  && fRandom  <  75.0  )	return g_szNumbers[  random(  sizeof ( g_szNumbers )  )  ];
	else if(  fRandom  >  75.0  )	return g_szSymbols[  random(  sizeof ( g_szSymbols )  )  ];
	
	return 1;
}
public StartUniqueWord(    )
{
	g_bPlayersCanAnswerForUQW  =  true;
	
	g_iUQAnswerTime  =  get_pcvar_num(  gCvarUniqueWordAnswerTime );
	CountUniqueAnswerTime(  );
}
public StartMagicWord(    )
{
	g_bPlayersCanAnswerForMW  =  true;
	
	g_iMWAnswerTime  =  get_pcvar_num(  gCvarMagicWordAnswerTime );
	CountMagicAnswerTime(  );
}
public CountUniqueAnswerTime(  )
{
	if(  g_bPlayersCanAnswerForUQW  )
	{
		if(  g_iUQAnswerTime  <=  0  )
		{
			g_bPlayersCanAnswerForUQW  =  false;
			client_print_color(0,DontChange,  "^x04[Unique Word]^x01 Nu a scris nimeni^x03 Cuvantul Unic^x01, poate harta viitoare.."  );
			return 1;
		}
		
		set_hudmessage(  0,  255,  255,  0.78, 0.20,  0,  0.0 ,1.0,  0.0,  0.1,  2  );
		ShowSyncHudMsg(  0,  SyncHudMessage4,  "Castiga %i XP primul care scrie^n-|   %s   |-^n^n%i secund%s ramas%s !!", get_pcvar_num(  gCvarUniqueWordXP ),
			g_szUniqueWord,  g_iUQAnswerTime, g_iUQAnswerTime  ==  1 ? "a" : "e", g_iUQAnswerTime  ==  1 ? "a" : "e"  );
		
		g_iUQAnswerTime--;
		
		set_task(  1.0,  "CountUniqueAnswerTime", UniqueWordSecondTask  );
	}
	
	return 0;
}
public CountMagicAnswerTime(  )
{
	if(  g_bPlayersCanAnswerForMW  )
	{
		if(  g_iMWAnswerTime  <=  0  )
		{
			g_bPlayersCanAnswerForMW  =  false;
			client_print_color(0,DontChange,  "%s Nu a scris nimeni cuvantul magic, poate data viitoare..",DENUMIRE  );
			return 1;
		}
		
		set_hudmessage(  0,  255,  255,  0.01, 0.20,  0,  0.0 ,1.0,  0.0,  0.1,  2  );
		ShowSyncHudMsg(  0,  SyncHudMessage3,  "Castiga un premiu primul care scrie  -|   %s   |-^n               %i secund%s ramas%s !!",
			g_szMagicWord,  g_iMWAnswerTime, g_iMWAnswerTime  ==  1 ? "a" : "e", g_iMWAnswerTime  ==  1 ? "a" : "e"  );
		
		g_iMWAnswerTime--;
		
		set_task(  1.0,  "CountMagicAnswerTime", MagicWordSecondTask  );
	}
	
	return 0;
}
public GiveUserGift(  id , iType )
{
	new szName[ 32 ];
	get_user_name(  id, szName, sizeof ( szName ) -1  );
	
	if( iType  ==  2  )
	{
		XP[id]+= get_pcvar_num(  gCvarUniqueWordXP  )
		client_print_color(0,DontChange,  "%s^4 %s^x01 a scris primul^x03 Cuvantul Unic^x01 si a primit^x03 %i XP^x01!", DENUMIRE, szName,  get_pcvar_num(  gCvarUniqueWordXP  ) );
		if( g_bHappyHourEvent )
		{
			client_print_color(0,DontChange,  "%s Deoarece este^x04 Happy Hour^x01 a mai primit un bonus de^x04 %i XP^x01!",DENUMIRE,  get_pcvar_num(  gCvarUniqueWordXP  ) );
			XP[id]+= get_pcvar_num(  gCvarUniqueWordXP  )+50 
		}
		if( IsUserVip( id ) )
		{
			client_print_color(0,DontChange,  "%s Pentru ca^x04 %s^x01 este^x04 VIP^x01 a mai primit^x04 %i XP^x01 !", DENUMIRE, szName,  get_pcvar_num(  gCvarUniqueWordXP  )  );
			XP[id]+= get_pcvar_num(  gCvarUniqueWordXP  )+75
		}
		format(  g_szUniqueWord, sizeof ( g_szUniqueWord ) -1, ""  );
	}
	else
	{
	new iRandom  =  random_num(  1, 100  );
	if(  iRandom  <=  35  )
	{
		XP[  id ]+= clamp(  XP[id]  +  69,  0,  100  );//ciudat
		client_print_color(0,DontChange,  "%s^4 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 XP^x01 prin SANSA !",DENUMIRE,  szName,  g_szMagicWord  );
		
		if( g_bShoppingHourEvent )
		{
			client_print_color(0,DontChange,  "%s Deoarece este^x04 Shopping Hour^x01 a mai primit^x04 XP^x01 prin SANSA !",DENUMIRE );
			XP[  id ]+= clamp(  XP[id]  +  69,  0,  100  );
		}
		if( IsUserVip( id ) )
		{
			client_print_color(0,DontChange,  "%s Pentru ca^x04 %s^x01 este^x04 VIP^x01 a mai primit^x04 XP^x01 prin SANSA !",DENUMIRE,  szName  );
			XP[  id ]+= clamp(  XP[id]  +  69,  0,  100  );
		}
	}
	else
	{
	XP[id]+= get_pcvar_num(  gCvarMagicWordXP  ) 
	client_print_color(0,DontChange,  "%s^4 %s^x01 a scris primul^x04 %s^x01 si a primit^x04 %i XP^x01 !",DENUMIRE,  szName,  g_szMagicWord, get_pcvar_num(  gCvarMagicWordXP  )  );
	if( g_bHappyHourEvent )
	{
		client_print_color(0,DontChange,  "%s Deoarece este^x04 Happy Hour^x01 a mai primit un bonus de^x04 %i XP^x01 !",DENUMIRE,  get_pcvar_num(  gCvarMagicWordXP  )  );
		XP[id]+= get_pcvar_num(  gCvarMagicWordXP  )
	}
	if( IsUserVip( id ) )
	{
		client_print_color(0,DontChange,  "%s Pentru ca^x04 %s^x01 este^x04 VIP^x01 a mai primit^x04 %i XP^x01 !",DENUMIRE,  szName,  get_pcvar_num(  gCvarMagicWordXP  )  );
		XP[id]+= get_pcvar_num(  gCvarMagicWordXP  ) 
	}
	formatex(  g_szMagicWord, sizeof ( g_szMagicWord ) -1, ""  );
	}
	}
	return 0;
}
stock bool:UserHasFullAcces(  id  )
{
	if( get_user_flags(  id  )  ==  read_flags( "abcdefghijklmnopqrstu"  )
		/*|| get_user_flags(  id  )  ==  read_flags( "abcdefghijklmnopqrstuvxy"  ) 
		|| get_user_flags(  id  )  ==  read_flags( "abcdefghijklmnopqrs" )
		|| get_user_flags(  id  )  ==  read_flags( "abcdefghijklmnopqrsvxy" )*/  )
		return true;
	
	return false;
	
}
stock bool:IsUserVip(  id  )
{
	if( get_user_flags(  id  )  &  ADMIN_LEVEL_H  )	return true;
	return false;
	
}
PlaySound(  id,  const szSound[    ]  )	emit_sound(  id, CHAN_AUTO, szSound, 1.0, ATTN_NORM, 0, PITCH_NORM  );
public task_PTRFunction( )
{
	if( get_pcvar_num( g_iCvarTREnable ) != 1 )	return;
		
	static iPlayers[ 32 ],iPlayersNum;
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )	return;
	
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		
		g_iUserTime[ id ]++;
		
		new iTime;
		iTime = get_pcvar_num( g_iCvarTRMinutes ) ;
		
		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;
			new iXP = get_pcvar_num( g_iCvarTRXP );
			
			XP[id]+=iXP
			client_print_color(id,DontChange, "%s Ai primit^x04 %i^x01XP pentru^x04 %i^x01 minut%s jucat%s!",
				DENUMIRE, iXP, iTime, iTime==1?"":"e", iTime==1?"":"e" );
		}
	}
}

public ham_take_dmg(victima, inductor, atacator, Float:daune)
{
	if(victima == atacator || get_user_team(atacator) == get_user_team(victima) || !is_user_alive(atacator))	return HAM_IGNORED;
	
	daune + Level[atacator]
	SetHamParamFloat(4, daune)
	
	daune_provocate[atacator] += floatround(daune)
	daune_provocate2[atacator] += floatround(daune)
	if(daune_provocate[atacator] >= get_pcvar_num(pcvar_hdmgnum))
	{
		daune_provocate[atacator] = 0
		XP[atacator]+=get_pcvar_num(pcvar_hdmg)
		client_print_color(atacator,DontChange, "%s Ai primit +^4 %d^1XP pentru ca ai provocat peste^4 %d^1DMG", DENUMIRE,get_pcvar_num(pcvar_hdmg), get_pcvar_num(pcvar_hdmgnum))
	}
	if(daune_provocate2[atacator] >= get_pcvar_num(pcvar_phdmgnum))
	{
		daune_provocate2[atacator] = 0
		Points[atacator]+=get_pcvar_num(pcvar_phdmg)
		client_print_color(atacator,DontChange, "%s Ai primit +^4 %d^1P pentru ca ai provocat peste^4 %d^1DMG", DENUMIRE, get_pcvar_num(pcvar_phdmg),get_pcvar_num(pcvar_phdmgnum))
	}
	return HAM_IGNORED;
}

public WIN_HM( )
{
	static iCvarEnable,iCvarEnableP
	iCvarEnable = get_pcvar_num( pcvar_wh );
	iCvarEnableP = get_pcvar_num( pcvar_pwh );

	if( iCvarEnable == 0 )	return;
	GiveTeamReward( CS_TEAM_CT,get_pcvar_num( pcvar_wh ), get_pcvar_num( pcvar_ah ),0,0 );

	if( iCvarEnableP == 0 )	return;
	GiveTeamReward( CS_TEAM_CT, 0,0,get_pcvar_num( pcvar_pwh ),get_pcvar_num( pcvar_pah ) );
}
public WIN_ZM( )
{
	static iCvarEnable,iCvarEnableP
	iCvarEnable = get_pcvar_num( pcvar_wz );
	iCvarEnableP = get_pcvar_num( pcvar_pwz );

	if( iCvarEnable == 0 )	return;
	GiveTeamReward( CS_TEAM_T,get_pcvar_num( pcvar_wz ), get_pcvar_num( pcvar_az ),0,0 );

	if( iCvarEnableP == 0 )	return;
	GiveTeamReward( CS_TEAM_T, 0,0,get_pcvar_num( pcvar_pwz ),get_pcvar_num( pcvar_paz ) );
}
public GiveTeamReward( const CsTeams:iTeam, xP,xPa,pts,ptsA )
{
	static iPlayers[ 32 ],iPlayersNum;
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )	return;
		
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		if( cs_get_user_team( id ) == iTeam )
		{
			if( is_user_alive( id ) )
			{
				if(xPa>0)
				{
					client_print_color(id,DontChange, "%s Ai primit^x04 %d^x01XP pentru ca ai supravietuit !",DENUMIRE ,xPa);
					XP[ id ] += xPa;
				}
				if(ptsA>0)
				{
					client_print_color(id,DontChange, "%s Ai primit^x04 %d^x01P pentru ca ai supravietuit !",DENUMIRE ,ptsA);
					Points[ id ] += ptsA;
				}
			}

			if(xP>0)
			{
				client_print_color(id,DontChange, "%s Ai primit^x04 %d^x01XP pentru castigarea rundei !",DENUMIRE, xP );
				XP[ id ] += xP;
			}
			if(pts>0)
			{
				client_print_color(id,DontChange, "%s Ai primit^x04 %d^x01P pentru castigarea rundei !",DENUMIRE ,pts);
				Points[ id ] += pts;
			}
		}
	}
}

public plugin_natives( )
{
	register_native( "ze_get_user_xp", "_get_user_xp" );
	register_native( "ze_set_user_xp", "_set_user_xp" );
	register_native( "ze_get_user_points", "_get_user_pts" );
	register_native( "ze_set_user_points", "_set_user_pts" );
	register_native( "ze_get_user_lvl", "_get_user_lvl",0 );
	register_native( "ze_set_user_lvl", "_set_user_lvl" );
	register_native( "ze_get_user_nx", "_get_user_nx",1 );

	register_native("ze_is_happy_hour", "_is_happy_hour");
	register_native("ze_is_freegifts_hour", "_is_freegifts_hour");
	register_native("ze_is_lucky_hour", "_is_lucky_hour");
	register_native("ze_is_shopping_hour", "_is_shopping_hour");
}
public _get_user_xp( iPlugin, iParams )
{
	new id=get_param( 1 )
	if(!is_user_connected(id)||is_user_bot(id)||is_user_hltv(id))	return -1
	return XP[ id ];
}
public _set_user_xp( iPlugin, iParams )
{
	new id=get_param( 1 )
	if(!is_user_connected(id)||is_user_bot(id)||is_user_hltv(id))	return -1
	XP[ id ] = max( 0, get_param( 2 ) );//xd
	return XP[ id ];
}
public _get_user_lvl( iPlugin, iParams )	return Level[ get_param( 1 ) ];
public _get_user_nx(id)
{
	if(!is_user_connected(id)||Level[id]>=MAX_LEVELS)	return -1

	return Xp[Level[id]]
}
public _set_user_lvl( iPlugin, iParams )
{
	new id=get_param( 1 )
	if(!is_user_connected(id)||is_user_bot(id)||is_user_hltv(id))	return -1
	Level[ id ] = max( 0, get_param( 2 ) );//xd
	return Level[ id ];
}
public _get_user_pts( iPlugin, iParams )
{
	new id=get_param( 1 )
	if(!is_user_connected(id)||is_user_bot(id)||is_user_hltv(id))	return -1
	return Points[ id ];
}
public _set_user_pts( iPlugin, iParams )
{
	new id=get_param( 1 )
	if(!is_user_connected(id)||is_user_bot(id)||is_user_hltv(id))	return -1
	Points[ id ] = max( 0, get_param( 2 ) );//xd
	return Points[ id ];
}
//public _get_user_rank( iPlugin, iParams )	return szTag[Level[get_param( 1 )]]	//set_string(2, szTag[Level[get_param(1)]], get_param(3))
/*												native sp_get_user_rankname(id, szRankName, iLen)	2-[] ?
													new szRankName[32]
													sp_get_user_rankname(id, szRankName, charsmax(szRankName)) 
*/

public bool:_is_happy_hour(  plugin,  params  )	return g_bHappyHourEvent;
public bool:_is_freegifts_hour(  plugin,  params  )	return g_bFreeGiftsHourEvent;
public bool:_is_lucky_hour(  plugin,  params  )	return g_bLuckyHourEvent;
public bool:_is_shopping_hour(  plugin,  params  )	return g_bShoppingHourEvent;

public client_putinserver(id)
{
	if(is_user_bot(id)||is_user_hltv(id))	return

	LoadData(id)

	g_iUserTime[ id ] = 0;

	set_task(TIME,"RefreshTime",id,_,_,"b",0);
}
public RefreshTime(id)	checkandupdatetop(id,XP[id],Level[id])
public client_disconnect(id)
{
	if(is_user_bot(id)||is_user_hltv(id))	return

	SaveData(id)

	g_iUserTime[ id ] = 0;
}

public player_spawn(id) {
	if(!is_user_alive(id) || is_user_bot(id))	return HAM_HANDLED

	if(!Level[id])	Level[id]=1


	daune_provocate[id]=0
	daune_provocate2[id]=0

	CheckUserStatus(id)

	if(g_bFreeGiftsHourEvent)
	{
		XP[id]+=get_pcvar_num(xp_spawn)
		client_print_color(id,DontChange, "%s Fiind eventul^x04 Free Gifts Hour^x01 activ, ai primit +^4 %dXP",  DENUMIRE,get_pcvar_num(xp_spawn) );
	}
	if(g_bLuckyHourEvent)
	{
		new iRandomChance=random_num(0,80)
		if( iRandomChance <= 75 )	GivePlayerGift( id );
	}


	g_bBoughtPrimary[id] = false
	g_bBoughtSecondary[id] = false
	g_bBoughtKnife[id] = false

	cs_reset_player_model(id)
	
	if (!ze_is_user_zombie(id))
	{
		strip_user_weapons(id)
		give_item(id,"weapon_knife")

		// Open available buy menus
		Show_Available_Buy_Menus(id)
	
		// Give HE Grenade
		if (get_pcvar_num(g_pCvarHEGrenade) != 0)	give_item(id, "weapon_hegrenade")
	
		// Give Smoke Grenade
		if (get_pcvar_num(g_pCvarSmokeGrenade) != 0)	give_item(id, "weapon_smokegrenade")
	
		// Give Flashbang Grenade
		if (get_pcvar_num(g_pCvarFlashGrenade) != 0)	give_item(id, "weapon_flashbang")
	}

	set_user_armor(id,Level[id]*5)

	set_task(4.0,"set_model",id)

	return HAM_IGNORED
}

public set_model(id)
{
	if(!is_user_alive(id)||ze_is_user_neme(id))	return
	for(new i; i < sizeof(e_GM); i++)
	{
		if(Level[id]==e_GM[i][mLV])
		{
			cs_set_player_model(id, e_GM[i][cs_get_user_team(id) == CS_TEAM_CT ? hmP : zmP])
			//client_print(id,print_chat,"TI A FOST SETAT %s pt lvl %d",e_GM[i][cs_get_user_team(id) == CS_TEAM_CT ? hmP : zmP],e_GM[i][mLV])
		}
		else if((Level[id]-1)>=2&&((Level[id]-1)==e_GM[i][mLV]))
		{
			cs_set_player_model(id, e_GM[i][cs_get_user_team(id) == CS_TEAM_CT ? hmP : zmP])
			//client_print(id,print_chat,"TI A FOST SETAT %s pt lvl %d",e_GM[i][cs_get_user_team(id) == CS_TEAM_CT ? hmP : zmP],e_GM[i][mLV])
		}
	}
}
public zp_user_infected_post(id,infector)
{
	//client_print(id,print_chat,"PROBA 1")
	if(Level[id]>=2)
	{
		set_task(1.5,"set_model",id)
		//client_print(id,print_chat,"PROBA 2 LVL")
	}
}
public Knife_Model( plr ) 
{
	new id = get_pdata_cbase( plr, 41, 4 ); 
	if( is_user_alive(id)&&g_bBoughtKnife[id]&&!ze_is_user_zombie(id))
	{
		new szFile[128]
		for(new i;i<sizeof(e_kB);i++)
		{
			if(!strlen(e_kB[i][kVM])&&!strlen(e_kB[i][kPM]))	return
			if(Level[id]==e_kB[i][kLV])
			{
				formatex(szFile, charsmax(szFile), "models/v_%s.mdl", e_kB[i][kVM])
				set_pev( id, pev_viewmodel2, szFile )

				formatex(szFile, charsmax(szFile), "models/p_%s.mdl", e_kB[i][kPM])
				set_pev( id, pev_weaponmodel2, szFile )
			}
			else if((Level[id]-1)>=2&&(Level[id]-1)==e_kB[i][kLV])
			{
				formatex(szFile, charsmax(szFile), "models/v_%s.mdl", e_kB[i][kVM])
				set_pev( id, pev_viewmodel2, szFile )

				formatex(szFile, charsmax(szFile), "models/p_%s.mdl", e_kB[i][kPM])
				set_pev( id, pev_weaponmodel2, szFile )
			}
		}
	}
}

public hook_say(id) {
	static s_Args[192];
	read_args(s_Args, sizeof(s_Args) - 1);
	//if( !s_Args[ 0 ]) return 0;
	remove_quotes(s_Args);
	if(  equali(  s_Args, ""  )  )	return 0;
	
	if(equali(s_Args, "/rank", strlen("/rank"))) {
		replace(s_Args, sizeof(s_Args) - 1, "/", "");
		client_cmd(id, "amx_%s", s_Args);
	}
	if(equal(s_Args,"/top15"))	cmdTop15(id)
	if(equal(s_Args,"/event"))	ClCmdSayEvents(id)
	if(equal(s_Args,"/guns"))	CheckSelected(id)

	if(  g_bPlayersCanAnswerForMW || g_bPlayersCanAnswerForUQW  )
	{
		if(  equal(  s_Args,  g_szMagicWord  )  )
		{
			g_bPlayersCanAnswerForMW  =  false;
			for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i,  "vox/woop.wav"  );
			GiveUserGift(  id , 1 );//nu e 1...
		}
		else if(  equal(  s_Args,  g_szUniqueWord  )  )
		{
			g_bPlayersCanAnswerForUQW  =  false;
			for(new i=1;i<=get_maxplayers();i++)	PlaySound(  i,  "vox/doop.wav"  );
			GiveUserGift(  id, 2  );
		}
	}
	
	return 0;
}
/*      INFO ABOUT PERSONAL XP/LEVEL      */
public ShowPlayerLevel(id)
{
	new arg[32]
	read_argv(1, arg, charsmax(arg));
	if(equali(arg, ""))
	{
		if(Level[id]<MAX_LEVELS)	client_print_color(id,DontChange, "%s Ai^4 %dXp^1 din^4 %d^1 cu Level^4 %d^1 si^4 %d^1 Points",DENUMIRE,XP[id],Xp[Level[id]],Level[id],Points[id])
		else	client_print_color(id,DontChange, "%s^3 Feilicitari!^1 Ai atins nivelul maxim!!",DENUMIRE)
	}
	else
	{
		new player = cmd_target(id, arg,CMDTARGET_NO_BOTS),name[32];
		get_user_name(player,name,charsmax(name))
	
		if(!player) {
			client_print_color(id,DontChange, "%s Acest jucator nu exista",DENUMIRE);
			return PLUGIN_HANDLED;
		}

		switch(get_user_team(player))
		{
			case 1:
			{
				if(Level[player]<MAX_LEVELS)	client_print_color(id, Red, "%s Nivelul lu^3 %s^1 este^4 %d^1 - XP:^3 %d^1/^4%d^1 - Puncte:^3 %d",DENUMIRE,name, Level[player],XP[player],Xp[Level[player]], Points[player])
				else	client_print_color(id, Red, "%s^3 %s^1 a atins nivelul maxim!",DENUMIRE,name)
			}
			case 2:
			{
				if(Level[player]<MAX_LEVELS)	client_print_color(id, Blue, "%s Nivelul lu^3 %s^1 este^4 %d^1 - XP:^3 %d^1/^4%d^1 - Puncte:^3 %d",DENUMIRE,name, Level[player],XP[player],Xp[Level[player]], Points[player])
				else	client_print_color(id, Blue, "%s^3 %s^1 a atins nivelul maxim!",DENUMIRE,name)
			}
		}
	}
	return PLUGIN_HANDLED
}
public cmdTop15(id)
{
	new g_szBuffer[2045],line[125]

	formatex( line, charsmax(line), "<html><head><meta charset=^"UTF-8^"></head><body bgcolor=#FFFFFF><center><img src=%s>", g_szImageLink );
	add(g_szBuffer,charsmax(g_szBuffer),line)
	add(g_szBuffer,charsmax(g_szBuffer), "<br><br><table width=100%% cellpadding=2 cellspacing=0 border=0><tr align=center bgcolor=#52697B>" );
	add(g_szBuffer,charsmax(g_szBuffer), "<th width=6%%># <th width=25%%> Nume<th width=25%%> LVL<th width=25%%> XP</tr>");

	for( new i = INFO_ZERO; i < NTOP; i++ )
	{
			if( topxp[i] == 0) {
				formatex( line, charsmax(line), "<tr align=center bgcolor=#232323><td>%d <td> - <td> -<td> -<td></tr>", (i+1) );
				add(g_szBuffer,charsmax(g_szBuffer),line)
			}
			else {
				new plname[32];
				get_user_name(id, plname ,31);
				if(equali(topnames[i],plname))
				{
					formatex( line, charsmax(line), "<tr align=center bgcolor=red><td>%d <td>%s<td> %d<td> %d</tr>", (i + 1), topnames[i],toplevels[i],topxp[i]);
					add(g_szBuffer,charsmax(g_szBuffer),line)
				}
				else
				{
					formatex( line, charsmax(line), "<tr align=center%s><td>%d <td>%s<td> %d<td> %d</tr>",( ( i%2 ) == 0 ) ? "" : " bgcolor=#A4BED6",(i+1),topnames[i],toplevels[i],topxp[i]);
					add(g_szBuffer,charsmax(g_szBuffer),line)
				}
			}
	}

	add(g_szBuffer,charsmax(g_szBuffer), "</table><br><b>" );
	switch(random_num(0,1))
	{
		case 0:	add(g_szBuffer,charsmax(g_szBuffer), "Chiar si tu poti ajunge printre cei mai buni..DOAR INCERCAND!</b></center></body></html>" );
		case 1:
		{
			formatex(line,charsmax(line), "%s</b></center></body></html>",g_szEndMessage)
			add(g_szBuffer,charsmax(g_szBuffer),line)
		}
	}

	show_motd(id, g_szBuffer, "Top 15 XP")
}

public ev_msg( ) {
	new kiler= read_data(1)//,hs= read_data(3)
	
	if(!is_user_connected(kiler)||kiler==read_data(2))	return

	/*new szWeapon[ 32 ];
	read_data( 4, szWeapon, charsmax( szWeapon ) );
	format( szWeapon, charsmax( szWeapon ), "weapon_%s", szWeapon );
	if( contain( szWeapon, "nade" ) >= 0 )	szWeapon = "weapon_hegrenade";
	new iWeapon = get_weaponid( szWeapon );

	if(hs)	Kill[kiler]+= get_pcvar_num(pcvar_hs)
	else if(iWeapon== CSW_KNIFE)
	{
		if(hs)	Kill[kiler]+= get_pcvar_num(pcvar_knife)+1
		else	Kill[kiler]+= get_pcvar_num(pcvar_knife)
	}
	else if(iWeapon== CSW_HEGRENADE )	Kill[kiler]+= get_pcvar_num(pcvar_he)
	else Kill[kiler]+= get_pcvar_num(pcvar_kill)*/

	CheckUserStatus(kiler)
}
public CheckUserStatus(id)
{
	if(!is_user_connected(id))	return
	if(Level[id] < MAX_LEVELS)
	{
		while(XP[id] >= Xp[Level[id]])
		{
			Level[id]++
			client_print_color(id,DontChange,"%s^3 Felicitari^1! Ai ajuns la level^4 %d",DENUMIRE,Level[id])
//			screen_fade(id, get_pcvar_num(pcvar_efect), get_pcvar_num(pcvar_r), get_pcvar_num(pcvar_g), get_pcvar_num(pcvar_b), 115)
			break
		}
	}
}
public checkandupdatetop(id, xp,levels) {
	if(is_user_bot(id)||is_user_hltv(id))	return
	get_user_name(id,name,charsmax(name))
	for (new i = INFO_ZERO; i < NTOP; i++)
	{
		if( xp > topxp[i]|| xp == topxp[i] && levels > toplevels[i])
		{
			new pos = i;	
			while( !equali(topnames[pos],name) && pos < NTOP )	pos++;
			
			for (new j = pos; j > i; j--)
			{
				formatex(topnames[j], 31, topnames[j-1]);
				topxp[j] = topxp[j-1];
				toplevels[j]= toplevels[j-1];
			}
			formatex(topnames[i], 31, name);
			
			topxp[i] =xp;
			toplevels[i] = levels;
			client_print_color(0,DontChange,"%s^4 %s^x01 este pe locul^4 %d^1 in^4 top^1 cu^4 %d^x01 xp^1 & level^4 %d", DENUMIRE, name,(i+1),xp,levels);
			save_top();
			break;
		}
		else if( equali(topnames[i], name)) break;	
	}
}
public read_top() {
	new Buffer[256],path[128];
	formatex(path, 127, "%s/TopXP.dat", Data);
	new f = fopen(path, "rt" );
	new i = INFO_ZERO;
	while( !feof(f) && i < NTOP+1)
	{
		fgets(f, Buffer, 255);
		new xp[25], levels[25];
		parse(Buffer, topnames[i], 31, xp, 24, levels, 24);
		topxp[i]= str_to_num(xp);
		toplevels[i]= str_to_num(levels);
		
		i++;
	}
	fclose(f);
}
public save_top() {
	new path[128];
	formatex(path, 127, "%s/TopXP.dat", Data);
	if( file_exists(path) )	delete_file(path);
	new Buffer[256];
	new f = fopen(path, "at");
	for(new i = INFO_ZERO; i < NTOP; i++)
	{
		formatex(Buffer, 255, "^"%s^" ^"%d^" ^"%d^"^n",topnames[i],topxp[i],toplevels[i] );
		fputs(f, Buffer);
	}
	fclose(f);
}

public CheckSelected(id)
{
	if (!g_bBoughtPrimary[id])	Show_Menu_Buy_Primary(id)
	else if (!g_bBoughtSecondary[id])	Show_Menu_Buy_Secondary(id)
	else if (!g_bBoughtKnife[id])	Show_Menu_Buy_Knife(id)
}
public Show_Available_Buy_Menus(id)
{
	// Already Bought
	if (g_bBoughtKnife[id]&&g_bBoughtPrimary[id] && g_bBoughtSecondary[id]||!is_user_alive(id)||ze_is_user_zombie(id))	return
	
	// Here we use if and else if so we make sure that Primary weapon come first then secondary
	if (!g_bBoughtPrimary[id])
	{
		// Primary
		Show_Menu_Buy_Primary(id)
	}
	if (!g_bBoughtSecondary[id]&&g_bBoughtPrimary[id])
	{
		// Secondary
		Show_Menu_Buy_Secondary(id)
	}
	if (!g_bBoughtKnife[id]&&g_bBoughtSecondary[id]&&g_bBoughtPrimary[id])
	{
		// Knife
		Show_Menu_Buy_Knife(id)
	}
}
public Show_Menu_Buy_Knife(id)
{
	new et[255],nw[125]
	// Title
	new menu=menu_create("\yMeniu Cutite","MHK")
	for(new i;i<sizeof (e_kB);i++)
	{
		if(Level[id]==e_kB[i][kLV])
		{
			if(!equal(e_kB[i][kN],""))	formatex(nw,charsmax(nw),"^n\w[\r BLOCAT\w ]\r %s\w [\d disponibil la lvl:\r %d\w ]",e_kB[i][kN],Level[id]+2);
			else nw="";
			formatex(et,charsmax(et),"\y%s%s", e_kB[i][kName],nw)
			menu_additem(menu,et)
		}
		else if((Level[id]-1)==e_kB[i][kLV])	menu_additem(menu,e_kB[i][kName])
	}
	menu_display( id, menu );
}
public MHK(id, Menu,Item)
{
	// Player dead or zombie or already bought knife
	if (!is_user_alive(id) || g_bBoughtKnife[id]||ze_is_user_zombie(id)||Item==MENU_EXIT)	return PLUGIN_HANDLED

	if(Level[id]==30)	ze_give_cknife(id)
	g_bBoughtKnife[id] = true
	
	return PLUGIN_HANDLED
}
public Show_Menu_Buy_Primary(id)
{
	new et[255],nw[125]
	new menu=menu_create("\yMeniu Arme Principale","MHP")
	for(new i;i<sizeof (e_pB);i++)
	{
		if(Level[id]==e_pB[i][pLV])
		{
			if(!equal(e_pB[i][pN],""))	formatex(nw,charsmax(nw),"^n\w[\r BLOCAT\w ]\r %s\w [\d disponibil la lvl:\r %d\w ]",e_pB[i][pN],Level[id]+2);
			else nw="";
			formatex(et,charsmax(et),"\y%s%s", e_pB[i][pName],nw)

			menu_additem(menu,et)
		}
		else if((((Level[id]-1)>=0&&(Level[id]-1)==e_pB[i][pLV])||(Level[id]-1)==e_pB[i][pLV])||Level[id]<e_pB[i][pLV]) SHOWWEAPONSP(id);
	}
	menu_display( id, menu );
	return PLUGIN_HANDLED
}
public MHP(id, menu,key)
{
	if (!is_user_alive(id) || g_bBoughtPrimary[id]||ze_is_user_zombie(id))	return PLUGIN_HANDLED
	if(key==MENU_EXIT)
	{
		Show_Menu_Buy_Primary(id)
		return PLUGIN_HANDLED
	}

	if(Level[id]==10||(Level[id]-1)==10)	ze_give_cak47(id)
	else if(Level[id]==15||(Level[id]-1)==15)	ze_give_cump45(id)
	else if(Level[id]==20||(Level[id]-1)==20)	ze_give_cm249(id)
	else if(Level[id]==25||(Level[id]-1)==25)	ze_give_cm4a1(id)
	else if(Level[id]==30)	ze_give_cm3(id)
	else
	{
		for(new i;i<sizeof (e_pB);i++)
		{
			if(Level[id]==e_pB[i][pLV])
			{
				if(!equal(e_pB[i][pG],"weapon_knife")&&e_pB[i][pBPA]>0&&e_pB[i][pG]!=CSW_KNIFE)
				{
					give_item(id,e_pB[i][pG])
					//cs_set_user_bpammo(id,e_pB[i][pC],e_pB[i][pBPA])
					engclient_cmd(id,e_pB[i][pG])
				}
			}
		}
	}
	// Primary bought
	g_bBoughtPrimary[id] = true
	Show_Menu_Buy_Secondary(id)
	
	return PLUGIN_HANDLED
}
public SHOWWEAPONSP(id)
{
	new menu=menu_create("\yMeniu Arme Principale","MHP2")
	new szTempid[32]
	//new nw[255],et[555]
	for(new i;i<sizeof (e_pB) && Level[id]>e_pB[i][pLV];i++)
	{
		num_to_str(i, szTempid, charsmax(szTempid) );
		menu_additem(menu,e_pB[i][pName],szTempid)
		/*if(!equal(e_pB[i][pN],""))	formatex(nw,charsmax(nw),"\w[\r BLOCAT\w ]\r %s\w [\d disponibil la lvl:\r %d\w ]",e_pB[i][pN],Level[id]+2);
		else nw="";
		menu_addtext(menu,nw)*/
	}
	menu_display( id, menu, 0 );
}
public MHP2(id,menu,key)
{
	if (!is_user_alive(id)|| g_bBoughtPrimary[id]||ze_is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}

	if(key==MENU_EXIT)
	{
		if(!g_bBoughtPrimary[id])
		{
			if(Level[id]>=20)	menu_display( id, menu, 1 );
			//set_task(0.1,"SHOWWEAPONSP",id)
			return PLUGIN_HANDLED
		}
	}

	new cmd[6], iName[64]
	new access, callback
	menu_item_getinfo(menu, key, access, cmd,5, iName, 63, callback)
	new wep = str_to_num(cmd)
	if(equal(iName,"PlasmaGun"))	ze_give_cak47(id)
	else if(equal(iName,"Ethereal"))	ze_give_cump45(id)
	else if(equal(iName,"Thanatos-VII"))	ze_give_cm249(id)
	else if(equal(iName,"Janus-V"))	ze_give_cm4a1(id)
	else if(equal(iName,"M32"))	ze_give_cm3(id)
	else
	{
		give_item(id,e_pB[wep][pG])
		engclient_cmd(id,e_pB[wep][pG])
	}

	g_bBoughtPrimary[id] = true
	set_task(1.0,"Show_Menu_Buy_Secondary",id)
	return PLUGIN_HANDLED
}

public Show_Menu_Buy_Secondary(id)
{
	new et[255],nw[125]
	// Title
	new menu=menu_create("\yMeniu Arme Secundare","MHS")
	for(new i=0;i<sizeof (e_sB);i++)
	{
		if(Level[id]==e_sB[i][sLV])
		{
			if(!equal(e_sB[i][sN],""))	formatex(nw,charsmax(nw),"^n\w[\r BLOCAT\w ]\r %s\w [\d disponibil la lvl:\r %d\w ]",e_sB[i][sN],Level[id]+2);
			else nw="";
			formatex(et,charsmax(et), "\y%s%s", e_sB[i][sName],nw)
			menu_additem(menu,et)
		}
		else if((((Level[id]-1)>=0&&(Level[id]-1)==e_sB[i][sLV])||(Level[id]-1)==e_sB[i][sLV])||Level[id]<e_sB[i][sLV])
		{
			SHOWWEAPONSS(id)
			//client_print(id,print_chat,"TRB SA VEZI MENIU DE LVL JOS")
		}
		/*else if(Level[id]>e_sB[i][sLV])
		{
			formatex(et,charsmax(et), "\y %s", e_sB[i][sName])
			menu_additem(menu,et,i)
		}*/
	}
	menu_display( id, menu );
	return PLUGIN_HANDLED
}
public MHS(id, menu,key)
{
	// Player dead or zombie or already bought secondary
	if (!is_user_alive(id) || g_bBoughtSecondary[id]||ze_is_user_zombie(id))	return PLUGIN_HANDLED
	if(key==MENU_EXIT)
	{
		 Show_Menu_Buy_Secondary(id)
		return PLUGIN_HANDLED
	}

	if(Level[id]==10||(Level[id]-1)==10)	ze_give_cdeagle(id)
	else if(Level[id]==20||(Level[id]-1)==20)	ze_give_cdeagle2(id)
	else if(Level[id]==30)	ze_give_celite(id)
	else
	{
		for(new i;i<sizeof (e_sB);i++)
		{
			if(Level[id]==e_sB[i][sLV])
			{
				if(!equal(e_sB[i][sG],"weapon_knife")&&e_sB[i][sBPA]>0&&e_sB[i][sG]!=CSW_KNIFE)
				{
					give_item(id,e_sB[i][sG])
					engclient_cmd(id,e_sB[i][sG])
				}
			}
		}
	}

	// Secondary bought
	g_bBoughtSecondary[id] = true
	Show_Menu_Buy_Knife(id)
	
	return PLUGIN_HANDLED
}
public SHOWWEAPONSS(id)
{
	new menu=menu_create("\yMeniu Arme Secundare","MHS2")
	for(new i;i<sizeof (e_sB) && Level[id]>e_sB[i][sLV];i++)
	{
		new szTempid[32]
		num_to_str(i, szTempid, charsmax(szTempid) );
		menu_additem(menu,e_sB[i][sName],szTempid)
	}
	menu_display( id, menu, 0 );
}
public MHS2(id,menu,key)
{
	if (!is_user_alive(id) || g_bBoughtSecondary[id]||ze_is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	if(key==MENU_EXIT&&!g_bBoughtSecondary[id])
	{
		set_task(0.1,"SHOWWEAPONSS",id)
		return PLUGIN_HANDLED
	}

	new cmd[6], iName[64]
	new access, callback
	menu_item_getinfo(menu, key, access, cmd,5, iName, 63, callback)
	new wep = str_to_num(cmd)
	if(equal(iName,"BloodHunter"))	ze_give_cdeagle(id)
	else if(equal(iName,"Cyclone"))	ze_give_cdeagle2(id)
	else if(equal(iName,"DualIninity"))	ze_give_celite(id)
	else
	{
		give_item(id,e_sB[wep][sG])
		engclient_cmd(id,e_sB[wep][sG])
	}

	g_bBoughtSecondary[id] = true
	menu_destroy(menu)
	set_task(1.0,"Show_Menu_Buy_Knife",id)
	return PLUGIN_HANDLED
}

public Fw_TouchWeapon_Pre(iEnt, id)
{
	if (get_pcvar_num(g_pCvarBlockWeapLowLvl) == 0)	return HAM_IGNORED;
	
	// Not alive or Not Valid Weapon?
	if(!is_user_alive(id) || !pev_valid(iEnt))	return HAM_IGNORED;
	
	// Get Weapon Model
	new szWeapModel[32]
	pev(iEnt, pev_model, szWeapModel, charsmax(szWeapModel))
	
	// Remove "models/w_" and ".mdl"
	copyc(szWeapModel, charsmax(szWeapModel), szWeapModel[contain(szWeapModel, "_" ) + 1], '.')
	
	// Set for mp5 to be same as "weapon_mp5navy"
	if(szWeapModel[1] == 'p' && szWeapModel[2] == '5')	szWeapModel = "mp5navy"
	
	// Add "weapon_" to all model names
	static szWeaponEnt[32]
	formatex(szWeaponEnt, charsmax(szWeaponEnt), "weapon_%s", szWeapModel)

	if(equal(szWeaponEnt,"weapon_hegrenade")||equal(szWeaponEnt,"weapon_flashbang")||equal(szWeaponEnt,"weapon_smokegrenade")
	/*||equal(szWeaponEnt,"weapon_kevlar")||equal(szWeaponEnt,"weapon_assault")*/)	return HAM_HANDLED

	for (new i; i < sizeof(e_pB); i++)	if (equali(szWeaponEnt, e_pB[i][pG]))	if(Level[id]!=e_pB[i][pLV])	return HAM_HANDLED
	for (new i; i < sizeof(e_sB); i++)	if (equali(szWeaponEnt, e_sB[i][sG]))	if(Level[id]!=e_sB[i][sLV])	return HAM_HANDLED
	
	return HAM_IGNORED;
}


SaveData(const id)
{
	get_user_name(id,name,charsmax(name))

	new vaultkey[64],vaultdata[64] 
	format(vaultkey, 63, "LM_%s", name) 
	format(vaultdata, 63, "%d %d %d", XP[id], Level[id],Points[id]) 
	set_vaultdata(vaultkey, vaultdata)//remove+update la if exists?
}
LoadData(const id)
{
	get_user_name(id,name,charsmax(name))
	new xpa[10],levela[6],pointsa[10]

	new vaultkey[64], vaultdata[64]
	format(vaultkey, 63, "LM_%s", name)
		//vaultdata_exists(vaultkey)
	if(get_vaultdata(vaultkey, vaultdata, 63))
	{
		parse(vaultdata, xpa, charsmax(xpa), levela, charsmax(levela),pointsa,charsmax(pointsa))
		XP[id] = str_to_num(xpa)
		Level[id] = str_to_num(levela)
		Points[id] = str_to_num(pointsa)
	}
	else	XP[id]=Level[id]=Points[id]=0
}

/*      Remove And Add XP      */
public CmdAddXP ( iPlayer, level, cid )
{
	if(!cmd_access(iPlayer,level,cid,2))	return PLUGIN_HANDLED

	new AdminName [ 32 ]
	get_user_name ( iPlayer, AdminName, charsmax ( AdminName ) )
	   
	new arg [ 32 ]
	read_argv ( 1, arg, 31 ) 
 
	new AddXP [ 32 ]
	read_argv ( 2, AddXP, charsmax ( AddXP ) )

	if(equal(arg,"")||equal(AddXP,""))
	{
		console_print(iPlayer,"Folosire: ze_exp_give <nick, #userid, authid | @all> <XP>")
		return PLUGIN_HANDLED
	}
 
	new XPtoGive = str_to_num ( AddXP )
	   
	if( arg[0]=='@' )
	{ 
		if( equali(arg[1],"all") )
		{
			new players[32], totalplayers, All
			get_players( players, totalplayers )
		    
			for ( new i = 0; i < totalplayers; i++ )
			{
				All = players[ i ]
					   
				XP[ All ] += XPtoGive
			}
			
			client_print_color(0,DontChange, "%s^3 %s^1 give^3 %d^1XP to all^4 players^1!",DENUMIRE, AdminName, XPtoGive )
		}
		else if( equali(arg[1],"t") )
		{
			new players[32], totalplayers, T
			get_players( players, totalplayers )
		    
			for ( new i = 0; i < totalplayers; i++ )
			{
				if ( get_user_team(players[ i ]) == 1 )
				{
					T = players[ i ]
						   
					XP[ T ] += XPtoGive
				}
			}
			
			client_print_color(0,Red, "%s^4 %s^1 give^3 %d^1XP to all^3 Terrorists^1!",DENUMIRE, AdminName, XPtoGive )
		}
		else if( equali(arg[1],"ct") )
		{
			new players[32], totalplayers, CT
			get_players( players, totalplayers )
		    
			for( new i = 0; i < totalplayers; i++ )
			{
				if( get_user_team(players[ i ] ) == 2 )
				{
					CT = players[ i ]
						   
					XP[ CT ] += XPtoGive
				}
			}
			
			client_print_color(0,Blue, "%s^4 %s^1 give^3 %d^1XP to all^3 Counter-Terrorists^1!",DENUMIRE, AdminName, XPtoGive )
		}
	}
	else
	{
		new iTarget = cmd_target( iPlayer, arg, CMDTARGET_NO_BOTS )
		
		if( iTarget )
		{
			get_user_name ( iTarget, name, charsmax ( name ) )
			XP[ iTarget ] += XPtoGive
			
			client_print_color(0,DontChange, "%s^3 %s^1 give^3 %d^1XP to^3 %s",DENUMIRE, AdminName, XPtoGive, name )
		}
	}
	return PLUGIN_HANDLED
}
public CmdRemoveXP ( iPlayer,level,cid )
{
	if(!cmd_access(iPlayer,level,cid,2))	return PLUGIN_HANDLED

	new AdminName [ 32 ]
	get_user_name ( iPlayer, AdminName, charsmax ( AdminName ) )
	   
	new arg [ 32 ]
	read_argv ( 1, arg, 31 ) 
 
	new RemoveXP [ 32 ]
	read_argv ( 2, RemoveXP, charsmax ( RemoveXP ) )

	if(equal(arg,"")||equal(RemoveXP,""))
	{
		console_print(iPlayer,"Folosire: ze_exp_take <nick, #userid, authid | @all> <XP>")
		return PLUGIN_HANDLED
	}
 
	new XPtoRemove = str_to_num ( RemoveXP )
	   
	if( arg[0]=='@' )
	{ 
		if( equali(arg[1],"all") )
		{
			new players[32], totalplayers, All
			get_players( players, totalplayers )
		    
			for ( new i = 0; i < totalplayers; i++ )
			{
				All = players[ i ]
					   
				XP[ All ] -= XPtoRemove
			}
			
			client_print_color(0,DontChange, "%s^3 %s^1 toke^3 %d^1XP of all^4 players^1!",DENUMIRE, AdminName, XPtoRemove )
		}
		else if( equali(arg[1],"t") )
		{
			new players[32], totalplayers, T
			get_players( players, totalplayers )
		    
			for ( new i = 0; i < totalplayers; i++ )
			{
				if ( get_user_team(players[ i ]) == 1 )
				{
					T = players[ i ]
						   
					XP[ T ] -= XPtoRemove
				}
			}
			
			client_print_color(0,Red, "%s^4 %s^1 toke^3 %d^1XP of all^3 Terrorists^1!",DENUMIRE, AdminName, XPtoRemove )
		}
		else if( equali(arg[1],"ct") )
		{
			new players[32], totalplayers, CT
			get_players( players, totalplayers )
		    
			for( new i = 0; i < totalplayers; i++ )
			{
				if( get_user_team(players[ i ] ) == 2 )
				{
					CT = players[ i ]
						   
					XP[ CT ] -= XPtoRemove
				}
			}
			
			client_print_color(0,Blue, "%s^4 %s^1 toke^3 %d^1XP of all^3 Counter-Terrorists^1!",DENUMIRE, AdminName, XPtoRemove )
		}
	}
	else
	{
		new iTarget = cmd_target( iPlayer, arg, CMDTARGET_NO_BOTS )
		if( !iTarget )	return PLUGIN_HANDLED
		get_user_name ( iTarget, name, charsmax ( name ) )
		
		XP[ iTarget ] -= XPtoRemove
			
		client_print_color(0,DontChange, "%s^3 %s^1 give^4 %d^1XP to^3 %s", AdminName,DENUMIRE, XPtoRemove, name )
	}
	
	return PLUGIN_HANDLED
}

public CmdGiveLv ( iPlayer,cid,level )
{
	if(!cmd_access(iPlayer,level,cid,1))	return PLUGIN_HANDLED

	new AdminName [ 32 ]
	get_user_name ( iPlayer, AdminName, charsmax ( AdminName ) )
	   
	new arg [ 32 ]
	read_argv ( 1, arg, 31 ) 
 
	new AddXP [ 32 ]
	read_argv ( 2, AddXP, charsmax ( AddXP ) )

	if(equal(arg,"")||equal(AddXP,""))
	{
		console_print(iPlayer,"Folosire: ze_lv <tinta> <LVL>")
		return PLUGIN_HANDLED
	}
 
	new XPtoGive = str_to_num ( AddXP )

	new iTarget = cmd_target( iPlayer, arg, CMDTARGET_NO_BOTS )
	if( iTarget&&XPtoGive<=MAX_LEVELS )
	{
		get_user_name ( iTarget, name, charsmax ( name ) )
		Level[ iTarget ] = XPtoGive
			
		client_print_color(0,DontChange, "%s^3 %s^1 set^3 %d^1 LV to^3 %s",DENUMIRE, AdminName, XPtoGive, name )
	}
	return PLUGIN_HANDLED
}
public CmdGiveXp ( iPlayer,level,cid )
{
	if(!cmd_access(iPlayer,level,cid,1))	return PLUGIN_HANDLED

	new AdminName [ 32 ]
	get_user_name ( iPlayer, AdminName, charsmax ( AdminName ) )
	   
	new arg [ 32 ]
	read_argv ( 1, arg, 31 ) 
 
	new AddXP [ 32 ]
	read_argv ( 2, AddXP, charsmax ( AddXP ) )

	if(equal(arg,"")||equal(AddXP,""))
	{
		console_print(iPlayer,"Folosire: ze_xp <tinta> <XP>")
		return PLUGIN_HANDLED
	}
 
	new XPtoGive = str_to_num ( AddXP )
	   
	new iTarget = cmd_target( iPlayer, arg, CMDTARGET_NO_BOTS )
	if( iTarget )
	{
		get_user_name ( iTarget, name, charsmax ( name ) )
		XP[ iTarget ] = XPtoGive
			
		client_print_color(0,DontChange, "%s^3 %s^1 set^3 %d^1 XP to^3 %s",DENUMIRE, AdminName, XPtoGive, name )
	}
	return PLUGIN_HANDLED
}

stock seconds_to_units(time)	return((1 << 12) * (time))
stock screen_fade(id,holdtime,r,g,b,a)
{
   message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{ 0, 0, 0 },id);
   write_short(seconds_to_units(holdtime));
   write_short(seconds_to_units(holdtime));
   write_short(0);
   write_byte(r);
   write_byte(g);
   write_byte(b);
   write_byte(a);
   message_end();
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
*/
Последно промяна от OciXCrom на 30 Окт 2019, 00:25, променено общо 1 път.
Причина: Moved to Scripting Help section.

Аватар
mi0
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 534
Регистриран на: 09 Дек 2016, 22:02
Се отблагодари: 97 пъти
Получена благодарност: 120 пъти
Обратна връзка:

Menu_display bug??

Мнение от mi0 » 29 Окт 2019, 22:54

Firstly I dont really know your idea but try separating the main plugin from the menu. I dont have any time right now to trace the error and by making it separate plugin you will be able to see the code much easier and I will be able to see only the menu code which is important in order to find what you are doing wrong!
aka kurdokoleno
Catch Mod - 87.121.112.232:27021

Аватар
Adryyy
Извън линия
Foreigner
Foreigner
Мнения: 9
Регистриран на: 29 Окт 2019, 22:04
Се отблагодари: 7 пъти

Menu_display bug??

Мнение от Adryyy » 29 Окт 2019, 23:01

i tried what you saied, you can search for error line...eg

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

on spawn-Show_Menu_Buy_Primary(id)

public Show_Menu_Buy_Primary(id)
{
	new et[255],nw[125]
	new menu=menu_create("\yMeniu Arme Principale","MHP")
	for(new i;i<sizeof (e_pB);i++)
	{
		if(Level[id]==e_pB[i][pLV])
		{
			if(!equal(e_pB[i][pN],""))	formatex(nw,charsmax(nw),"^n\w[\r BLOCAT\w ]\r %s\w [\d disponibil la lvl:\r %d\w ]",e_pB[i][pN],Level[id]+2);
			else nw="";
			formatex(et,charsmax(et),"\y%s%s", e_pB[i][pName],nw)

			menu_additem(menu,et)
		}
		else if((((Level[id]-1)>=0&&(Level[id]-1)==e_pB[i][pLV])||(Level[id]-1)==e_pB[i][pLV])||Level[id]<e_pB[i][pLV]) SHOWWEAPONSP(id);
	}
	menu_display( id, menu );
	return PLUGIN_HANDLED
}
public MHP(id, menu,key)
{
	if (!is_user_alive(id) || g_bBoughtPrimary[id]||ze_is_user_zombie(id))	return PLUGIN_HANDLED
	if(key==MENU_EXIT)
	{
		Show_Menu_Buy_Primary(id)
		return PLUGIN_HANDLED
	}

	if(Level[id]==10||(Level[id]-1)==10)	ze_give_cak47(id)
	else if(Level[id]==15||(Level[id]-1)==15)	ze_give_cump45(id)
	else if(Level[id]==20||(Level[id]-1)==20)	ze_give_cm249(id)
	else if(Level[id]==25||(Level[id]-1)==25)	ze_give_cm4a1(id)
	else if(Level[id]==30)	ze_give_cm3(id)
	else
	{
		for(new i;i<sizeof (e_pB);i++)
		{
			if(Level[id]==e_pB[i][pLV])
			{
				if(!equal(e_pB[i][pG],"weapon_knife")&&e_pB[i][pBPA]>0&&e_pB[i][pG]!=CSW_KNIFE)
				{
					give_item(id,e_pB[i][pG])
					//cs_set_user_bpammo(id,e_pB[i][pC],e_pB[i][pBPA])
					engclient_cmd(id,e_pB[i][pG])
				}
			}
		}
	}
	// Primary bought
	g_bBoughtPrimary[id] = true
	Show_Menu_Buy_Secondary(id)
	
	return PLUGIN_HANDLED
}
public SHOWWEAPONSP(id)
{
	new menu=menu_create("\yMeniu Arme Principale","MHP2")
	new szTempid[32]
	//new nw[255],et[555]
	for(new i;i<sizeof (e_pB) && Level[id]>e_pB[i][pLV];i++)
	{
		num_to_str(i, szTempid, charsmax(szTempid) );
		menu_additem(menu,e_pB[i][pName],szTempid)
		/*if(!equal(e_pB[i][pN],""))	formatex(nw,charsmax(nw),"\w[\r BLOCAT\w ]\r %s\w [\d disponibil la lvl:\r %d\w ]",e_pB[i][pN],Level[id]+2);
		else nw="";
		menu_addtext(menu,nw)*/
	}
	menu_display( id, menu, 0 );
}
public MHP2(id,menu,key)
{
	if (!is_user_alive(id)|| g_bBoughtPrimary[id]||ze_is_user_zombie(id))
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}

	if(key==MENU_EXIT)
	{
		if(!g_bBoughtPrimary[id])
		{
			if(Level[id]>=20)	menu_display( id, menu, 1 );
			//set_task(0.1,"SHOWWEAPONSP",id)
			return PLUGIN_HANDLED
		}
	}

	new cmd[6], iName[64]
	new access, callback
	menu_item_getinfo(menu, key, access, cmd,5, iName, 63, callback)
	new wep = str_to_num(cmd)
	if(equal(iName,"PlasmaGun"))	ze_give_cak47(id)
	else if(equal(iName,"Ethereal"))	ze_give_cump45(id)
	else if(equal(iName,"Thanatos-VII"))	ze_give_cm249(id)
	else if(equal(iName,"Janus-V"))	ze_give_cm4a1(id)
	else if(equal(iName,"M32"))	ze_give_cm3(id)
	else
	{
		give_item(id,e_pB[wep][pG])
		engclient_cmd(id,e_pB[wep][pG])
	}

	g_bBoughtPrimary[id] = true
	set_task(1.0,"Show_Menu_Buy_Secondary",id)
	return PLUGIN_HANDLED
}
i think the problem is here-

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

for(new i;i<sizeof (e_pB) && Level[id]>e_pB[i][pLV];i++)
in this second menu, i want to show all weapons for player level(maximum is 30, if the player have 22, to see all weapons for level 22)
maybe the loop is too big..i tired with while and i++, bot nothing good, if i delete key==menu_exit the menu does not appear..this is strange, i don't know why, is called MENU_EXIT(i don't press 0 for exit, nothing), i tired to set prop never exit, same problem

Аватар
mi0
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 534
Регистриран на: 09 Дек 2016, 22:02
Се отблагодари: 97 пъти
Получена благодарност: 120 пъти
Обратна връзка:

Menu_display bug??

Мнение от mi0 » 29 Окт 2019, 23:27

The problem is you are tring to display empty menu just add a = before the < in here

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

i<sizeof (e_pB)
This should help you.
aka kurdokoleno
Catch Mod - 87.121.112.232:27021

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Menu_display bug??

Мнение от OciXCrom » 30 Окт 2019, 00:45

Displaying an empty menu won't output any errors.
The i<sizeof check is correct. It loops through all of the enum's values.
Adding "=" will actually break it, as it would ignore the last entry in the list.
It's really hard to tell what's going on here because the code is very unnecessarily complicated.

From what I managed to notice, you're using menu_display inside a for-loop (line 1662). This is for sure going to cause issues.
Furthermore, after the code exits the loop, you're using yet another menu_display with a different menu (line 1664).
Make sure you're calling only one menu_display function at a time.
Also, make sure you're using menu_destroy before using menu_display and every time you're done using the menu.

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

for(new i;i<sizeof (e_pB) && Level[id]>e_pB[i][pLV];i++)
It doesn't make sense to use two different conditions in the for-loop. Leave only the i<sizeof (e_pB) check. The other check can go before the loop.

Lines 1725-1729:

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

if(key==MENU_EXIT) //the key is MENU_EXIT
{
	...
	if(Level[id]>=20)	menu_display( id, menu, 1 ); //using menu_display
}
Here's where the error probably happens. It's exactly what it says - using menu_display when the key is MENU_EXIT.
You need to destroy the menu before displaying it again. Same goes for the end of the MHP2 function - destroy it.
Like mi0 said - you should try to split your code in multiple plugins. Having everything combined in one big plugin usually doesn't work too well, especially from the human's eye perspective - it's just too chaotic.

Why not use an external plugin to handle the XP and levels? Check this. It will greatly reduce the size of your code, plus it's much more optimized and will run better.

Аватар
Adryyy
Извън линия
Foreigner
Foreigner
Мнения: 9
Регистриран на: 29 Окт 2019, 22:04
Се отблагодари: 7 пъти

Menu_display bug??

Мнение от Adryyy » 31 Окт 2019, 14:02

thanks to you for replies, i will try when i will have time, but

yes, i have enum blank spaces like "" ...but i don't think this is a reason to don't work the menu..

if i will add menu_destroy before menu_display this will be equal with 0

on line 1662, what you say to do? because i want to leave this condition

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

else if((((Level[id]-1)>=0&&(Level[id]-1)==e_pB[i][pLV])||(Level[id]-1)==e_pB[i][pLV])||Level[id]<e_pB[i][pLV])
, if i will exit the loop, i will need another one...what is the same, or you want to create a local menu, inside of the conditions?

i use this condition

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

for(new i;i<sizeof (e_pB) && Level[id]>e_pB[i][pLV];i++)
to show only weapons for level client < next weapon level, if i will leave just sizeof of enum, i will get all weapons..and after i will need to make another conditions like level[client]<level weapon blabla..

i tired with menu_display for second page, but this is the reason why i get error, because is not normally to use in case of key==menu_exit..

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Menu_display bug??

Мнение от OciXCrom » 31 Окт 2019, 15:31

if i will add menu_destroy before menu_display this will be equal with 0
No. Since the code is located within a menu handler, this will destroy the menu that is currently open and will display a new one, thus probably preventing the error.
on line 1662, what you say to do? because i want to leave this condition

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

else if((((Level[id]-1)>=0&&(Level[id]-1)==e_pB[i][pLV])||(Level[id]-1)==e_pB[i][pLV])||Level[id]<e_pB[i][pLV])
, if i will exit the loop, i will need another one...what is the same, or you want to create a local menu, inside of the conditions?
First of all, you should try to make that condition a little bit more friendly for the human eye - using more than one line is a good way of doing it. I can't really tell if the code in this check can get called more than once within the loop, but either way, you should use break to exit the loop once the menu is displayed.

Furthermore, if that menu gets displayed, you're attempting to display yet another menu right outside the loop, so the first one won't have any effect:

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

for(new i;i<sizeof (e_pB);i++)
{
	...
	// the "SHOWWEAPONUSP" function uses "menu_display"
	else if((((Level[id]-1)>=0&&(Level[id]-1)==e_pB[i][pLV])||(Level[id]-1)==e_pB[i][pLV])||Level[id]<e_pB[i][pLV]) SHOWWEAPONSP(id);
}
menu_display( id, menu ); // this will ALWAYS overwrite the menu from "SHOWWEAPONUSP"
It's not a good idea to do so many repeating conditions inside a loop. They will be checked over and over again. You can do the check before the loop and save it in a local variable.
i use this condition

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

for(new i;i<sizeof (e_pB) && Level[id]>e_pB[i][pLV];i++)
to show only weapons for level client < next weapon level, if i will leave just sizeof of enum, i will get all weapons..and after i will need to make another conditions like level[client]<level weapon blabla..
What I mean is, this condition should be moved inside the loop itself:

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

for(new i;i<sizeof (e_pB);i++)
{
	if(Level[id]>e_pB[i][pLV])
	{
		...
	}
}
The way it is right now, the entire loop will stop if the second condition is false even once. It probably works just fine now because you have the weapons ordered from the lowest to highest level, but if you ever mix up that order, the loop will break prematurely. There is no point of using the second condition in the loop's body because Level[id] won't change during the looping process.
tired with menu_display for second page, but this is the reason why i get error, because is not normally to use in case of key==menu_exit..
I just tested this code and it works just fine:

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

public menu_handler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_display(id, menu, 1)
		return PLUGIN_HANDLED
	}

	menu_destroy(menu)
	return PLUGIN_HANDLED
}
Which AMXX version are you using? It looks like this is a bug from some older 1.8.3/1.9 build - https://github.com/alliedmodders/amxmodx/issues/632
Upgrading to the latest 1.9 or 1.10 build should fix the issue.

Аватар
Adryyy
Извън линия
Foreigner
Foreigner
Мнения: 9
Регистриран на: 29 Окт 2019, 22:04
Се отблагодари: 7 пъти

Menu_display bug??

Мнение от Adryyy » 31 Окт 2019, 15:41

thank you very much, you have right, i will test and come back with answer
about coding, i make it this source for someone(for free), and i wanted to see a big code(i know is hard coded), but i really don't have lag/errors or problems, except this:))

OFF:
i am like

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

if(is_user_connected(client)&&!(is_user_bot(client)||is_user_hltv(client)) code..
i don't like

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

if(is_user_connected(client))
	if(!(is_user_bot(client)||is_user_hltv(client))
		..code
i like to make all condintions in one, i think this is more faster..to check just one, not one after another one, 1-2-3...and i use plugins just for me:-??

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Menu_display bug??

Мнение от OciXCrom » 31 Окт 2019, 16:04

about coding, i make it this source for someone(for free), and i wanted to see a big code(i know is hard coded), but i really don't have lag/errors or problems, except this:))
Trust me, I've made a 10.000 lines code once, and it was pure chaos. You may notice some lag when there are more players in the server, but this depends more on the code's optimizations.
i like to make all condintions in one, i think this is more faster..to check just one, not one after another one, 1-2-3...and i use plugins just for me:-??
It's not faster, you're still checking multiple conditions. It doesn't matter if you use "&&" and "||" in one line or separate the code in multiple lines with more "if" checks. The compiled plugin will be the same. The only thing it affects is human readability.

Again, this is just an advice, it's not something you need to do in order to improve the plugin's functionality.

Аватар
Adryyy
Извън линия
Foreigner
Foreigner
Мнения: 9
Регистриран на: 29 Окт 2019, 22:04
Се отблагодари: 7 пъти

Menu_display bug??

Мнение от Adryyy » 15 Ное 2019, 20:03

sorry to respond so late, i have tested a bit, the problem is only at amxx183

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

Обратно към “Помощ в скриптирането”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 9 госта