Problema compilare plugin

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Jucks
Membru, skill +3
Membru, skill +3
Posts: 1146
Joined: 20 May 2016, 15:28
Detinator Steam: Da
Fond eXtream: 0
Contact:

18 Nov 2019, 15:17

De ce imi da aceasta eroare la compilare ?amx_meniu_joc.sma(1) : error 010: invalid function or declaration
uite sursa :
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < csx >
#include < cstrike >
#include < fun >
#include < fakemeta >
#include < hamsandwich >
#include < geoip >

#define VERSION "2.0"
#define AUTHOR "LondoN eXtream"

#define c_Grinch_Model "arctic"
#define c_Santa_Model "sas"
#define c_MOD_Link "https://www.powergame.ro"

#define TASK_HUD 8876224
#define TASK_HUD_ID (taskid - TASK_HUD)

native cs_set_player_model(id, const model[])
native cs_reset_player_model(id)

new g_AdminCount;
new g_Hud;
new g_Bulgari [ 33 ];
new g_Player [ 33 ] [ 32 ];

// ---------------------------
// [	Pentru Tombola	]
// ----------------------------
new bool: g_Tombola_Played [ 33 ];
new g_CvarTombolaCost;

// ----------------------------------
// [ 	Shop Bulgari	]
// ----------------------------------
new bool: c_Invizibilitate [ 33 ];	// Invizibilitate
new bool: c_Respawn [ 33 ];		// Respawn
new bool: c_GodMode [ 33 ];		// God Mode
new bool: c_Clip [ 33 ];		// No Clip
new bool: c_Santa [ 33 ];		// Santa;

public plugin_init ( )
{
	register_plugin ( "Game Menu", VERSION, AUTHOR );

	register_clcmd ( "chooseteam", "ClientCommand_ChooseTeam" );

	g_Hud = CreateHudSyncObj ( );

	register_event ( "HLTV", "ev_new_round", "a" );
	register_event ( "DeathMsg", "function_DeathMsg", "a" );

	register_concmd ( "amx_give_bulgari", "function_give_bulgari", ADMIN_ALL, "<user> <bulgari>" );

	g_CvarTombolaCost = register_cvar ( "amx_tombola_cost", "1500" );
}

public client_putinserver ( Player )
{
	if ( !is_user_bot ( Player ) && !is_user_hltv ( Player ) )
	{
		if ( is_user_admin ( Player ) )
			g_AdminCount++;

		client_cmd(Player, "cl_weather ^"1^"");
		g_Bulgari [ Player ] = 5;
		engfunc ( EngFunc_LightStyle, Player, "k" );
		get_user_name ( Player, g_Player [ Player ], charsmax ( g_Player [ ] ) );
		set_task ( 1.0, "HUD_TASK", Player+TASK_HUD, _, _, "b" );
	}

	return PLUGIN_CONTINUE;
}

public client_disconnect ( Player )
{
	if ( !is_user_bot ( Player ) || !is_user_hltv ( Player ) )
	{
		if ( is_user_admin ( Player ) )
			g_AdminCount--;

		remove_task ( Player+TASK_HUD );
	}

	return PLUGIN_CONTINUE;
}

public ev_new_round ( )
{
	new Players [ 32 ], iNum, TempIndex;
	get_players ( Players, iNum );
	for ( new i; i < iNum; i++ )
	{
		TempIndex = Players;
		
		g_Tombola_Played[TempIndex] = false;
		c_Respawn[TempIndex] = false;
		c_GodMode[TempIndex] = false;
		c_Clip[TempIndex] = false;
	
		if(c_Invizibilitate[TempIndex])
		{
			set_user_rendering(TempIndex, kRenderFxNone, 0, 0, 0, kRenderNormal, 255);
			c_Invizibilitate[TempIndex] = false;
		}
		
	}
}

public function_DeathMsg ( )
{
	new Killer = read_data ( 1 );
	new Victima = read_data ( 2 );

	if ( Killer == Victima || !is_user_connected ( Killer ) || !is_user_alive ( Killer ) )
		return PLUGIN_HANDLED;

	g_Bulgari [ Killer ] += 1;

	if ( c_Clip [ Victima ] )
	{
		c_Clip [ Victima ] = false;
		set_user_noclip ( Victima, 0 );
	}

	if ( c_Santa [ Victima ] )
	{
		c_Santa [ Victima ] = false;
		cs_reset_player_model ( Victima );
	}

	if ( !is_user_alive ( Victima ) && c_Respawn [ Victima ] )
	{
		set_task ( 2.0, "function_respawn_players", Victima );
		afiseaza_mesaj ( Victima, "^x04[Sansa Respawn]^x01 Alegem sansa ta....te rugam sa astepti!" );
	}

	return PLUGIN_CONTINUE;
}

public function_respawn_players ( Victim )
{
	switch ( random_num ( 1, 2 ) )
	{
		case 1:
		{
			ExecuteHamB ( Ham_CS_RoundRespawn, Victim );
			afiseaza_mesaj ( Victim, "^x04[Sansa Respawn]^x01 Mosul ti-a oferit o sansa si te-a reinviat!" );
		}

		case 2:	afiseaza_mesaj ( Victim, "^x04[Sansa Respawn]^x01 Din pacate ai fost obraznic si nu vei primi respawn!" );
	}

	c_Respawn [ Victim ] = false;
}

public function_godmode ( Player )
{
	set_user_godmode ( Player, 0 );
	c_GodMode [ Player ] = false;
	afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Puterea^x03 God Mode (5 Secunde)^x01 a expirat!" );
}

public function_give_bulgari(Player, level, cid) {
	if(!cmd_access(Player, level, cid, 2))
		return PLUGIN_HANDLED;

	new szPlayer[32], szAmount[16];
	read_argv(1, szPlayer, charsmax(szPlayer));
	read_argv(2, szAmount, charsmax(szAmount));

	new g_Target = cmd_target(Player, szPlayer, 8);

	if(!g_Target || szAmount[0] == '0')
		return PLUGIN_HANDLED;

	g_Bulgari[g_Target] += str_to_num(szAmount);
	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Ai daruit^x04 %d^x01 bulgari jucatorului^x03 %s", str_to_num(szAmount), g_Player[g_Target]);
	afiseaza_mesaj(g_Target, "^x04[XMAS 2.0]^x01 Adminul^x03 %s^x01 ti-a daruit^x04 %d^x01 bulgari", g_Player[Player], str_to_num(szAmount));
	return PLUGIN_CONTINUE;
}

public HUD_TASK ( taskid )
{
	static Player;
	Player = TASK_HUD_ID;

	if ( !is_user_alive ( Player ) )
	{
		Player = pev ( Player, pev_iuser2 );

		if ( !is_user_alive ( Player ) )	return;
	}

	new g_HudMsg [ 1024 ];
	set_hudmessage ( 0, 127, 255, 0.02, -1.0, 0, _, 1.0, _, _, 1 );

	if ( Player != TASK_HUD_ID )
	{
		new g_Tara [ 32 ], g_IP [ 16 ];
		get_user_ip ( Player, g_IP, charsmax ( g_IP ), 1 );
		geoip_country ( g_IP, g_Tara, charsmax ( g_Tara ) );
		formatex ( g_HudMsg, charsmax ( g_HudMsg ), "^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n[Spectating: %s | Bulgări: %d |Viaţă: %d |Armură: %d | Ţara: %s]", g_Player [ Player ], g_Bulgari [ Player ], get_user_health ( Player ), get_user_armor ( Player ), equal ( g_Tara, "error" ) ? "N/A" : g_Tara );
		ShowSyncHudMsg ( TASK_HUD_ID, g_Hud, g_HudMsg );
	}
	else
	{
		formatex ( g_HudMsg, charsmax ( g_HudMsg ), "^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n[Nume: %s | Bulgări: %d | Viaţă: %d | Armură: %d]", g_Player [ TASK_HUD_ID ], g_Bulgari [ TASK_HUD_ID ], get_user_health ( TASK_HUD_ID ), get_user_armor ( TASK_HUD_ID ) );
		ShowSyncHudMsg ( TASK_HUD_ID, g_Hud, g_HudMsg );
	}
}

public ClientCommand_ChooseTeam ( Player )
{
	new g_Title [ 64 ], g_AdminItem [ 128 ];
	formatex ( g_Title, charsmax ( g_Title ), "\rGame Menu^n\rXMAS \y%s \wby \r%s^n", VERSION, AUTHOR );
	formatex ( g_AdminItem, charsmax ( g_AdminItem ), "\wAdmini Online (\r%d\w)", g_AdminCount );
	new g_Menu = menu_create ( g_Title, "Menu_Handler" );

	menu_additem ( g_Menu, "\wJoacă la Tombola" );
	menu_additem ( g_Menu, "\wCumpără Iteme" );
	menu_additem ( g_Menu, "\wAscultă Radio" );
	menu_additem ( g_Menu, "\wInformaţii Server" );
	menu_additem ( g_Menu, "\wStatisticile Tale" );
	menu_additem ( g_Menu, g_AdminItem );
	
	if ( is_user_admin ( Player ) )
		menu_additem ( g_Menu, "\wZona Adminilor" );
	else
		menu_additem ( g_Menu, "\dZona Adminilor (\rNu eşti ADMIN\d)" );

	menu_setprop ( g_Menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, g_Menu, 0 );
	return PLUGIN_HANDLED;
}

public Menu_Handler ( Player, g_Menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( g_Menu );
		return PLUGIN_HANDLED;
	}

	switch ( item )
	{
		case 0:	Meniu_Tombola ( Player );
		case 1:	Meniu_Iteme ( Player );
		case 2:	Meniu_Radio ( Player );
		case 3:	Printeaza_Informatii ( Player );
		case 4:	Build_Statistics ( Player );
		case 5:	Build_Menu_Admins ( Player );
		case 6:	Meniu_Admin ( Player );
	}

	return PLUGIN_HANDLED;
}

public Meniu_Tombola ( Player )
{
	if ( g_Tombola_Played [ Player ] )
	{
		afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ai jucat deja la tombola runda aceasta!" );
		return PLUGIN_HANDLED;
	}

	new g_Title [ 128 ];
	formatex ( g_Title, charsmax ( g_Title ), "\yTombola^n\wCost: \r%d \w$", get_pcvar_num ( g_CvarTombolaCost ) );
	new Tombola_Menu = menu_create ( g_Title, "Handler_Tombola_Menu" );

	menu_additem ( Tombola_Menu, "\wJoaca (\r1500\w)" );
	menu_additem ( Tombola_Menu, "\wRevino la meniul principal" );

	menu_setprop ( Tombola_Menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, Tombola_Menu, 0 );
	return PLUGIN_CONTINUE;
}

public Handler_Tombola_Menu ( Player, Tombola_Menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( Tombola_Menu );
		return PLUGIN_HANDLED;
	}

	switch ( item )
	{
		case 0:
		{
			new g_Cost = get_pcvar_num ( g_CvarTombolaCost );
			new g_Money = cs_get_user_money ( Player );

			if ( g_Money < g_Cost )
			{
				afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Nu ai suficienti bani pentru a juca la tombola!" );
				return PLUGIN_HANDLED;
			}

			cs_set_user_money ( Player, g_Money - g_Cost );

			switch ( random_num ( 1, 2 ) )
			{
				case 1:
				{
					cs_set_user_money ( Player, 16000 );
					afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ai castigat^x03 Big JackPot^x01 in valoare de^x04 16000$^x01! Felicitari!" );
					g_Tombola_Played [ Player ] = true;
				}

				case 2:
				{
					cs_set_user_money ( Player, 0 );
					afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ne pare rau, dar ai pierdut toti banii!" );
					g_Tombola_Played [ Player ] = true;
				}
			}
		}

		case 1:
		{
			menu_destroy ( Tombola_Menu );
			ClientCommand_ChooseTeam ( Player );
		}
	}

	menu_destroy ( Tombola_Menu );
	return PLUGIN_HANDLED;
}

public Meniu_Iteme ( Player )
{
	if ( !is_user_alive ( Player ) || get_user_team ( Player ) == 3 )
	{
		afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in^x03 viata^x01 pentru a putea accesa acest meniu!" );
		return PLUGIN_HANDLED;
	}

	new g_items = menu_create ( "\rCumpara Iteme", "g_items_handler" );

	menu_additem ( g_items, "\w5 Bulgari (\r16,000$\w)" );
	menu_additem ( g_items, "\w16,000 $ (\r5 Bulgari\w" );
	menu_additem ( g_items, "\wSet Grenazi (\r10 Bulgari\w)" );
	if ( get_user_team ( Player ) == 1 )
		menu_additem ( g_items, "\wArmele Mosului (\r15 Bulgari\w)" );
	else if ( get_user_team ( Player ) == 2 )
		menu_additem ( g_items, "\wArmele lui Grinch (\r15 Bulgari\w)" );
	menu_additem ( g_items, "\wInvizibilitate 50% (\r20 Bulgari\w)" );
	menu_additem ( g_items, "\wSansa Respawn (\r30 Bulgari\w)" );
	menu_additem ( g_items, "\wGod Mode (5 Secunde) (\r40 Bulgari\w)" );
	menu_additem ( g_items, "\wNo Clip (\r50 Bulgari\w" );
	if ( get_user_team ( Player ) == 1 )
		menu_additem ( g_items, "\wDevino Mos Craciun (\r60 Bulgari\w)" );
	else if ( get_user_team ( Player ) == 2 )
		menu_additem ( g_items, "\wDevino Grinch (\r60 Bulgari\w)" );

	menu_setprop ( g_items, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, g_items, 0 );
	return PLUGIN_CONTINUE;
}

public g_items_handler ( Player, g_items, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( g_items );
		return PLUGIN_HANDLED;
	}

	new Money = cs_get_user_money ( Player );

	switch ( item )
	{
		case 0:
		{
			if ( Money < 16000 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Iti trebuie^x04 16,000$^x01 pentru a cumpara^x04 5 Bulgari" );
				return PLUGIN_HANDLED;
			}


			g_Bulgari[Player] += 5;
			cs_set_user_money ( Player, 0 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 5 Bulgari^x01 din magazinul Mosului!" );
		}

		case 1:
		{
			if ( g_Bulgari[Player] < 5 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari." );
				return PLUGIN_HANDLED;
			}

			if ( Money == 16000 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai deja^x03 16,000 $" );
				return PLUGIN_HANDLED;
			}


			g_Bulgari[Player] -= 5;
			cs_set_user_money ( Player, 16000 );
		}

		case 2:
		{
			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( g_Bulgari[Player] < 10 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari." );
				return PLUGIN_HANDLED;
			}

			give_item ( Player, "weapon_hegrenade" );
			give_item ( Player, "weapon_smokegrenade" );
			give_item ( Player, "weapon_flashbang" );
			give_item ( Player, "weapon_flashbang" );
			g_Bulgari[Player] -= 10;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat un^x03 Set Grenazi" );
		}

		case 3:
		{
			if ( !is_user_alive ( Player ) || get_user_team ( Player ) != 1|2 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( g_Bulgari[Player] < 15 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			strip_user_weapons ( Player );
			give_item ( Player, "weapon_knife" );
			give_item ( Player, "weapon_deagle" );
			give_item ( Player, get_user_team ( Player ) == 1 ? "weapon_m4a1" : "weapon_ak47" );
			give_item ( Player, "weapon_hegrenade" );
			give_item ( Player, "weapon_smokegrenade" );
			give_item ( Player, "weapon_flashbang" );
			give_item ( Player, "weapon_flashbang" );
			cs_set_user_bpammo ( Player, CSW_DEAGLE, 35 );
			cs_set_user_bpammo ( Player, get_user_team ( Player ) == 1 ? CSW_M4A1 : CSW_AK47, 90 );
			g_Bulgari[Player] -= 15;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 Armele %s^x01 din magazin.", get_user_team ( Player ) == 1 ? "Mosului" : "lui Grinch" );
		}

		case 4:
		{
			if ( g_Bulgari[Player] < 20 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}
	
			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Invizibilitate [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest bonus!" );
				return PLUGIN_HANDLED;
			}

			c_Invizibilitate [ Player ] = true;
			g_Bulgari[Player] -= 20;
			set_user_rendering ( Player, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 50 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 Invizibilitate (50%)" );
		}

		case 5:
		{
			if ( g_Bulgari[Player] < 30 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Respawn [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat deja acest item!" );
				return PLUGIN_HANDLED;
			}

			c_Respawn [ Player ] = true;
			g_Bulgari[Player] -= 30;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 O Sansa de Respawn" );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Cand vei muri vei avea o sansa de a reinvia!" );
		}

		case 6:
		{
			if ( g_Bulgari[Player] < 40 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Items]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}


			if ( c_GodMode [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}


			c_GodMode [ Player ] = true;
			g_Bulgari[Player] -= 40;
			set_user_godmode ( Player, 1 );
			set_task ( 5.0, "function_godmode", Player );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 God Mode (5 Secunde)" );
		}

		case 7:
		{
			if ( g_Bulgari[Player] < 50 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Clip [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}

			c_Clip [ Player ] = true;
			g_Bulgari[Player] -= 50;
			set_user_noclip ( Player, 1 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 No Clip" );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Acum poti trece prin pereti!" );
		}


		case 8:
		{
			if ( g_Bulgari[Player] < 60 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Santa [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}


			c_Santa [ Player ] = true;
			cs_set_player_model ( Player, get_user_team ( Player ) == 1 ? c_Santa_Model : c_Grinch_Model );
			g_Bulgari[Player] -= 60;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Acum ai devenit^x03 %s", get_user_team ( Player ) == 1 ? "Santa" : "Grinch" );
		}
	}

	menu_destroy ( g_items );
	return PLUGIN_HANDLED;
}

///////////////////////////////////////////////////
//	New Code 2017
///////////////////////////////////////////////////
public Meniu_Radio(Player)
{
	new g_Radio = menu_create("\wAsculta Radio", "Meniu_Radio_Handler");

	menu_additem(g_Radio, "\wRadio KISS FM");
	menu_additem(g_Radio, "\wRadio PRO FM");
	menu_additem(g_Radio, "\wRadio ZU");

	menu_setprop(g_Radio, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_Radio, 0);
}

public Meniu_Radio_Handler(Player, g_Radio, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Radio);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:	show_motd(Player, "addons/amxmodx/configs/Radio/kiss.html");
		case 1:	show_motd(Player, "addons/amxmodx/configs/Radio/pro.html");
		case 2:	show_motd(Player, "addons/amxmodx/configs/Radio/zu.html");
	}

	menu_destroy(g_Radio);
	return PLUGIN_HANDLED;
}

public Printeaza_Informatii(Player)
{
	afiseaza_mesaj(Player, "^x04---------- XMAS MOD v2.0 Final by LondoN eXtream ----------");
	afiseaza_mesaj(Player, "^x03[*]^x01 Nume Plugin:^x03 XMAS Mod");
	afiseaza_mesaj(Player, "^x03[*]^x01 Versiune Plugin:^x03 2.0 Final (2017)");
	afiseaza_mesaj(Player, "^x04---------- XMAS MOD v2.0 Final by LondoN eXtream ----------");

	console_print(Player, "----------------------------------------");
	console_print(Player, "[*] Mod URL: %s", c_MOD_Link);
	console_print(Player, "----------------------------------------");
}

public Build_Statistics(Player)
{
	/*	---------------------
		Building Statistics
		---------------------*/
	new szStats[8], szBody[8], Pos, Max;
	new c_Deaths[16], c_Kills[16], c_Loc[16], c_LocMax[16];

	Max = get_statsnum();
	Pos = get_user_stats(Player, szStats, szBody);

	AddCommas(Pos, c_Loc, charsmax(c_Loc));
	AddCommas(Max, c_LocMax, charsmax(c_LocMax));
	AddCommas(szStats[0], c_Kills, charsmax(c_Kills));
	AddCommas(szStats[1], c_Deaths, charsmax(c_Deaths));

	afiseaza_mesaj(Player, "^x04[XMAS]^x01 Esti pe locul^x03 %s^x01 din^x03 %s^x01 cu^x03 %s^x01 killuri si^x03 %s^x01 decese.", c_Loc, c_LocMax, c_Kills, c_Deaths);

	///////////////////////////////////////////
	//	Building Menu Stats
	///////////////////////////////////////////
	new g_MenuTitle[64], g_Loc[64], g_Numbers[32], g_Numbers2[32];
	formatex(g_MenuTitle, charsmax(g_MenuTitle), "\wWelcome, \r%s ^n^n", g_Player[Player]);
	formatex(g_Loc, charsmax(g_Loc), "\wPosition: \r%s\w/\r%s", c_Loc, c_LocMax);
	formatex(g_Numbers, charsmax(g_Numbers), "\wKills: \r%s", c_Kills);
	formatex(g_Numbers2, charsmax(g_Numbers2), "\wDeaths: \r%s", c_Deaths);

	new g_Rank = menu_create(g_MenuTitle, "empty_handler");
	
	menu_additem(g_Rank, g_Loc);
	menu_additem(g_Rank, g_Numbers);
	menu_additem(g_Rank, g_Numbers2);

	menu_setprop(g_Rank, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_Rank, 0);
}

public empty_handler(Player, g_Rank, item)	return PLUGIN_HANDLED;

public Build_Menu_Admins(Player)
{
	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
	return PLUGIN_HANDLED;
}

public Meniu_Admin(Player)
{
	if(!is_user_admin(Player))
	{
		afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Trebuie sa fii admin pentru a putea accesa aceasta sectiune!");
		return PLUGIN_HANDLED;
	}

	new g_aMenu = menu_create("\rAdmin Menu", "aMenu_Handler");
	
	menu_additem(g_aMenu, "\wEchilibreaza Echipele");
	menu_additem(g_aMenu, "\wRespawn Players");
	menu_additem(g_aMenu, "\wKick Players");
	menu_additem(g_aMenu, "\wBan Players");

	menu_setprop(g_aMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_aMenu, 0);
	return PLUGIN_CONTINUE;
}

public aMenu_Handler(Player, g_aMenu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_aMenu);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:
		{
			server_cmd("mp_autoteambalance 1");
			afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Echipele se vor echilibra runda viitoare!");
		}
		
		case 1:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
		case 2:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
		case 3:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
	}

	menu_destroy(g_aMenu);
	return PLUGIN_HANDLED;
}

afiseaza_mesaj ( iTarget, cMessage [ ], any:... )
{
	static gmsgSayText, cBuffer [ 192 ];
	if ( !gmsgSayText )	gmsgSayText = get_user_msgid ( "SayText" );
	vformat ( cBuffer, 191, cMessage, 3 );

	message_begin ( MSG_ONE_UNRELIABLE, gmsgSayText, _, iTarget );
	write_byte ( iTarget );
	write_string ( cBuffer );
	message_end ( );
}

AddCommas(iNum, szOutput[], iLen)
{
	static szTmp[15], iOutputPos, iNumPos, iNumLen;
	szTmp[0]='^0', iOutputPos=iNumPos=iNumLen=0;
	if(iNum<0)
	{
		szOutput[iOutputPos++]='-';
		iNum = abs(iNum);
	}

	iNumLen = num_to_str(iNum, szTmp, charsmax(szTmp));

	if(iNumLen <= 3)
		iOutputPos += copy(szOutput[iOutputPos], iLen, szTmp);
	else
	{
		while((iNumPos < iNumLen) && (iOutputPos < iLen))
		{
			szOutput[iOutputPos++] = szTmp[iNumPos++];
			if((iNumLen-iNumPos) && !((iNumLen-iNumPos) % 3))
				szOutput[iOutputPos++] = ',';
		}

		szOutput[iOutputPos] = EOS;
	}

	return iOutputPos;
}
Detinator : # Go.Tried.Ro #
Enix
User avatar
Jucks
Membru, skill +3
Membru, skill +3
Posts: 1146
Joined: 20 May 2016, 15:28
Detinator Steam: Da
Fond eXtream: 0
Contact:

18 Nov 2019, 19:58

cineva?
Detinator : # Go.Tried.Ro #
User avatar
Rainq
Fost moderator
Fost moderator
Posts: 2552
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Fost super moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 5 times
Been thanked: 24 times
Contact:

19 Nov 2019, 08:34

ai compilat local?
Last edited by L E V I N on 20 Nov 2019, 20:58, edited 1 time in total.
Reason: grea engleza asta
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
User avatar
Jucks
Membru, skill +3
Membru, skill +3
Posts: 1146
Joined: 20 May 2016, 15:28
Detinator Steam: Da
Fond eXtream: 0
Contact:

19 Nov 2019, 12:35

Rainq wrote:
19 Nov 2019, 08:34
ai compilat local?
Nu stiu cum se face local..
Detinator : # Go.Tried.Ro #
User avatar
Rainq
Fost moderator
Fost moderator
Posts: 2552
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Fost super moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 5 times
Been thanked: 24 times
Contact:

19 Nov 2019, 13:21

testeaza

Code: Select all

#include < amxmodx >
#include < amxmisc >
#include < csx >
#include < cstrike >
#include < fun >
#include < fakemeta >
#include < hamsandwich >
#include < geoip >

#define VERSION "2.0"
#define AUTHOR "LondoN eXtream"

#define c_Grinch_Model "arctic"
#define c_Santa_Model "sas"
#define c_MOD_Link "https://www.powergame.ro"

#define TASK_HUD 8876224
#define TASK_HUD_ID (taskid - TASK_HUD)

native cs_set_player_model(id, const model[])
native cs_reset_player_model(id)

new g_AdminCount;
new g_Hud;
new g_Bulgari [ 33 ];
new g_Player [ 33 ] [ 32 ];

// ---------------------------
// [	Pentru Tombola	]
// ----------------------------
new bool: g_Tombola_Played [ 33 ];
new g_CvarTombolaCost;

// ----------------------------------
// [ 	Shop Bulgari	]
// ----------------------------------
new bool: c_Invizibilitate [ 33 ];	// Invizibilitate
new bool: c_Respawn [ 33 ];		// Respawn
new bool: c_GodMode [ 33 ];		// God Mode
new bool: c_Clip [ 33 ];		// No Clip
new bool: c_Santa [ 33 ];		// Santa;

public plugin_init ( )
{
	register_plugin ( "Game Menu", VERSION, AUTHOR );

	register_clcmd ( "chooseteam", "ClientCommand_ChooseTeam" );

	g_Hud = CreateHudSyncObj ( );

	register_event ( "HLTV", "ev_new_round", "a" );
	register_event ( "DeathMsg", "function_DeathMsg", "a" );

	register_concmd ( "amx_give_bulgari", "function_give_bulgari", ADMIN_ALL, "<user> <bulgari>" );

	g_CvarTombolaCost = register_cvar ( "amx_tombola_cost", "1500" );
}

public client_putinserver ( Player )
{
	if ( !is_user_bot ( Player ) && !is_user_hltv ( Player ) )
	{
		if ( is_user_admin ( Player ) )
			g_AdminCount++;

		client_cmd(Player, "cl_weather ^"1^"");
		g_Bulgari [ Player ] = 5;
		engfunc ( EngFunc_LightStyle, Player, "k" );
		get_user_name ( Player, g_Player [ Player ], charsmax ( g_Player [ ] ) );
		set_task ( 1.0, "HUD_TASK", Player+TASK_HUD, _, _, "b" );
	}

	return PLUGIN_CONTINUE;
}

public client_disconnect ( Player )
{
	if ( !is_user_bot ( Player ) || !is_user_hltv ( Player ) )
	{
		if ( is_user_admin ( Player ) )
			g_AdminCount--;

		remove_task ( Player+TASK_HUD );
	}

	return PLUGIN_CONTINUE;
}

public ev_new_round ( )
{
	new Players [ 32 ], iNum, TempIndex;
	get_players ( Players, iNum );
	for ( new i; i < iNum; i++ )
	{
	//	TempIndex = Players;
		
		g_Tombola_Played[TempIndex] = false;
		c_Respawn[TempIndex] = false;
		c_GodMode[TempIndex] = false;
		c_Clip[TempIndex] = false;
	
		if(c_Invizibilitate[TempIndex])
		{
			set_user_rendering(TempIndex, kRenderFxNone, 0, 0, 0, kRenderNormal, 255);
			c_Invizibilitate[TempIndex] = false;
		}
		
	}
}

public function_DeathMsg ( )
{
	new Killer = read_data ( 1 );
	new Victima = read_data ( 2 );

	if ( Killer == Victima || !is_user_connected ( Killer ) || !is_user_alive ( Killer ) )
		return PLUGIN_HANDLED;

	g_Bulgari [ Killer ] += 1;

	if ( c_Clip [ Victima ] )
	{
		c_Clip [ Victima ] = false;
		set_user_noclip ( Victima, 0 );
	}

	if ( c_Santa [ Victima ] )
	{
		c_Santa [ Victima ] = false;
		cs_reset_player_model ( Victima );
	}

	if ( !is_user_alive ( Victima ) && c_Respawn [ Victima ] )
	{
		set_task ( 2.0, "function_respawn_players", Victima );
		afiseaza_mesaj ( Victima, "^x04[Sansa Respawn]^x01 Alegem sansa ta....te rugam sa astepti!" );
	}

	return PLUGIN_CONTINUE;
}

public function_respawn_players ( Victim )
{
	switch ( random_num ( 1, 2 ) )
	{
		case 1:
		{
			ExecuteHamB ( Ham_CS_RoundRespawn, Victim );
			afiseaza_mesaj ( Victim, "^x04[Sansa Respawn]^x01 Mosul ti-a oferit o sansa si te-a reinviat!" );
		}

		case 2:	afiseaza_mesaj ( Victim, "^x04[Sansa Respawn]^x01 Din pacate ai fost obraznic si nu vei primi respawn!" );
	}

	c_Respawn [ Victim ] = false;
}

public function_godmode ( Player )
{
	set_user_godmode ( Player, 0 );
	c_GodMode [ Player ] = false;
	afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Puterea^x03 God Mode (5 Secunde)^x01 a expirat!" );
}

public function_give_bulgari(Player, level, cid) {
	if(!cmd_access(Player, level, cid, 2))
		return PLUGIN_HANDLED;

	new szPlayer[32], szAmount[16];
	read_argv(1, szPlayer, charsmax(szPlayer));
	read_argv(2, szAmount, charsmax(szAmount));

	new g_Target = cmd_target(Player, szPlayer, 8);

	if(!g_Target || szAmount[0] == '0')
		return PLUGIN_HANDLED;

	g_Bulgari[g_Target] += str_to_num(szAmount);
	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Ai daruit^x04 %d^x01 bulgari jucatorului^x03 %s", str_to_num(szAmount), g_Player[g_Target]);
	afiseaza_mesaj(g_Target, "^x04[XMAS 2.0]^x01 Adminul^x03 %s^x01 ti-a daruit^x04 %d^x01 bulgari", g_Player[Player], str_to_num(szAmount));
	return PLUGIN_CONTINUE;
}

public HUD_TASK ( taskid )
{
	static Player;
	Player = TASK_HUD_ID;

	if ( !is_user_alive ( Player ) )
	{
		Player = pev ( Player, pev_iuser2 );

		if ( !is_user_alive ( Player ) )	return;
	}

	new g_HudMsg [ 1024 ];
	set_hudmessage ( 0, 127, 255, 0.02, -1.0, 0, _, 1.0, _, _, 1 );

	if ( Player != TASK_HUD_ID )
	{
		new g_Tara [ 32 ], g_IP [ 16 ];
		get_user_ip ( Player, g_IP, charsmax ( g_IP ), 1 );
		geoip_country ( g_IP, g_Tara, charsmax ( g_Tara ) );
		formatex ( g_HudMsg, charsmax ( g_HudMsg ), "^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n[Spectating: %s | Bulgări: %d |Viaţă: %d |Armură: %d | Ţara: %s]", g_Player [ Player ], g_Bulgari [ Player ], get_user_health ( Player ), get_user_armor ( Player ), equal ( g_Tara, "error" ) ? "N/A" : g_Tara );
		ShowSyncHudMsg ( TASK_HUD_ID, g_Hud, g_HudMsg );
	}
	else
	{
		formatex ( g_HudMsg, charsmax ( g_HudMsg ), "^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n[Nume: %s | Bulgări: %d | Viaţă: %d | Armură: %d]", g_Player [ TASK_HUD_ID ], g_Bulgari [ TASK_HUD_ID ], get_user_health ( TASK_HUD_ID ), get_user_armor ( TASK_HUD_ID ) );
		ShowSyncHudMsg ( TASK_HUD_ID, g_Hud, g_HudMsg );
	}
}

public ClientCommand_ChooseTeam ( Player )
{
	new g_Title [ 64 ], g_AdminItem [ 128 ];
	formatex ( g_Title, charsmax ( g_Title ), "\rGame Menu^n\rXMAS \y%s \wby \r%s^n", VERSION, AUTHOR );
	formatex ( g_AdminItem, charsmax ( g_AdminItem ), "\wAdmini Online (\r%d\w)", g_AdminCount );
	new g_Menu = menu_create ( g_Title, "Menu_Handler" );

	menu_additem ( g_Menu, "\wJoacă la Tombola" );
	menu_additem ( g_Menu, "\wCumpără Iteme" );
	menu_additem ( g_Menu, "\wAscultă Radio" );
	menu_additem ( g_Menu, "\wInformaţii Server" );
	menu_additem ( g_Menu, "\wStatisticile Tale" );
	menu_additem ( g_Menu, g_AdminItem );
	
	if ( is_user_admin ( Player ) )
		menu_additem ( g_Menu, "\wZona Adminilor" );
	else
		menu_additem ( g_Menu, "\dZona Adminilor (\rNu eşti ADMIN\d)" );

	menu_setprop ( g_Menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, g_Menu, 0 );
	return PLUGIN_HANDLED;
}

public Menu_Handler ( Player, g_Menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( g_Menu );
		return PLUGIN_HANDLED;
	}

	switch ( item )
	{
		case 0:	Meniu_Tombola ( Player );
		case 1:	Meniu_Iteme ( Player );
		case 2:	Meniu_Radio ( Player );
		case 3:	Printeaza_Informatii ( Player );
		case 4:	Build_Statistics ( Player );
		case 5:	Build_Menu_Admins ( Player );
		case 6:	Meniu_Admin ( Player );
	}

	return PLUGIN_HANDLED;
}

public Meniu_Tombola ( Player )
{
	if ( g_Tombola_Played [ Player ] )
	{
		afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ai jucat deja la tombola runda aceasta!" );
		return PLUGIN_HANDLED;
	}

	new g_Title [ 128 ];
	formatex ( g_Title, charsmax ( g_Title ), "\yTombola^n\wCost: \r%d \w$", get_pcvar_num ( g_CvarTombolaCost ) );
	new Tombola_Menu = menu_create ( g_Title, "Handler_Tombola_Menu" );

	menu_additem ( Tombola_Menu, "\wJoaca (\r1500\w)" );
	menu_additem ( Tombola_Menu, "\wRevino la meniul principal" );

	menu_setprop ( Tombola_Menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, Tombola_Menu, 0 );
	return PLUGIN_CONTINUE;
}

public Handler_Tombola_Menu ( Player, Tombola_Menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( Tombola_Menu );
		return PLUGIN_HANDLED;
	}

	switch ( item )
	{
		case 0:
		{
			new g_Cost = get_pcvar_num ( g_CvarTombolaCost );
			new g_Money = cs_get_user_money ( Player );

			if ( g_Money < g_Cost )
			{
				afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Nu ai suficienti bani pentru a juca la tombola!" );
				return PLUGIN_HANDLED;
			}

			cs_set_user_money ( Player, g_Money - g_Cost );

			switch ( random_num ( 1, 2 ) )
			{
				case 1:
				{
					cs_set_user_money ( Player, 16000 );
					afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ai castigat^x03 Big JackPot^x01 in valoare de^x04 16000$^x01! Felicitari!" );
					g_Tombola_Played [ Player ] = true;
				}

				case 2:
				{
					cs_set_user_money ( Player, 0 );
					afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ne pare rau, dar ai pierdut toti banii!" );
					g_Tombola_Played [ Player ] = true;
				}
			}
		}

		case 1:
		{
			menu_destroy ( Tombola_Menu );
			ClientCommand_ChooseTeam ( Player );
		}
	}

	menu_destroy ( Tombola_Menu );
	return PLUGIN_HANDLED;
}

public Meniu_Iteme ( Player )
{
	if ( !is_user_alive ( Player ) || get_user_team ( Player ) == 3 )
	{
		afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in^x03 viata^x01 pentru a putea accesa acest meniu!" );
		return PLUGIN_HANDLED;
	}

	new g_items = menu_create ( "\rCumpara Iteme", "g_items_handler" );

	menu_additem ( g_items, "\w5 Bulgari (\r16,000$\w)" );
	menu_additem ( g_items, "\w16,000 $ (\r5 Bulgari\w" );
	menu_additem ( g_items, "\wSet Grenazi (\r10 Bulgari\w)" );
	if ( get_user_team ( Player ) == 1 )
		menu_additem ( g_items, "\wArmele Mosului (\r15 Bulgari\w)" );
	else if ( get_user_team ( Player ) == 2 )
		menu_additem ( g_items, "\wArmele lui Grinch (\r15 Bulgari\w)" );
	menu_additem ( g_items, "\wInvizibilitate 50% (\r20 Bulgari\w)" );
	menu_additem ( g_items, "\wSansa Respawn (\r30 Bulgari\w)" );
	menu_additem ( g_items, "\wGod Mode (5 Secunde) (\r40 Bulgari\w)" );
	menu_additem ( g_items, "\wNo Clip (\r50 Bulgari\w" );
	if ( get_user_team ( Player ) == 1 )
		menu_additem ( g_items, "\wDevino Mos Craciun (\r60 Bulgari\w)" );
	else if ( get_user_team ( Player ) == 2 )
		menu_additem ( g_items, "\wDevino Grinch (\r60 Bulgari\w)" );

	menu_setprop ( g_items, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, g_items, 0 );
	return PLUGIN_CONTINUE;
}

public g_items_handler ( Player, g_items, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( g_items );
		return PLUGIN_HANDLED;
	}

	new Money = cs_get_user_money ( Player );

	switch ( item )
	{
		case 0:
		{
			if ( Money < 16000 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Iti trebuie^x04 16,000$^x01 pentru a cumpara^x04 5 Bulgari" );
				return PLUGIN_HANDLED;
			}


			g_Bulgari[Player] += 5;
			cs_set_user_money ( Player, 0 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 5 Bulgari^x01 din magazinul Mosului!" );
		}

		case 1:
		{
			if ( g_Bulgari[Player] < 5 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari." );
				return PLUGIN_HANDLED;
			}

			if ( Money == 16000 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai deja^x03 16,000 $" );
				return PLUGIN_HANDLED;
			}


			g_Bulgari[Player] -= 5;
			cs_set_user_money ( Player, 16000 );
		}

		case 2:
		{
			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( g_Bulgari[Player] < 10 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari." );
				return PLUGIN_HANDLED;
			}

			give_item ( Player, "weapon_hegrenade" );
			give_item ( Player, "weapon_smokegrenade" );
			give_item ( Player, "weapon_flashbang" );
			give_item ( Player, "weapon_flashbang" );
			g_Bulgari[Player] -= 10;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat un^x03 Set Grenazi" );
		}

		case 3:
		{
			if ( !is_user_alive ( Player ) || get_user_team ( Player ) != 1|2 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( g_Bulgari[Player] < 15 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			strip_user_weapons ( Player );
			give_item ( Player, "weapon_knife" );
			give_item ( Player, "weapon_deagle" );
			give_item ( Player, get_user_team ( Player ) == 1 ? "weapon_m4a1" : "weapon_ak47" );
			give_item ( Player, "weapon_hegrenade" );
			give_item ( Player, "weapon_smokegrenade" );
			give_item ( Player, "weapon_flashbang" );
			give_item ( Player, "weapon_flashbang" );
			cs_set_user_bpammo ( Player, CSW_DEAGLE, 35 );
			cs_set_user_bpammo ( Player, get_user_team ( Player ) == 1 ? CSW_M4A1 : CSW_AK47, 90 );
			g_Bulgari[Player] -= 15;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 Armele %s^x01 din magazin.", get_user_team ( Player ) == 1 ? "Mosului" : "lui Grinch" );
		}

		case 4:
		{
			if ( g_Bulgari[Player] < 20 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}
	
			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Invizibilitate [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest bonus!" );
				return PLUGIN_HANDLED;
			}

			c_Invizibilitate [ Player ] = true;
			g_Bulgari[Player] -= 20;
			set_user_rendering ( Player, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 50 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 Invizibilitate (50%)" );
		}

		case 5:
		{
			if ( g_Bulgari[Player] < 30 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Respawn [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat deja acest item!" );
				return PLUGIN_HANDLED;
			}

			c_Respawn [ Player ] = true;
			g_Bulgari[Player] -= 30;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 O Sansa de Respawn" );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Cand vei muri vei avea o sansa de a reinvia!" );
		}

		case 6:
		{
			if ( g_Bulgari[Player] < 40 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Items]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}


			if ( c_GodMode [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}


			c_GodMode [ Player ] = true;
			g_Bulgari[Player] -= 40;
			set_user_godmode ( Player, 1 );
			set_task ( 5.0, "function_godmode", Player );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 God Mode (5 Secunde)" );
		}

		case 7:
		{
			if ( g_Bulgari[Player] < 50 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Clip [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}

			c_Clip [ Player ] = true;
			g_Bulgari[Player] -= 50;
			set_user_noclip ( Player, 1 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 No Clip" );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Acum poti trece prin pereti!" );
		}


		case 8:
		{
			if ( g_Bulgari[Player] < 60 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Santa [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}


			c_Santa [ Player ] = true;
			cs_set_player_model ( Player, get_user_team ( Player ) == 1 ? c_Santa_Model : c_Grinch_Model );
			g_Bulgari[Player] -= 60;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Acum ai devenit^x03 %s", get_user_team ( Player ) == 1 ? "Santa" : "Grinch" );
		}
	}

	menu_destroy ( g_items );
	return PLUGIN_HANDLED;
}

///////////////////////////////////////////////////
//	New Code 2017
///////////////////////////////////////////////////
public Meniu_Radio(Player)
{
	new g_Radio = menu_create("\wAsculta Radio", "Meniu_Radio_Handler");

	menu_additem(g_Radio, "\wRadio KISS FM");
	menu_additem(g_Radio, "\wRadio PRO FM");
	menu_additem(g_Radio, "\wRadio ZU");

	menu_setprop(g_Radio, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_Radio, 0);
}

public Meniu_Radio_Handler(Player, g_Radio, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Radio);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:	show_motd(Player, "addons/amxmodx/configs/Radio/kiss.html");
		case 1:	show_motd(Player, "addons/amxmodx/configs/Radio/pro.html");
		case 2:	show_motd(Player, "addons/amxmodx/configs/Radio/zu.html");
	}

	menu_destroy(g_Radio);
	return PLUGIN_HANDLED;
}

public Printeaza_Informatii(Player)
{
	afiseaza_mesaj(Player, "^x04---------- XMAS MOD v2.0 Final by LondoN eXtream ----------");
	afiseaza_mesaj(Player, "^x03[*]^x01 Nume Plugin:^x03 XMAS Mod");
	afiseaza_mesaj(Player, "^x03[*]^x01 Versiune Plugin:^x03 2.0 Final (2017)");
	afiseaza_mesaj(Player, "^x04---------- XMAS MOD v2.0 Final by LondoN eXtream ----------");

	console_print(Player, "----------------------------------------");
	console_print(Player, "[*] Mod URL: %s", c_MOD_Link);
	console_print(Player, "----------------------------------------");
}

public Build_Statistics(Player)
{
	/*	---------------------
		Building Statistics
		---------------------*/
	new szStats[8], szBody[8], Pos, Max;
	new c_Deaths[16], c_Kills[16], c_Loc[16], c_LocMax[16];

	Max = get_statsnum();
	Pos = get_user_stats(Player, szStats, szBody);

	AddCommas(Pos, c_Loc, charsmax(c_Loc));
	AddCommas(Max, c_LocMax, charsmax(c_LocMax));
	AddCommas(szStats[0], c_Kills, charsmax(c_Kills));
	AddCommas(szStats[1], c_Deaths, charsmax(c_Deaths));

	afiseaza_mesaj(Player, "^x04[XMAS]^x01 Esti pe locul^x03 %s^x01 din^x03 %s^x01 cu^x03 %s^x01 killuri si^x03 %s^x01 decese.", c_Loc, c_LocMax, c_Kills, c_Deaths);

	///////////////////////////////////////////
	//	Building Menu Stats
	///////////////////////////////////////////
	new g_MenuTitle[64], g_Loc[64], g_Numbers[32], g_Numbers2[32];
	formatex(g_MenuTitle, charsmax(g_MenuTitle), "\wWelcome, \r%s ^n^n", g_Player[Player]);
	formatex(g_Loc, charsmax(g_Loc), "\wPosition: \r%s\w/\r%s", c_Loc, c_LocMax);
	formatex(g_Numbers, charsmax(g_Numbers), "\wKills: \r%s", c_Kills);
	formatex(g_Numbers2, charsmax(g_Numbers2), "\wDeaths: \r%s", c_Deaths);

	new g_Rank = menu_create(g_MenuTitle, "empty_handler");
	
	menu_additem(g_Rank, g_Loc);
	menu_additem(g_Rank, g_Numbers);
	menu_additem(g_Rank, g_Numbers2);

	menu_setprop(g_Rank, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_Rank, 0);
}

public empty_handler(Player, g_Rank, item)	return PLUGIN_HANDLED;

public Build_Menu_Admins(Player)
{
	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
	return PLUGIN_HANDLED;
}

public Meniu_Admin(Player)
{
	if(!is_user_admin(Player))
	{
		afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Trebuie sa fii admin pentru a putea accesa aceasta sectiune!");
		return PLUGIN_HANDLED;
	}

	new g_aMenu = menu_create("\rAdmin Menu", "aMenu_Handler");
	
	menu_additem(g_aMenu, "\wEchilibreaza Echipele");
	menu_additem(g_aMenu, "\wRespawn Players");
	menu_additem(g_aMenu, "\wKick Players");
	menu_additem(g_aMenu, "\wBan Players");

	menu_setprop(g_aMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_aMenu, 0);
	return PLUGIN_CONTINUE;
}

public aMenu_Handler(Player, g_aMenu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_aMenu);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:
		{
			server_cmd("mp_autoteambalance 1");
			afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Echipele se vor echilibra runda viitoare!");
		}
		
		case 1:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
		case 2:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
		case 3:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
	}

	menu_destroy(g_aMenu);
	return PLUGIN_HANDLED;
}

afiseaza_mesaj ( iTarget, cMessage [ ], any:... )
{
	static gmsgSayText, cBuffer [ 192 ];
	if ( !gmsgSayText )	gmsgSayText = get_user_msgid ( "SayText" );
	vformat ( cBuffer, 191, cMessage, 3 );

	message_begin ( MSG_ONE_UNRELIABLE, gmsgSayText, _, iTarget );
	write_byte ( iTarget );
	write_string ( cBuffer );
	message_end ( );
}

AddCommas(iNum, szOutput[], iLen)
{
	static szTmp[15], iOutputPos, iNumPos, iNumLen;
	szTmp[0]='^0', iOutputPos=iNumPos=iNumLen=0;
	if(iNum<0)
	{
		szOutput[iOutputPos++]='-';
		iNum = abs(iNum);
	}

	iNumLen = num_to_str(iNum, szTmp, charsmax(szTmp));

	if(iNumLen <= 3)
		iOutputPos += copy(szOutput[iOutputPos], iLen, szTmp);
	else
	{
		while((iNumPos < iNumLen) && (iOutputPos < iLen))
		{
			szOutput[iOutputPos++] = szTmp[iNumPos++];
			if((iNumLen-iNumPos) && !((iNumLen-iNumPos) % 3))
				szOutput[iOutputPos++] = ',';
		}

		szOutput[iOutputPos] = EOS;
	}

	return iOutputPos;
}
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
User avatar
Jucks
Membru, skill +3
Membru, skill +3
Posts: 1146
Joined: 20 May 2016, 15:28
Detinator Steam: Da
Fond eXtream: 0
Contact:

19 Nov 2019, 15:41

Rainq wrote:
19 Nov 2019, 13:21
testeaza

Code: Select all

#include < amxmodx >
#include < amxmisc >
#include < csx >
#include < cstrike >
#include < fun >
#include < fakemeta >
#include < hamsandwich >
#include < geoip >

#define VERSION "2.0"
#define AUTHOR "LondoN eXtream"

#define c_Grinch_Model "arctic"
#define c_Santa_Model "sas"
#define c_MOD_Link "https://www.powergame.ro"

#define TASK_HUD 8876224
#define TASK_HUD_ID (taskid - TASK_HUD)

native cs_set_player_model(id, const model[])
native cs_reset_player_model(id)

new g_AdminCount;
new g_Hud;
new g_Bulgari [ 33 ];
new g_Player [ 33 ] [ 32 ];

// ---------------------------
// [	Pentru Tombola	]
// ----------------------------
new bool: g_Tombola_Played [ 33 ];
new g_CvarTombolaCost;

// ----------------------------------
// [ 	Shop Bulgari	]
// ----------------------------------
new bool: c_Invizibilitate [ 33 ];	// Invizibilitate
new bool: c_Respawn [ 33 ];		// Respawn
new bool: c_GodMode [ 33 ];		// God Mode
new bool: c_Clip [ 33 ];		// No Clip
new bool: c_Santa [ 33 ];		// Santa;

public plugin_init ( )
{
	register_plugin ( "Game Menu", VERSION, AUTHOR );

	register_clcmd ( "chooseteam", "ClientCommand_ChooseTeam" );

	g_Hud = CreateHudSyncObj ( );

	register_event ( "HLTV", "ev_new_round", "a" );
	register_event ( "DeathMsg", "function_DeathMsg", "a" );

	register_concmd ( "amx_give_bulgari", "function_give_bulgari", ADMIN_ALL, "<user> <bulgari>" );

	g_CvarTombolaCost = register_cvar ( "amx_tombola_cost", "1500" );
}

public client_putinserver ( Player )
{
	if ( !is_user_bot ( Player ) && !is_user_hltv ( Player ) )
	{
		if ( is_user_admin ( Player ) )
			g_AdminCount++;

		client_cmd(Player, "cl_weather ^"1^"");
		g_Bulgari [ Player ] = 5;
		engfunc ( EngFunc_LightStyle, Player, "k" );
		get_user_name ( Player, g_Player [ Player ], charsmax ( g_Player [ ] ) );
		set_task ( 1.0, "HUD_TASK", Player+TASK_HUD, _, _, "b" );
	}

	return PLUGIN_CONTINUE;
}

public client_disconnect ( Player )
{
	if ( !is_user_bot ( Player ) || !is_user_hltv ( Player ) )
	{
		if ( is_user_admin ( Player ) )
			g_AdminCount--;

		remove_task ( Player+TASK_HUD );
	}

	return PLUGIN_CONTINUE;
}

public ev_new_round ( )
{
	new Players [ 32 ], iNum, TempIndex;
	get_players ( Players, iNum );
	for ( new i; i < iNum; i++ )
	{
	//	TempIndex = Players;
		
		g_Tombola_Played[TempIndex] = false;
		c_Respawn[TempIndex] = false;
		c_GodMode[TempIndex] = false;
		c_Clip[TempIndex] = false;
	
		if(c_Invizibilitate[TempIndex])
		{
			set_user_rendering(TempIndex, kRenderFxNone, 0, 0, 0, kRenderNormal, 255);
			c_Invizibilitate[TempIndex] = false;
		}
		
	}
}

public function_DeathMsg ( )
{
	new Killer = read_data ( 1 );
	new Victima = read_data ( 2 );

	if ( Killer == Victima || !is_user_connected ( Killer ) || !is_user_alive ( Killer ) )
		return PLUGIN_HANDLED;

	g_Bulgari [ Killer ] += 1;

	if ( c_Clip [ Victima ] )
	{
		c_Clip [ Victima ] = false;
		set_user_noclip ( Victima, 0 );
	}

	if ( c_Santa [ Victima ] )
	{
		c_Santa [ Victima ] = false;
		cs_reset_player_model ( Victima );
	}

	if ( !is_user_alive ( Victima ) && c_Respawn [ Victima ] )
	{
		set_task ( 2.0, "function_respawn_players", Victima );
		afiseaza_mesaj ( Victima, "^x04[Sansa Respawn]^x01 Alegem sansa ta....te rugam sa astepti!" );
	}

	return PLUGIN_CONTINUE;
}

public function_respawn_players ( Victim )
{
	switch ( random_num ( 1, 2 ) )
	{
		case 1:
		{
			ExecuteHamB ( Ham_CS_RoundRespawn, Victim );
			afiseaza_mesaj ( Victim, "^x04[Sansa Respawn]^x01 Mosul ti-a oferit o sansa si te-a reinviat!" );
		}

		case 2:	afiseaza_mesaj ( Victim, "^x04[Sansa Respawn]^x01 Din pacate ai fost obraznic si nu vei primi respawn!" );
	}

	c_Respawn [ Victim ] = false;
}

public function_godmode ( Player )
{
	set_user_godmode ( Player, 0 );
	c_GodMode [ Player ] = false;
	afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Puterea^x03 God Mode (5 Secunde)^x01 a expirat!" );
}

public function_give_bulgari(Player, level, cid) {
	if(!cmd_access(Player, level, cid, 2))
		return PLUGIN_HANDLED;

	new szPlayer[32], szAmount[16];
	read_argv(1, szPlayer, charsmax(szPlayer));
	read_argv(2, szAmount, charsmax(szAmount));

	new g_Target = cmd_target(Player, szPlayer, 8);

	if(!g_Target || szAmount[0] == '0')
		return PLUGIN_HANDLED;

	g_Bulgari[g_Target] += str_to_num(szAmount);
	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Ai daruit^x04 %d^x01 bulgari jucatorului^x03 %s", str_to_num(szAmount), g_Player[g_Target]);
	afiseaza_mesaj(g_Target, "^x04[XMAS 2.0]^x01 Adminul^x03 %s^x01 ti-a daruit^x04 %d^x01 bulgari", g_Player[Player], str_to_num(szAmount));
	return PLUGIN_CONTINUE;
}

public HUD_TASK ( taskid )
{
	static Player;
	Player = TASK_HUD_ID;

	if ( !is_user_alive ( Player ) )
	{
		Player = pev ( Player, pev_iuser2 );

		if ( !is_user_alive ( Player ) )	return;
	}

	new g_HudMsg [ 1024 ];
	set_hudmessage ( 0, 127, 255, 0.02, -1.0, 0, _, 1.0, _, _, 1 );

	if ( Player != TASK_HUD_ID )
	{
		new g_Tara [ 32 ], g_IP [ 16 ];
		get_user_ip ( Player, g_IP, charsmax ( g_IP ), 1 );
		geoip_country ( g_IP, g_Tara, charsmax ( g_Tara ) );
		formatex ( g_HudMsg, charsmax ( g_HudMsg ), "^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n[Spectating: %s | Bulgări: %d |Viaţă: %d |Armură: %d | Ţara: %s]", g_Player [ Player ], g_Bulgari [ Player ], get_user_health ( Player ), get_user_armor ( Player ), equal ( g_Tara, "error" ) ? "N/A" : g_Tara );
		ShowSyncHudMsg ( TASK_HUD_ID, g_Hud, g_HudMsg );
	}
	else
	{
		formatex ( g_HudMsg, charsmax ( g_HudMsg ), "^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n^n[Nume: %s | Bulgări: %d | Viaţă: %d | Armură: %d]", g_Player [ TASK_HUD_ID ], g_Bulgari [ TASK_HUD_ID ], get_user_health ( TASK_HUD_ID ), get_user_armor ( TASK_HUD_ID ) );
		ShowSyncHudMsg ( TASK_HUD_ID, g_Hud, g_HudMsg );
	}
}

public ClientCommand_ChooseTeam ( Player )
{
	new g_Title [ 64 ], g_AdminItem [ 128 ];
	formatex ( g_Title, charsmax ( g_Title ), "\rGame Menu^n\rXMAS \y%s \wby \r%s^n", VERSION, AUTHOR );
	formatex ( g_AdminItem, charsmax ( g_AdminItem ), "\wAdmini Online (\r%d\w)", g_AdminCount );
	new g_Menu = menu_create ( g_Title, "Menu_Handler" );

	menu_additem ( g_Menu, "\wJoacă la Tombola" );
	menu_additem ( g_Menu, "\wCumpără Iteme" );
	menu_additem ( g_Menu, "\wAscultă Radio" );
	menu_additem ( g_Menu, "\wInformaţii Server" );
	menu_additem ( g_Menu, "\wStatisticile Tale" );
	menu_additem ( g_Menu, g_AdminItem );
	
	if ( is_user_admin ( Player ) )
		menu_additem ( g_Menu, "\wZona Adminilor" );
	else
		menu_additem ( g_Menu, "\dZona Adminilor (\rNu eşti ADMIN\d)" );

	menu_setprop ( g_Menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, g_Menu, 0 );
	return PLUGIN_HANDLED;
}

public Menu_Handler ( Player, g_Menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( g_Menu );
		return PLUGIN_HANDLED;
	}

	switch ( item )
	{
		case 0:	Meniu_Tombola ( Player );
		case 1:	Meniu_Iteme ( Player );
		case 2:	Meniu_Radio ( Player );
		case 3:	Printeaza_Informatii ( Player );
		case 4:	Build_Statistics ( Player );
		case 5:	Build_Menu_Admins ( Player );
		case 6:	Meniu_Admin ( Player );
	}

	return PLUGIN_HANDLED;
}

public Meniu_Tombola ( Player )
{
	if ( g_Tombola_Played [ Player ] )
	{
		afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ai jucat deja la tombola runda aceasta!" );
		return PLUGIN_HANDLED;
	}

	new g_Title [ 128 ];
	formatex ( g_Title, charsmax ( g_Title ), "\yTombola^n\wCost: \r%d \w$", get_pcvar_num ( g_CvarTombolaCost ) );
	new Tombola_Menu = menu_create ( g_Title, "Handler_Tombola_Menu" );

	menu_additem ( Tombola_Menu, "\wJoaca (\r1500\w)" );
	menu_additem ( Tombola_Menu, "\wRevino la meniul principal" );

	menu_setprop ( Tombola_Menu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, Tombola_Menu, 0 );
	return PLUGIN_CONTINUE;
}

public Handler_Tombola_Menu ( Player, Tombola_Menu, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( Tombola_Menu );
		return PLUGIN_HANDLED;
	}

	switch ( item )
	{
		case 0:
		{
			new g_Cost = get_pcvar_num ( g_CvarTombolaCost );
			new g_Money = cs_get_user_money ( Player );

			if ( g_Money < g_Cost )
			{
				afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Nu ai suficienti bani pentru a juca la tombola!" );
				return PLUGIN_HANDLED;
			}

			cs_set_user_money ( Player, g_Money - g_Cost );

			switch ( random_num ( 1, 2 ) )
			{
				case 1:
				{
					cs_set_user_money ( Player, 16000 );
					afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ai castigat^x03 Big JackPot^x01 in valoare de^x04 16000$^x01! Felicitari!" );
					g_Tombola_Played [ Player ] = true;
				}

				case 2:
				{
					cs_set_user_money ( Player, 0 );
					afiseaza_mesaj ( Player, "^x04[Tombola]^x01 Ne pare rau, dar ai pierdut toti banii!" );
					g_Tombola_Played [ Player ] = true;
				}
			}
		}

		case 1:
		{
			menu_destroy ( Tombola_Menu );
			ClientCommand_ChooseTeam ( Player );
		}
	}

	menu_destroy ( Tombola_Menu );
	return PLUGIN_HANDLED;
}

public Meniu_Iteme ( Player )
{
	if ( !is_user_alive ( Player ) || get_user_team ( Player ) == 3 )
	{
		afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in^x03 viata^x01 pentru a putea accesa acest meniu!" );
		return PLUGIN_HANDLED;
	}

	new g_items = menu_create ( "\rCumpara Iteme", "g_items_handler" );

	menu_additem ( g_items, "\w5 Bulgari (\r16,000$\w)" );
	menu_additem ( g_items, "\w16,000 $ (\r5 Bulgari\w" );
	menu_additem ( g_items, "\wSet Grenazi (\r10 Bulgari\w)" );
	if ( get_user_team ( Player ) == 1 )
		menu_additem ( g_items, "\wArmele Mosului (\r15 Bulgari\w)" );
	else if ( get_user_team ( Player ) == 2 )
		menu_additem ( g_items, "\wArmele lui Grinch (\r15 Bulgari\w)" );
	menu_additem ( g_items, "\wInvizibilitate 50% (\r20 Bulgari\w)" );
	menu_additem ( g_items, "\wSansa Respawn (\r30 Bulgari\w)" );
	menu_additem ( g_items, "\wGod Mode (5 Secunde) (\r40 Bulgari\w)" );
	menu_additem ( g_items, "\wNo Clip (\r50 Bulgari\w" );
	if ( get_user_team ( Player ) == 1 )
		menu_additem ( g_items, "\wDevino Mos Craciun (\r60 Bulgari\w)" );
	else if ( get_user_team ( Player ) == 2 )
		menu_additem ( g_items, "\wDevino Grinch (\r60 Bulgari\w)" );

	menu_setprop ( g_items, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Player, g_items, 0 );
	return PLUGIN_CONTINUE;
}

public g_items_handler ( Player, g_items, item )
{
	if ( item == MENU_EXIT )
	{
		menu_destroy ( g_items );
		return PLUGIN_HANDLED;
	}

	new Money = cs_get_user_money ( Player );

	switch ( item )
	{
		case 0:
		{
			if ( Money < 16000 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Iti trebuie^x04 16,000$^x01 pentru a cumpara^x04 5 Bulgari" );
				return PLUGIN_HANDLED;
			}


			g_Bulgari[Player] += 5;
			cs_set_user_money ( Player, 0 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 5 Bulgari^x01 din magazinul Mosului!" );
		}

		case 1:
		{
			if ( g_Bulgari[Player] < 5 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari." );
				return PLUGIN_HANDLED;
			}

			if ( Money == 16000 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai deja^x03 16,000 $" );
				return PLUGIN_HANDLED;
			}


			g_Bulgari[Player] -= 5;
			cs_set_user_money ( Player, 16000 );
		}

		case 2:
		{
			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( g_Bulgari[Player] < 10 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari." );
				return PLUGIN_HANDLED;
			}

			give_item ( Player, "weapon_hegrenade" );
			give_item ( Player, "weapon_smokegrenade" );
			give_item ( Player, "weapon_flashbang" );
			give_item ( Player, "weapon_flashbang" );
			g_Bulgari[Player] -= 10;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat un^x03 Set Grenazi" );
		}

		case 3:
		{
			if ( !is_user_alive ( Player ) || get_user_team ( Player ) != 1|2 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( g_Bulgari[Player] < 15 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			strip_user_weapons ( Player );
			give_item ( Player, "weapon_knife" );
			give_item ( Player, "weapon_deagle" );
			give_item ( Player, get_user_team ( Player ) == 1 ? "weapon_m4a1" : "weapon_ak47" );
			give_item ( Player, "weapon_hegrenade" );
			give_item ( Player, "weapon_smokegrenade" );
			give_item ( Player, "weapon_flashbang" );
			give_item ( Player, "weapon_flashbang" );
			cs_set_user_bpammo ( Player, CSW_DEAGLE, 35 );
			cs_set_user_bpammo ( Player, get_user_team ( Player ) == 1 ? CSW_M4A1 : CSW_AK47, 90 );
			g_Bulgari[Player] -= 15;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 Armele %s^x01 din magazin.", get_user_team ( Player ) == 1 ? "Mosului" : "lui Grinch" );
		}

		case 4:
		{
			if ( g_Bulgari[Player] < 20 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}
	
			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Invizibilitate [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest bonus!" );
				return PLUGIN_HANDLED;
			}

			c_Invizibilitate [ Player ] = true;
			g_Bulgari[Player] -= 20;
			set_user_rendering ( Player, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 50 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai achizitionat^x03 Invizibilitate (50%)" );
		}

		case 5:
		{
			if ( g_Bulgari[Player] < 30 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Respawn [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat deja acest item!" );
				return PLUGIN_HANDLED;
			}

			c_Respawn [ Player ] = true;
			g_Bulgari[Player] -= 30;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 O Sansa de Respawn" );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Cand vei muri vei avea o sansa de a reinvia!" );
		}

		case 6:
		{
			if ( g_Bulgari[Player] < 40 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Items]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}


			if ( c_GodMode [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}


			c_GodMode [ Player ] = true;
			g_Bulgari[Player] -= 40;
			set_user_godmode ( Player, 1 );
			set_task ( 5.0, "function_godmode", Player );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 God Mode (5 Secunde)" );
		}

		case 7:
		{
			if ( g_Bulgari[Player] < 50 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Clip [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}

			c_Clip [ Player ] = true;
			g_Bulgari[Player] -= 50;
			set_user_noclip ( Player, 1 );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Ai cumparat^x03 No Clip" );
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Acum poti trece prin pereti!" );
		}


		case 8:
		{
			if ( g_Bulgari[Player] < 60 )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Nu ai suficienti bulgari!" );
				return PLUGIN_HANDLED;
			}

			if ( !is_user_alive ( Player ) )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Trebuie sa fii in viata!" );
				return PLUGIN_HANDLED;
			}

			if ( c_Santa [ Player ] )
			{
				afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Detii deja acest item!" );
				return PLUGIN_HANDLED;
			}


			c_Santa [ Player ] = true;
			cs_set_player_model ( Player, get_user_team ( Player ) == 1 ? c_Santa_Model : c_Grinch_Model );
			g_Bulgari[Player] -= 60;
			afiseaza_mesaj ( Player, "^x04[Iteme]^x01 Acum ai devenit^x03 %s", get_user_team ( Player ) == 1 ? "Santa" : "Grinch" );
		}
	}

	menu_destroy ( g_items );
	return PLUGIN_HANDLED;
}

///////////////////////////////////////////////////
//	New Code 2017
///////////////////////////////////////////////////
public Meniu_Radio(Player)
{
	new g_Radio = menu_create("\wAsculta Radio", "Meniu_Radio_Handler");

	menu_additem(g_Radio, "\wRadio KISS FM");
	menu_additem(g_Radio, "\wRadio PRO FM");
	menu_additem(g_Radio, "\wRadio ZU");

	menu_setprop(g_Radio, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_Radio, 0);
}

public Meniu_Radio_Handler(Player, g_Radio, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_Radio);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:	show_motd(Player, "addons/amxmodx/configs/Radio/kiss.html");
		case 1:	show_motd(Player, "addons/amxmodx/configs/Radio/pro.html");
		case 2:	show_motd(Player, "addons/amxmodx/configs/Radio/zu.html");
	}

	menu_destroy(g_Radio);
	return PLUGIN_HANDLED;
}

public Printeaza_Informatii(Player)
{
	afiseaza_mesaj(Player, "^x04---------- XMAS MOD v2.0 Final by LondoN eXtream ----------");
	afiseaza_mesaj(Player, "^x03[*]^x01 Nume Plugin:^x03 XMAS Mod");
	afiseaza_mesaj(Player, "^x03[*]^x01 Versiune Plugin:^x03 2.0 Final (2017)");
	afiseaza_mesaj(Player, "^x04---------- XMAS MOD v2.0 Final by LondoN eXtream ----------");

	console_print(Player, "----------------------------------------");
	console_print(Player, "[*] Mod URL: %s", c_MOD_Link);
	console_print(Player, "----------------------------------------");
}

public Build_Statistics(Player)
{
	/*	---------------------
		Building Statistics
		---------------------*/
	new szStats[8], szBody[8], Pos, Max;
	new c_Deaths[16], c_Kills[16], c_Loc[16], c_LocMax[16];

	Max = get_statsnum();
	Pos = get_user_stats(Player, szStats, szBody);

	AddCommas(Pos, c_Loc, charsmax(c_Loc));
	AddCommas(Max, c_LocMax, charsmax(c_LocMax));
	AddCommas(szStats[0], c_Kills, charsmax(c_Kills));
	AddCommas(szStats[1], c_Deaths, charsmax(c_Deaths));

	afiseaza_mesaj(Player, "^x04[XMAS]^x01 Esti pe locul^x03 %s^x01 din^x03 %s^x01 cu^x03 %s^x01 killuri si^x03 %s^x01 decese.", c_Loc, c_LocMax, c_Kills, c_Deaths);

	///////////////////////////////////////////
	//	Building Menu Stats
	///////////////////////////////////////////
	new g_MenuTitle[64], g_Loc[64], g_Numbers[32], g_Numbers2[32];
	formatex(g_MenuTitle, charsmax(g_MenuTitle), "\wWelcome, \r%s ^n^n", g_Player[Player]);
	formatex(g_Loc, charsmax(g_Loc), "\wPosition: \r%s\w/\r%s", c_Loc, c_LocMax);
	formatex(g_Numbers, charsmax(g_Numbers), "\wKills: \r%s", c_Kills);
	formatex(g_Numbers2, charsmax(g_Numbers2), "\wDeaths: \r%s", c_Deaths);

	new g_Rank = menu_create(g_MenuTitle, "empty_handler");
	
	menu_additem(g_Rank, g_Loc);
	menu_additem(g_Rank, g_Numbers);
	menu_additem(g_Rank, g_Numbers2);

	menu_setprop(g_Rank, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_Rank, 0);
}

public empty_handler(Player, g_Rank, item)	return PLUGIN_HANDLED;

public Build_Menu_Admins(Player)
{
	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
	return PLUGIN_HANDLED;
}

public Meniu_Admin(Player)
{
	if(!is_user_admin(Player))
	{
		afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Trebuie sa fii admin pentru a putea accesa aceasta sectiune!");
		return PLUGIN_HANDLED;
	}

	new g_aMenu = menu_create("\rAdmin Menu", "aMenu_Handler");
	
	menu_additem(g_aMenu, "\wEchilibreaza Echipele");
	menu_additem(g_aMenu, "\wRespawn Players");
	menu_additem(g_aMenu, "\wKick Players");
	menu_additem(g_aMenu, "\wBan Players");

	menu_setprop(g_aMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(Player, g_aMenu, 0);
	return PLUGIN_CONTINUE;
}

public aMenu_Handler(Player, g_aMenu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(g_aMenu);
		return PLUGIN_HANDLED;
	}

	switch(item)
	{
		case 0:
		{
			server_cmd("mp_autoteambalance 1");
			afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 Echipele se vor echilibra runda viitoare!");
		}
		
		case 1:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
		case 2:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
		case 3:	afiseaza_mesaj(Player, "^x04[XMAS 2.0]^x01 In constructie.");
	}

	menu_destroy(g_aMenu);
	return PLUGIN_HANDLED;
}

afiseaza_mesaj ( iTarget, cMessage [ ], any:... )
{
	static gmsgSayText, cBuffer [ 192 ];
	if ( !gmsgSayText )	gmsgSayText = get_user_msgid ( "SayText" );
	vformat ( cBuffer, 191, cMessage, 3 );

	message_begin ( MSG_ONE_UNRELIABLE, gmsgSayText, _, iTarget );
	write_byte ( iTarget );
	write_string ( cBuffer );
	message_end ( );
}

AddCommas(iNum, szOutput[], iLen)
{
	static szTmp[15], iOutputPos, iNumPos, iNumLen;
	szTmp[0]='^0', iOutputPos=iNumPos=iNumLen=0;
	if(iNum<0)
	{
		szOutput[iOutputPos++]='-';
		iNum = abs(iNum);
	}

	iNumLen = num_to_str(iNum, szTmp, charsmax(szTmp));

	if(iNumLen <= 3)
		iOutputPos += copy(szOutput[iOutputPos], iLen, szTmp);
	else
	{
		while((iNumPos < iNumLen) && (iOutputPos < iLen))
		{
			szOutput[iOutputPos++] = szTmp[iNumPos++];
			if((iNumLen-iNumPos) && !((iNumLen-iNumPos) % 3))
				szOutput[iOutputPos++] = ',';
		}

		szOutput[iOutputPos] = EOS;
	}

	return iOutputPos;
}
merge compilat dar nu functioneaza ca plugin pe server ...
Detinator : # Go.Tried.Ro #
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests