[Plugin] Ultimate Furien Shop

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
codrutzz
Membru, skill +2
Membru, skill +2
Posts: 539
Joined: 29 Jan 2014, 18:27
Detinator Steam: Da
CS Status: Nu citesc forumu xtreamCS* =]]]
Detinator server CS: In curand
SteamID: Personal
Location: Iasi<3
Has thanked: 68 times
Been thanked: 9 times
Contact:

30 Jan 2014, 20:19

Un link de download sau sma please?
eXtreamSHOP
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

30 Jan 2014, 21:27

/:) /:) /:)
Aveti link-uri de download foarte bune si aveti si sma...
Probabil nu stii tu sa dai un click pe Afiseaza cod...
Poftim
Click aici: | Afiseaza codul
/*/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// -------  | -- > Multumiri < -- | ------------- //////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// ------- | ---> Hades Ownage <--- | ---------- ///////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
/////////////////////////////////// ------- | ---> YONTU <--- | ---------- ////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
*/

#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < fun >
#include < hamsandwich >
#include < fakemeta_util >
#include < message_const >
#include < ColorChat >
#include < fcs >

#pragma tabsize 0

native set_user_pet(id);

#define PLUGIN "[ Ultimate Shop ] Ultimate Furien Shop"
#define VERSION "1.2"
#define AUTHOR "NicutaMM | Cstrike"

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

// -- | Harry Magic Wand | -- //
#define HARRY_WAND_RECOIL 	0.0			// Recoil
#define HARRY_WAND_SPEED 	0.35			// Click stanga
#define HARRY_WAND_SPEED2 	0.75			// Click dreapta
#define HARRY_WAND_FIRE	random_num( 3, 6 )	// Animatie cand trage cu click stanga
#define HARRY_WAND_FIRE2	random_num( 5, 10 )	// Animatie cand trage cu click dreapta

#define TE_BEAMENTPOINT	1
#define TE_EXPLOSION		3
#define TE_SPRITETRAIL		15
#define TE_BEAMCYLINDER		21

// -- | Shop | -- //

new const Prefix[  ] = "^x04[ Ultimate Shop ]^x01";

// == | Super-Knife | == //

new bool:superknife2X [ 33 ];
new bool:superknife3X [ 33 ];

new v_superknife2X [ 66 ] = "models/v_super_knife2X.mdl";
new v_superknife3X [ 66 ] = "models/v_superknife3X.mdl";

// -- | Upgrade | -- //
new bool: Upgrade[ 33 ];

// -- | He Grenade | -- //
new Hegrnd_Countdown [ 33 ];
new Float: LastMessage [ 33 ];

// -- | Take Damage | -- //
new g_iMaxPlayers;

new bool: HaveNoFlash [ 33 ];
new g_msgScreenFade;

// -- | Harry Magic Wand | -- //

new const Tag[  ] = "[Harry Magic Wand]";

new HarryFireSound[  ] = "harry_wand/harry_shoot1.wav";
new HarryHitSound[  ] = "harry_wand/harry_hit.wav";
new HarryHitSound2[  ] = "harry_wand/harry_shoot2.wav";
new HarryModel[  ] = "models/harry_wand/v_harry_wand.mdl";

new HarryBeam, HarryExp, HarryExp2, DeathSprite;

new bool:g_HasHarryWand[ 33 ];

new Harry_Ammo[ 33 ];
new Float:HarryLastShotTime[ 33 ];

new HarryDamageCvar, HarryDamageCvar2, HarryAmmo, HarryKillMoney, HarryDistance;



public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	//Register Shop
	register_clcmd("say /shop", "FurienShop" );
	register_clcmd("say shop", "FurienShop" );
	register_clcmd("say_team /shop", "FurienShop" );
	register_clcmd("say_team shop", "FurienShop" );
	register_clcmd("say /ultimate", "FurienShop" );
	register_clcmd("say_team ultimate", "FurienShop" );
	
	// -- | Harry Magic Wand | -- //
	register_event( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	
	register_forward( FM_CmdStart, "Harry_CmdStart" );
	register_event("DeathMsg", "eDeath", "a")
	
	HarryDamageCvar = register_cvar( "harry_damage", "100.0" );
	HarryDamageCvar2 = register_cvar( "harry_damage2", "150.0" );
	HarryAmmo = register_cvar( "harry_ammo", "200" );
	HarryKillMoney = register_cvar( "harry_money_reward", "5000" );
	HarryDistance = register_cvar( "harry_distance", "90909" );

	register_concmd( "amx_get_harry", "GiveHarry", ADMIN_RCON, "< nume > < ammo >" );
	
	//Register Arme
	register_event ( "CurWeapon", "CurrWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", true );
	
	register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
	
	
	g_iMaxPlayers = get_maxplayers ( 	);
	g_msgScreenFade = get_user_msgid("ScreenFade")
}

public eDeath ( ) {
	
	if ( superknife2X [ read_data ( 2 ) ] || superknife3X [ read_data ( 2 ) ] ) {
		
		superknife2X [ read_data ( 2 ) ] = false;
		superknife3X [ read_data ( 2 ) ] = false;
	}
}

public plugin_precache ( ) {
	
	//Super-Knife
	precache_model ( v_superknife2X );
	precache_model ( v_superknife3X );
	
	// Harry Potter Wand
	precache_sound( HarryFireSound );
	precache_sound( HarryHitSound );
	precache_sound( HarryHitSound2 );

	precache_model( HarryModel );

	HarryBeam = precache_model( "sprites/harry_wand/harry_plasma_beam.spr" );
	HarryExp = precache_model( "sprites/harry_wand/harry_plasma_exp2.spr" );
	HarryExp2 = precache_model( "sprites/harry_wand/harry_plasma_exp3.spr" );
	DeathSprite = precache_model( "sprites/harry_wand/harry_skull.spr" );
}

public client_putinserver( id ) {
		
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}

public client_disconnect( id ) {
	
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}


public Spawn( id ) {
	
	Hegrnd_Countdown [ id ] = 0;
	strip_user_weapons(id)
	give_item(id, "weapon_knife" );
	
	g_HasHarryWand[ id ] = false;
	Upgrade[ id ] = false;
	HaveNoFlash [ id ] = false;
	
}
public CurrWeapon ( id ) {
	
	if ( superknife2X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife2X );
	}
	if ( superknife3X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife3X );
	}
}

public FurienShop ( id ) {
	
	if ( cs_get_user_team(id) == CS_TEAM_T ) {
		
		ShopFurien( id )
	}
	
	if ( cs_get_user_team (id ) == CS_TEAM_CT ) {
		
		ShopAntiFurien ( id )
	}
}

public ShopAntiFurien ( id ) {   
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Anti-Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "AntiFurien")
	menu_additem(menu, "\yPachet HP + AP - \r10 Credite", "1", 0);
	menu_additem(menu, "\yHarry Potter Wand - \r50 Credite", "2", 0);
	menu_additem(menu, "\yDefuse Kit - \r2 Credite", "3", 0);
	menu_additem(menu, "\y50 HP - \r5 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash - \r5 Credite^n", "6", 0);
	menu_additem(menu, "\yPet - \r20 Credite", "7", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public ShopFurien( id ) {    
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "Furien")
	menu_additem(menu, "\ySuperKnife \r[ 2X ]\y - \r5 Credite", "1", 0);
	menu_additem(menu, "\ySuperKnife \r[ 3X ]\y - \r15 Credite", "2", 0 );
	menu_additem(menu, "\yHE Grenade - \r5 Credite", "3", 0 );
	menu_additem(menu, "\y50 HP - \r5 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash \d( Only CT )", "6", 0);
	
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public Furien(id, menu, item) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{  
		
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					superknife2X[ id ] = true;
					superknife3X[ id ] = false;
					g_HasHarryWand[ id ] = false;
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 2x ].", Prefix );
					CurrWeapon( id );
					
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 2:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 15;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "!%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					superknife2X[ id ] = false;
					superknife3X[ id ] = true;
					g_HasHarryWand[ id ] = false;
					CurrWeapon( id );
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 3x ].", Prefix );
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		} 
		
		case 3:
		{
				if(Hegrnd_Countdown[id]) {
					if(LastMessage[id] < get_gametime()) {
						LastMessage[id] = get_gametime() + 1.0;
						set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
						show_hudmessage ( id, "Vei putea cumpara grenada in %d secund%s.",Hegrnd_Countdown[id], Hegrnd_Countdown[id] > 1 ? "e" : "a");
					}
				}
			
				else if ( buyhegrnd ( id ) ) {
				
					Hegrnd_Countdown[id] = 10;
					CountDown_HeGrnd(id);
				}
		}
		
		case 4:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		
	}
	menu_destroy(menu);
	return 1;
}

public AntiFurien(id, menu, item ) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				if( Upgrade[ id ] )
				{
					ColorChat(id, GREEN, "%s Poti upgrada HP si AP doar o data pe runda", Prefix );
				}
				else
				{
					Pack(id);
					Upgrade[ id ] = true;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}  
		case 2:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 50;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					
					get_harry( id )
					
					ColorChat(id, GREEN, "%s Ai cumparat Harry Potter.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 3:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 2;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{ 
					fm_give_item ( id, "item_thighpack" )
					ColorChat(id, GREEN, "%s Ai cumparat Defuse KIT.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 4:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP." );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}
		
		
		case 7:
		{
			set_user_pet(id)	
		}
	}
	menu_destroy(menu);
	return 1;
}

public eventFlash(id)
{
	if(is_user_connected(id) && HaveNoFlash [ id ])
	{
		message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id)
		write_short(1)
		write_short(1)
		write_short(1)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) 
{
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && superknife2X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && superknife3X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 3.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

// -- // -- // ---> | Pack HP & AP | <--- // -- // -- //

public Pack( id ) {
	
	new iCredits = fcs_get_user_credits ( id ) - 10;
	if( iCredits < 0 )
	{
		ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
	return 1;
						
	}
	else
	{ 
		new Armor = get_user_armor ( id );
						
		if ( Armor <= 250 )
		{
			fm_set_user_armor ( id, get_user_armor ( id ) + 300 );
		}
						
		new Health = get_user_health ( id );
						
		if ( Health <= 250 )
		{
			fm_set_user_health( id, get_user_health ( id ) + 300 );
			ColorChat(id, GREEN, "%s Ai cumparat Upgrade la Health & Armor!", Prefix );
		}
						
			fcs_set_user_credits ( id, iCredits );
		return 1;
		}
	
	return 0;
}


// -- | He Grenade | -- //

public CountDown_HeGrnd ( id ) {
	
	if(!is_user_alive(id) || get_user_team ( id ) != 1) {
		Hegrnd_Countdown[id] = 0;
	}
	else if(Hegrnd_Countdown[id] > 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Vei putea cumpara grenada in %d secund%s", Hegrnd_Countdown[id], Hegrnd_Countdown[id] == 1 ? "a" : "e");
		Hegrnd_Countdown[id]--;
		set_task(1.0, "CountDown_HeGrnd", id);
	}
	else if(Hegrnd_Countdown[id] <= 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Acum poti cumpara grenada");
		Hegrnd_Countdown[id] = 0;
	}
	
}
	
bool: buyhegrnd ( id ) {
	
	fm_give_item ( id, "weapon_hegrenade" );
	return true;
}

//////////////////// ------------ || Hanrry Potter Wand || ----------- ///////////////////////////

public GiveHarry( id, level, cid ) {
	
	if( !cmd_access( id, level, cid, 3 ) ) 
		return PLUGIN_HANDLED;
	
	new szTtarget[ 32 ], szAmmoHarry[ 21 ];
	
	read_argv( 1, szTtarget, 31 );
	read_argv( 2, szAmmoHarry, 20 );

	new iPlayer = cmd_target( id, szTtarget, 8 );

	new szAdminName[ 32 ], szPlayerName[ 32 ];

	get_user_name( id, szAdminName, 31 );
	get_user_name( iPlayer, szPlayerName, 31 );

	if( !iPlayer )
		return PLUGIN_HANDLED;

	if( !is_user_alive( iPlayer ) ) {

		client_print( id, print_console, "Jucatorul %s nu este in viata !", szPlayerName );
		return 1;
	}

	if( g_HasHarryWand[ iPlayer ] ) {

		client_print( id, print_console, "Jucatorul %s are deja bagheta !", szPlayerName );
		return 1;
	}

	else {
	
		new AmmoForMagic = str_to_num( szAmmoHarry );

		ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s i-a dat lui^x03 %s^x01 bagheta lui Harry cu^x03 %d ammo^x01 !", Tag, szAdminName, szPlayerName, szAmmoHarry );

		get_harry( iPlayer );
		Harry_Ammo[ iPlayer ] += AmmoForMagic;
	}

	return PLUGIN_CONTINUE;
}

public get_harry( id ) {

	if( is_user_alive( id ) ) {

		superknife2X[ id ] = false;
		superknife3X[ id ] = false;
		g_HasHarryWand[ id ] = true;
		engclient_cmd( id, "weapon_knife" );

		Harry_Ammo[ id ] = get_pcvar_num( HarryAmmo );
	}

	else {

		client_print( id, print_console, "Jucatorul nu este in viata! " );
		g_HasHarryWand[ id ] = false;

		return 1;
	}

	return 1;
}

public CurrentWeapon( id )
	if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] )
		set_pev( id, pev_viewmodel2, HarryModel );



public Harry_CmdStart( id, uc_handle, seed ) {
	
	if( is_user_alive( id ) && g_HasHarryWand[ id ] ) {
		
		static CurButton;
		CurButton = get_uc( uc_handle, UC_Buttons );
		new Float:flNextAttack = get_pdata_float( id, 83, 5 );

		if( CurButton & IN_ATTACK ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] > 0  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire( id );

						if( Harry_Ammo[ id ] > 0 ) {
							
							set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
							show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						}
						
						else if( Harry_Ammo[ id ] <= 0 ) {
							
							set_hudmessage( 255, 0, 0, 0.01, 0.90, 0, 6.0, 1.0 );
							show_hudmessage( id, "No Ammo !" );
							
						}
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0]  = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 1;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}		
		}
		
		else if( CurButton & IN_ATTACK2 ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] >= 5  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED2 ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE2 );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire2( id );

						set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
						show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0 ] = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 3;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK2;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}
		}
	}
	
	else if( is_user_alive ( id ) && !g_HasHarryWand[ id ] )
		return PLUGIN_CONTINUE;

	return PLUGIN_CONTINUE;
}

public Harry_Fire( id ) {
	
	static Victim, Body, EndOrigin[ 3 ], BeamOrigin[ 3 ];
	get_user_origin( id, BeamOrigin, 3 );
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam);		// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 108 ); 		// Red
	write_byte( 236 );			// Green
	write_byte( 23 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp );	// sprite
	write_byte( 10 );		// scale in 0.1's
	write_byte( 15 );		// framerate
	write_byte( 4 );		// flags
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_connected( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );
		
		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {

			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_SHOCK );
			write_coord( 0 );
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 255, 122, 122, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			death_message( id, Victim, 1, "Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}
	
	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public Harry_Fire2( id ) {
	
	static Victim, Body, EndOrigin[3], BeamOrigin[3];
	get_user_origin( id, BeamOrigin, 3 ) ;
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam );	// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 150 ); 		// Red
	write_byte( 22 );			// Green
	write_byte( 235 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp2 );
	write_byte( 10 );
	write_byte( 15 );
	write_byte( 4 );
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_alive( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );

		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_NERVEGAS );
			write_coord( 0 ) ;
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 0, 255, 0, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			death_message( id, Victim, 1, "Double Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}

	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public make_knockback( Victim, Float:origin[ 3 ], Float:maxspeed ) {

	new Float:fVelocity[ 3 ];
	
	kickback( Victim, origin, maxspeed, fVelocity );
	entity_set_vector( Victim, EV_VEC_velocity, fVelocity );
	
	return( 1 );
}

stock ShakeScreen( id, const Float:iSeconds ) {

	message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), { 0, 0, 0 }, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 1<<13 );
	message_end(  );
}

stock FadeScreen( id, const Float:iSeconds, const iRed, const iGreen, const iBlue, const iAlpha ) {
      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( iRed );
	write_byte( iGreen );
	write_byte( iBlue );
	write_byte( iAlpha );
	message_end(  );
}		

stock kickback( ent, Float:fOrigin[ 3 ], Float:fSpeed, Float:fVelocity[ 3 ] ) {

	new Float:fEntOrigin[ 3 ];
	entity_get_vector( ent, EV_VEC_origin, fEntOrigin );
	
	new Float:fDistance[ 3 ];
	fDistance[ 0 ] = fEntOrigin[ 0 ] - fOrigin[ 0 ];
	fDistance[ 1 ] = fEntOrigin[ 1 ] - fOrigin[ 1 ];
	fDistance[ 2 ] = fEntOrigin[ 2 ] - fOrigin[ 2 ];

	new Float:fTime =( vector_distance( fEntOrigin, fOrigin ) / fSpeed );
	fVelocity[ 0 ] = fDistance[ 0 ] / fTime;
	fVelocity[ 1 ] = fDistance[ 1 ] / fTime;
	fVelocity[ 2 ] = fDistance[ 2 ] / fTime;
	
	return( fVelocity[ 0 ] && fVelocity[ 1 ] && fVelocity[ 2 ] );
}

// stock from "m79"
stock death_message( Killer, Victim, ScoreBoard, const Weapon[  ] ) {
	
	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_SET );

	ExecuteHamB( Ham_Killed, Victim, Killer, 2 );

	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_NOT );

	make_deathmsg( Killer, Victim, 0, Weapon );
	cs_set_user_money( Killer, cs_get_user_money( Killer ) + get_pcvar_num( HarryKillMoney ) );
	
	if( ScoreBoard ) {

		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Killer );
		write_short( pev( Killer, pev_frags ) );
		write_short( cs_get_user_deaths( Killer ) );
		write_short( 0 );
		write_short( get_user_team( Killer ) );
		message_end(  );
		
		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Victim );
		write_short( pev( Victim, pev_frags ) );
		write_short( cs_get_user_deaths( Victim ) );
		write_short( 0 );
		write_short( get_user_team( Victim ) );
		message_end(  );
	}
}

stock set_weapon_anim( id, anim ) {

	set_pev( id, pev_weaponanim, anim );

	if( is_user_alive( id ) ) {

		message_begin( MSG_ONE, SVC_WEAPONANIM, _, id );
		write_byte( anim );
		write_byte( pev( id, pev_body ) );
		message_end(  );
	}
}

stock get_damage_body( body, Float:fDamage ) {

	switch( body ) {

		case HIT_HEAD: fDamage *= 4.0;

		case HIT_STOMACH: fDamage *= 1.1;

		case HIT_CHEST: fDamage *= 1.5;

		case HIT_LEFTARM: fDamage *= 0.77;

		case HIT_RIGHTARM: fDamage *= 0.77;

		case HIT_LEFTLEG: fDamage *= 0.75;

		case HIT_RIGHTLEG: fDamage *= 0.75;

		default: fDamage *= 1.0;
	}
	
	return floatround( fDamage );
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

30 Jan 2014, 21:27

/:) /:) /:)
Aveti link-uri de download foarte bune si aveti si sma...
Probabil nu stii tu sa dai un click pe Afiseaza cod...
Poftim
Click aici: | Afiseaza codul
/*/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// -------  | -- > Multumiri < -- | ------------- //////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// ------- | ---> Hades Ownage <--- | ---------- ///////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
/////////////////////////////////// ------- | ---> YONTU <--- | ---------- ////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
*/

#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < fun >
#include < hamsandwich >
#include < fakemeta_util >
#include < message_const >
#include < ColorChat >
#include < fcs >

#pragma tabsize 0

native set_user_pet(id);

#define PLUGIN "[ Ultimate Shop ] Ultimate Furien Shop"
#define VERSION "1.2"
#define AUTHOR "NicutaMM | Cstrike"

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

// -- | Harry Magic Wand | -- //
#define HARRY_WAND_RECOIL 	0.0			// Recoil
#define HARRY_WAND_SPEED 	0.35			// Click stanga
#define HARRY_WAND_SPEED2 	0.75			// Click dreapta
#define HARRY_WAND_FIRE	random_num( 3, 6 )	// Animatie cand trage cu click stanga
#define HARRY_WAND_FIRE2	random_num( 5, 10 )	// Animatie cand trage cu click dreapta

#define TE_BEAMENTPOINT	1
#define TE_EXPLOSION		3
#define TE_SPRITETRAIL		15
#define TE_BEAMCYLINDER		21

// -- | Shop | -- //

new const Prefix[  ] = "^x04[ Ultimate Shop ]^x01";

// == | Super-Knife | == //

new bool:superknife2X [ 33 ];
new bool:superknife3X [ 33 ];

new v_superknife2X [ 66 ] = "models/v_super_knife2X.mdl";
new v_superknife3X [ 66 ] = "models/v_superknife3X.mdl";

// -- | Upgrade | -- //
new bool: Upgrade[ 33 ];

// -- | He Grenade | -- //
new Hegrnd_Countdown [ 33 ];
new Float: LastMessage [ 33 ];

// -- | Take Damage | -- //
new g_iMaxPlayers;

new bool: HaveNoFlash [ 33 ];
new g_msgScreenFade;

// -- | Harry Magic Wand | -- //

new const Tag[  ] = "[Harry Magic Wand]";

new HarryFireSound[  ] = "harry_wand/harry_shoot1.wav";
new HarryHitSound[  ] = "harry_wand/harry_hit.wav";
new HarryHitSound2[  ] = "harry_wand/harry_shoot2.wav";
new HarryModel[  ] = "models/harry_wand/v_harry_wand.mdl";

new HarryBeam, HarryExp, HarryExp2, DeathSprite;

new bool:g_HasHarryWand[ 33 ];

new Harry_Ammo[ 33 ];
new Float:HarryLastShotTime[ 33 ];

new HarryDamageCvar, HarryDamageCvar2, HarryAmmo, HarryKillMoney, HarryDistance;



public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	//Register Shop
	register_clcmd("say /shop", "FurienShop" );
	register_clcmd("say shop", "FurienShop" );
	register_clcmd("say_team /shop", "FurienShop" );
	register_clcmd("say_team shop", "FurienShop" );
	register_clcmd("say /ultimate", "FurienShop" );
	register_clcmd("say_team ultimate", "FurienShop" );
	
	// -- | Harry Magic Wand | -- //
	register_event( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	
	register_forward( FM_CmdStart, "Harry_CmdStart" );
	register_event("DeathMsg", "eDeath", "a")
	
	HarryDamageCvar = register_cvar( "harry_damage", "100.0" );
	HarryDamageCvar2 = register_cvar( "harry_damage2", "150.0" );
	HarryAmmo = register_cvar( "harry_ammo", "200" );
	HarryKillMoney = register_cvar( "harry_money_reward", "5000" );
	HarryDistance = register_cvar( "harry_distance", "90909" );

	register_concmd( "amx_get_harry", "GiveHarry", ADMIN_RCON, "< nume > < ammo >" );
	
	//Register Arme
	register_event ( "CurWeapon", "CurrWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", true );
	
	register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
	
	
	g_iMaxPlayers = get_maxplayers ( 	);
	g_msgScreenFade = get_user_msgid("ScreenFade")
}

public eDeath ( ) {
	
	if ( superknife2X [ read_data ( 2 ) ] || superknife3X [ read_data ( 2 ) ] ) {
		
		superknife2X [ read_data ( 2 ) ] = false;
		superknife3X [ read_data ( 2 ) ] = false;
	}
}

public plugin_precache ( ) {
	
	//Super-Knife
	precache_model ( v_superknife2X );
	precache_model ( v_superknife3X );
	
	// Harry Potter Wand
	precache_sound( HarryFireSound );
	precache_sound( HarryHitSound );
	precache_sound( HarryHitSound2 );

	precache_model( HarryModel );

	HarryBeam = precache_model( "sprites/harry_wand/harry_plasma_beam.spr" );
	HarryExp = precache_model( "sprites/harry_wand/harry_plasma_exp2.spr" );
	HarryExp2 = precache_model( "sprites/harry_wand/harry_plasma_exp3.spr" );
	DeathSprite = precache_model( "sprites/harry_wand/harry_skull.spr" );
}

public client_putinserver( id ) {
		
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}

public client_disconnect( id ) {
	
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}


public Spawn( id ) {
	
	Hegrnd_Countdown [ id ] = 0;
	strip_user_weapons(id)
	give_item(id, "weapon_knife" );
	
	g_HasHarryWand[ id ] = false;
	Upgrade[ id ] = false;
	HaveNoFlash [ id ] = false;
	
}
public CurrWeapon ( id ) {
	
	if ( superknife2X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife2X );
	}
	if ( superknife3X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife3X );
	}
}

public FurienShop ( id ) {
	
	if ( cs_get_user_team(id) == CS_TEAM_T ) {
		
		ShopFurien( id )
	}
	
	if ( cs_get_user_team (id ) == CS_TEAM_CT ) {
		
		ShopAntiFurien ( id )
	}
}

public ShopAntiFurien ( id ) {   
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Anti-Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "AntiFurien")
	menu_additem(menu, "\yPachet HP + AP - \r10 Credite", "1", 0);
	menu_additem(menu, "\yHarry Potter Wand - \r50 Credite", "2", 0);
	menu_additem(menu, "\yDefuse Kit - \r2 Credite", "3", 0);
	menu_additem(menu, "\y50 HP - \r5 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash - \r5 Credite^n", "6", 0);
	menu_additem(menu, "\yPet - \r20 Credite", "7", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public ShopFurien( id ) {    
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "Furien")
	menu_additem(menu, "\ySuperKnife \r[ 2X ]\y - \r5 Credite", "1", 0);
	menu_additem(menu, "\ySuperKnife \r[ 3X ]\y - \r15 Credite", "2", 0 );
	menu_additem(menu, "\yHE Grenade - \r5 Credite", "3", 0 );
	menu_additem(menu, "\y50 HP - \r5 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash \d( Only CT )", "6", 0);
	
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public Furien(id, menu, item) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{  
		
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					superknife2X[ id ] = true;
					superknife3X[ id ] = false;
					g_HasHarryWand[ id ] = false;
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 2x ].", Prefix );
					CurrWeapon( id );
					
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 2:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 15;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "!%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					superknife2X[ id ] = false;
					superknife3X[ id ] = true;
					g_HasHarryWand[ id ] = false;
					CurrWeapon( id );
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 3x ].", Prefix );
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		} 
		
		case 3:
		{
				if(Hegrnd_Countdown[id]) {
					if(LastMessage[id] < get_gametime()) {
						LastMessage[id] = get_gametime() + 1.0;
						set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
						show_hudmessage ( id, "Vei putea cumpara grenada in %d secund%s.",Hegrnd_Countdown[id], Hegrnd_Countdown[id] > 1 ? "e" : "a");
					}
				}
			
				else if ( buyhegrnd ( id ) ) {
				
					Hegrnd_Countdown[id] = 10;
					CountDown_HeGrnd(id);
				}
		}
		
		case 4:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		
	}
	menu_destroy(menu);
	return 1;
}

public AntiFurien(id, menu, item ) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				if( Upgrade[ id ] )
				{
					ColorChat(id, GREEN, "%s Poti upgrada HP si AP doar o data pe runda", Prefix );
				}
				else
				{
					Pack(id);
					Upgrade[ id ] = true;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}  
		case 2:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 50;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					
					get_harry( id )
					
					ColorChat(id, GREEN, "%s Ai cumparat Harry Potter.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 3:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 2;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{ 
					fm_give_item ( id, "item_thighpack" )
					ColorChat(id, GREEN, "%s Ai cumparat Defuse KIT.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 4:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP." );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}
		
		
		case 7:
		{
			set_user_pet(id)	
		}
	}
	menu_destroy(menu);
	return 1;
}

public eventFlash(id)
{
	if(is_user_connected(id) && HaveNoFlash [ id ])
	{
		message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id)
		write_short(1)
		write_short(1)
		write_short(1)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) 
{
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && superknife2X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && superknife3X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 3.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

// -- // -- // ---> | Pack HP & AP | <--- // -- // -- //

public Pack( id ) {
	
	new iCredits = fcs_get_user_credits ( id ) - 10;
	if( iCredits < 0 )
	{
		ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
	return 1;
						
	}
	else
	{ 
		new Armor = get_user_armor ( id );
						
		if ( Armor <= 250 )
		{
			fm_set_user_armor ( id, get_user_armor ( id ) + 300 );
		}
						
		new Health = get_user_health ( id );
						
		if ( Health <= 250 )
		{
			fm_set_user_health( id, get_user_health ( id ) + 300 );
			ColorChat(id, GREEN, "%s Ai cumparat Upgrade la Health & Armor!", Prefix );
		}
						
			fcs_set_user_credits ( id, iCredits );
		return 1;
		}
	
	return 0;
}


// -- | He Grenade | -- //

public CountDown_HeGrnd ( id ) {
	
	if(!is_user_alive(id) || get_user_team ( id ) != 1) {
		Hegrnd_Countdown[id] = 0;
	}
	else if(Hegrnd_Countdown[id] > 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Vei putea cumpara grenada in %d secund%s", Hegrnd_Countdown[id], Hegrnd_Countdown[id] == 1 ? "a" : "e");
		Hegrnd_Countdown[id]--;
		set_task(1.0, "CountDown_HeGrnd", id);
	}
	else if(Hegrnd_Countdown[id] <= 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Acum poti cumpara grenada");
		Hegrnd_Countdown[id] = 0;
	}
	
}
	
bool: buyhegrnd ( id ) {
	
	fm_give_item ( id, "weapon_hegrenade" );
	return true;
}

//////////////////// ------------ || Hanrry Potter Wand || ----------- ///////////////////////////

public GiveHarry( id, level, cid ) {
	
	if( !cmd_access( id, level, cid, 3 ) ) 
		return PLUGIN_HANDLED;
	
	new szTtarget[ 32 ], szAmmoHarry[ 21 ];
	
	read_argv( 1, szTtarget, 31 );
	read_argv( 2, szAmmoHarry, 20 );

	new iPlayer = cmd_target( id, szTtarget, 8 );

	new szAdminName[ 32 ], szPlayerName[ 32 ];

	get_user_name( id, szAdminName, 31 );
	get_user_name( iPlayer, szPlayerName, 31 );

	if( !iPlayer )
		return PLUGIN_HANDLED;

	if( !is_user_alive( iPlayer ) ) {

		client_print( id, print_console, "Jucatorul %s nu este in viata !", szPlayerName );
		return 1;
	}

	if( g_HasHarryWand[ iPlayer ] ) {

		client_print( id, print_console, "Jucatorul %s are deja bagheta !", szPlayerName );
		return 1;
	}

	else {
	
		new AmmoForMagic = str_to_num( szAmmoHarry );

		ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s i-a dat lui^x03 %s^x01 bagheta lui Harry cu^x03 %d ammo^x01 !", Tag, szAdminName, szPlayerName, szAmmoHarry );

		get_harry( iPlayer );
		Harry_Ammo[ iPlayer ] += AmmoForMagic;
	}

	return PLUGIN_CONTINUE;
}

public get_harry( id ) {

	if( is_user_alive( id ) ) {

		superknife2X[ id ] = false;
		superknife3X[ id ] = false;
		g_HasHarryWand[ id ] = true;
		engclient_cmd( id, "weapon_knife" );

		Harry_Ammo[ id ] = get_pcvar_num( HarryAmmo );
	}

	else {

		client_print( id, print_console, "Jucatorul nu este in viata! " );
		g_HasHarryWand[ id ] = false;

		return 1;
	}

	return 1;
}

public CurrentWeapon( id )
	if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] )
		set_pev( id, pev_viewmodel2, HarryModel );



public Harry_CmdStart( id, uc_handle, seed ) {
	
	if( is_user_alive( id ) && g_HasHarryWand[ id ] ) {
		
		static CurButton;
		CurButton = get_uc( uc_handle, UC_Buttons );
		new Float:flNextAttack = get_pdata_float( id, 83, 5 );

		if( CurButton & IN_ATTACK ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] > 0  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire( id );

						if( Harry_Ammo[ id ] > 0 ) {
							
							set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
							show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						}
						
						else if( Harry_Ammo[ id ] <= 0 ) {
							
							set_hudmessage( 255, 0, 0, 0.01, 0.90, 0, 6.0, 1.0 );
							show_hudmessage( id, "No Ammo !" );
							
						}
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0]  = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 1;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}		
		}
		
		else if( CurButton & IN_ATTACK2 ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] >= 5  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED2 ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE2 );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire2( id );

						set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
						show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0 ] = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 3;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK2;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}
		}
	}
	
	else if( is_user_alive ( id ) && !g_HasHarryWand[ id ] )
		return PLUGIN_CONTINUE;

	return PLUGIN_CONTINUE;
}

public Harry_Fire( id ) {
	
	static Victim, Body, EndOrigin[ 3 ], BeamOrigin[ 3 ];
	get_user_origin( id, BeamOrigin, 3 );
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam);		// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 108 ); 		// Red
	write_byte( 236 );			// Green
	write_byte( 23 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp );	// sprite
	write_byte( 10 );		// scale in 0.1's
	write_byte( 15 );		// framerate
	write_byte( 4 );		// flags
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_connected( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );
		
		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {

			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_SHOCK );
			write_coord( 0 );
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 255, 122, 122, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			death_message( id, Victim, 1, "Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}
	
	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public Harry_Fire2( id ) {
	
	static Victim, Body, EndOrigin[3], BeamOrigin[3];
	get_user_origin( id, BeamOrigin, 3 ) ;
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam );	// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 150 ); 		// Red
	write_byte( 22 );			// Green
	write_byte( 235 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp2 );
	write_byte( 10 );
	write_byte( 15 );
	write_byte( 4 );
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_alive( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );

		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_NERVEGAS );
			write_coord( 0 ) ;
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 0, 255, 0, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			death_message( id, Victim, 1, "Double Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}

	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public make_knockback( Victim, Float:origin[ 3 ], Float:maxspeed ) {

	new Float:fVelocity[ 3 ];
	
	kickback( Victim, origin, maxspeed, fVelocity );
	entity_set_vector( Victim, EV_VEC_velocity, fVelocity );
	
	return( 1 );
}

stock ShakeScreen( id, const Float:iSeconds ) {

	message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), { 0, 0, 0 }, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 1<<13 );
	message_end(  );
}

stock FadeScreen( id, const Float:iSeconds, const iRed, const iGreen, const iBlue, const iAlpha ) {
      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( iRed );
	write_byte( iGreen );
	write_byte( iBlue );
	write_byte( iAlpha );
	message_end(  );
}		

stock kickback( ent, Float:fOrigin[ 3 ], Float:fSpeed, Float:fVelocity[ 3 ] ) {

	new Float:fEntOrigin[ 3 ];
	entity_get_vector( ent, EV_VEC_origin, fEntOrigin );
	
	new Float:fDistance[ 3 ];
	fDistance[ 0 ] = fEntOrigin[ 0 ] - fOrigin[ 0 ];
	fDistance[ 1 ] = fEntOrigin[ 1 ] - fOrigin[ 1 ];
	fDistance[ 2 ] = fEntOrigin[ 2 ] - fOrigin[ 2 ];

	new Float:fTime =( vector_distance( fEntOrigin, fOrigin ) / fSpeed );
	fVelocity[ 0 ] = fDistance[ 0 ] / fTime;
	fVelocity[ 1 ] = fDistance[ 1 ] / fTime;
	fVelocity[ 2 ] = fDistance[ 2 ] / fTime;
	
	return( fVelocity[ 0 ] && fVelocity[ 1 ] && fVelocity[ 2 ] );
}

// stock from "m79"
stock death_message( Killer, Victim, ScoreBoard, const Weapon[  ] ) {
	
	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_SET );

	ExecuteHamB( Ham_Killed, Victim, Killer, 2 );

	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_NOT );

	make_deathmsg( Killer, Victim, 0, Weapon );
	cs_set_user_money( Killer, cs_get_user_money( Killer ) + get_pcvar_num( HarryKillMoney ) );
	
	if( ScoreBoard ) {

		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Killer );
		write_short( pev( Killer, pev_frags ) );
		write_short( cs_get_user_deaths( Killer ) );
		write_short( 0 );
		write_short( get_user_team( Killer ) );
		message_end(  );
		
		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Victim );
		write_short( pev( Victim, pev_frags ) );
		write_short( cs_get_user_deaths( Victim ) );
		write_short( 0 );
		write_short( get_user_team( Victim ) );
		message_end(  );
	}
}

stock set_weapon_anim( id, anim ) {

	set_pev( id, pev_weaponanim, anim );

	if( is_user_alive( id ) ) {

		message_begin( MSG_ONE, SVC_WEAPONANIM, _, id );
		write_byte( anim );
		write_byte( pev( id, pev_body ) );
		message_end(  );
	}
}

stock get_damage_body( body, Float:fDamage ) {

	switch( body ) {

		case HIT_HEAD: fDamage *= 4.0;

		case HIT_STOMACH: fDamage *= 1.1;

		case HIT_CHEST: fDamage *= 1.5;

		case HIT_LEFTARM: fDamage *= 0.77;

		case HIT_RIGHTARM: fDamage *= 0.77;

		case HIT_LEFTLEG: fDamage *= 0.75;

		case HIT_RIGHTLEG: fDamage *= 0.75;

		default: fDamage *= 1.0;
	}
	
	return floatround( fDamage );
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
Filip.
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 1001
Joined: 16 Oct 2013, 22:17
Detinator Steam: Nu
Reputatie: Restrictie moderator
Nume anterior: andre.w
Location: lasa
Has thanked: 60 times
Been thanked: 27 times
Contact:

30 Jan 2014, 21:42

mil faci si mie pe points? X_x
Daca vrei sa faci profit case opening
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2777
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 224 times
Been thanked: 127 times
Contact:

31 Jan 2014, 09:04

public FurienShop ( id ) {
if ( cs_get_user_team(id) ==
CS_TEAM_T ) {
ShopFurien( id )
}
if ( cs_get_user_team (id ) ==
CS_TEAM_CT ) {
ShopAntiFurien ( id )
}
}
--->>
public FurienShop ( id ) {
if (is_user_alive(id)) {
if ( cs_get_user_team(id) ==
CS_TEAM_T )
ShopFurien( id )i
if ( cs_get_user_team (id ) ==
CS_TEAM_CT )
ShopAntiFurien ( id )
}
}
else
ColorChat(id, "Nu poti accesa meniul cand esti mort");
1. Puteai verifica daca playerul este in viata.
2. Nu isi au rostul acele {} la if (cs_get_user_team(id) == CS_TEAM_ECHIPA)
ShopEchipa
- pune fara... Nu incurca cu nimic, dar pentru aspect. :))
In rest ai un 10 + pentru creeare si postare. Multa lume cauta asa ceva. GJ!
La mai multe! ;)
Contact: Activitate scazuta.
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

31 Jan 2014, 10:56

Multumesc ! apreciez :) O sa revin cu alte pluginuri care nu se gasesc free :P
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
vladu888
Membru, skill +1
Membru, skill +1
Posts: 272
Joined: 29 Jun 2013, 08:54
Detinator Steam: Nu
CS Status: Joc Furien.
Location: Fagaras,Brasov
Has thanked: 46 times
Been thanked: 13 times
Contact:

31 Jan 2014, 16:06

vezi ca si eu l-am testat pe cel alui aragon si nu ia credite decat cand ei petu poate vedeti restu daca si voua va face asa.
Image
User avatar
codrutzz
Membru, skill +2
Membru, skill +2
Posts: 539
Joined: 29 Jan 2014, 18:27
Detinator Steam: Da
CS Status: Nu citesc forumu xtreamCS* =]]]
Detinator server CS: In curand
SteamID: Personal
Location: Iasi<3
Has thanked: 68 times
Been thanked: 9 times
Contact:

31 Jan 2014, 16:49

Asa si mie,pe creditele lui aragon numai la pet ia credite , la ashkanar merge super.
User avatar
Chris Duskblade
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 2801
Joined: 18 Jun 2013, 15:46
Detinator Steam: Da
Reputatie: Fost super moderator
Nume anterior: Cristinel.
Utilizator neserios (tepar)
Location: Timișoara
Has thanked: 62 times
Been thanked: 15 times
Contact:

02 Feb 2014, 17:55

Nicutimm , imi dai si mie .sma de la furienshop dar cu knife care sa tina cat mori .
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

02 Feb 2014, 18:43

Poftim :
SMA Pe baza Systemului de credite al lui Askh | Afiseaza codul
/*/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// -------  | -- > Multumiri < -- | ------------- //////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// ------- | ---> Hades Ownage <--- | ---------- ///////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
/////////////////////////////////// ------- | ---> YONTU <--- | ---------- ////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
*/

#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < fun >
#include < hamsandwich >
#include < fakemeta_util >
#include < message_const >
#include < ColorChat >
#include < fcs >

#pragma tabsize 0

native set_user_pet(id);

#define PLUGIN "[ Ultimate Shop ] Ultimate Furien Shop"
#define VERSION "1.2"
#define AUTHOR "NicutaMM | Cstrike"

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

// -- | Harry Magic Wand | -- //
#define HARRY_WAND_RECOIL 	0.0			// Recoil
#define HARRY_WAND_SPEED 	0.35			// Click stanga
#define HARRY_WAND_SPEED2 	0.75			// Click dreapta
#define HARRY_WAND_FIRE	random_num( 3, 6 )	// Animatie cand trage cu click stanga
#define HARRY_WAND_FIRE2	random_num( 5, 10 )	// Animatie cand trage cu click dreapta

#define TE_BEAMENTPOINT	1
#define TE_EXPLOSION		3
#define TE_SPRITETRAIL		15
#define TE_BEAMCYLINDER		21

// -- | Shop | -- //

new const Prefix[  ] = "^x04[ Ultimate Shop ]^x01";

// == | Super-Knife | == //

new bool:superknife2X [ 33 ];
new bool:superknife3X [ 33 ];

new v_superknife2X [ 66 ] = "models/v_super_knife2X.mdl";
new v_superknife3X [ 66 ] = "models/v_superknife3X.mdl";

// -- | Upgrade | -- //
new bool: Upgrade[ 33 ];

// -- | He Grenade | -- //
new Hegrnd_Countdown [ 33 ];
new Float: LastMessage [ 33 ];

// -- | Take Damage | -- //
new g_iMaxPlayers;

new bool: HaveNoFlash [ 33 ];
new g_msgScreenFade;

// -- | Harry Magic Wand | -- //

new const Tag[  ] = "[Harry Magic Wand]";

new HarryFireSound[  ] = "harry_wand/harry_shoot1.wav";
new HarryHitSound[  ] = "harry_wand/harry_hit.wav";
new HarryHitSound2[  ] = "harry_wand/harry_shoot2.wav";
new HarryModel[  ] = "models/harry_wand/v_harry_wand.mdl";

new HarryBeam, HarryExp, HarryExp2, DeathSprite;

new bool:g_HasHarryWand[ 33 ];

new Harry_Ammo[ 33 ];
new Float:HarryLastShotTime[ 33 ];

new HarryDamageCvar, HarryDamageCvar2, HarryAmmo, HarryKillMoney, HarryDistance;



public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	//Register Shop
	register_clcmd("say /shop", "FurienShop" );
	register_clcmd("say shop", "FurienShop" );
	register_clcmd("say_team /shop", "FurienShop" );
	register_clcmd("say_team shop", "FurienShop" );
	register_clcmd("say /ultimate", "FurienShop" );
	register_clcmd("say_team ultimate", "FurienShop" );
	
	// -- | Harry Magic Wand | -- //
	register_event( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	
	register_forward( FM_CmdStart, "Harry_CmdStart" );
	register_event("DeathMsg", "eDeath", "a")
	
	HarryDamageCvar = register_cvar( "harry_damage", "100.0" );
	HarryDamageCvar2 = register_cvar( "harry_damage2", "150.0" );
	HarryAmmo = register_cvar( "harry_ammo", "200" );
	HarryKillMoney = register_cvar( "harry_money_reward", "5000" );
	HarryDistance = register_cvar( "harry_distance", "90909" );

	register_concmd( "amx_get_harry", "GiveHarry", ADMIN_RCON, "< nume > < ammo >" );
	
	//Register Arme
	register_event ( "CurWeapon", "CurrWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", true );
	
	register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
	
	
	g_iMaxPlayers = get_maxplayers ( 	);
	g_msgScreenFade = get_user_msgid("ScreenFade")
}

public eDeath ( ) {
	
	if ( superknife2X [ read_data ( 2 ) ] || superknife3X [ read_data ( 2 ) ] ) {
		
		superknife2X [ read_data ( 2 ) ] = false;
		superknife3X [ read_data ( 2 ) ] = false;
	}
}

public plugin_precache ( ) {
	
	//Super-Knife
	precache_model ( v_superknife2X );
	precache_model ( v_superknife3X );
	
	// Harry Potter Wand
	precache_sound( HarryFireSound );
	precache_sound( HarryHitSound );
	precache_sound( HarryHitSound2 );

	precache_model( HarryModel );

	HarryBeam = precache_model( "sprites/harry_wand/harry_plasma_beam.spr" );
	HarryExp = precache_model( "sprites/harry_wand/harry_plasma_exp2.spr" );
	HarryExp2 = precache_model( "sprites/harry_wand/harry_plasma_exp3.spr" );
	DeathSprite = precache_model( "sprites/harry_wand/harry_skull.spr" );
}

public client_putinserver( id ) {
		
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}

public client_disconnect( id ) {
	
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}


public Spawn( id ) {
	
	Hegrnd_Countdown [ id ] = 0;
	strip_user_weapons(id)
	give_item(id, "weapon_knife" );
	
	g_HasHarryWand[ id ] = false;
	Upgrade[ id ] = false;
	HaveNoFlash [ id ] = false;
	
}
public CurrWeapon ( id ) {
	
	if ( superknife2X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife2X );
	}
	if ( superknife3X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife3X );
	}
}

public FurienShop ( id ) {
	
	if ( cs_get_user_team(id) == CS_TEAM_T ) {
		
		ShopFurien( id )
	}
	
	if ( cs_get_user_team (id ) == CS_TEAM_CT ) {
		
		ShopAntiFurien ( id )
	}
}

public ShopAntiFurien ( id ) {   
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Anti-Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "AntiFurien")
	menu_additem(menu, "\yPachet HP + AP - \r10 Credite", "1", 0);
	menu_additem(menu, "\yHarry Potter Wand - \r50 Credite", "2", 0);
	menu_additem(menu, "\yDefuse Kit - \r2 Credite", "3", 0);
	menu_additem(menu, "\y50 HP - \r5 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash - \r5 Credite^n", "6", 0);
	menu_additem(menu, "\yPet - \r20 Credite", "7", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public ShopFurien( id ) {    
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "Furien")
	menu_additem(menu, "\ySuperKnife \r[ 2X ]\y - \r5 Credite", "1", 0);
	menu_additem(menu, "\ySuperKnife \r[ 3X ]\y - \r15 Credite", "2", 0 );
	menu_additem(menu, "\yHE Grenade - \r5 Credite", "3", 0 );
	menu_additem(menu, "\y50 HP - \r5 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash \d( Only CT )", "6", 0);
	
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public Furien(id, menu, item) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{  
		
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					superknife2X[ id ] = true;
					superknife3X[ id ] = false;
					g_HasHarryWand[ id ] = false;
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 2x ].", Prefix );
					CurrWeapon( id );
					
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 2:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 15;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "!%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					superknife2X[ id ] = false;
					superknife3X[ id ] = true;
					g_HasHarryWand[ id ] = false;
					CurrWeapon( id );
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 3x ].", Prefix );
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		} 
		
		case 3:
		{
				if(Hegrnd_Countdown[id]) {
					if(LastMessage[id] < get_gametime()) {
						LastMessage[id] = get_gametime() + 1.0;
						set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
						show_hudmessage ( id, "Vei putea cumpara grenada in %d secund%s.",Hegrnd_Countdown[id], Hegrnd_Countdown[id] > 1 ? "e" : "a");
					}
				}
			
				else if ( buyhegrnd ( id ) ) {
				
					Hegrnd_Countdown[id] = 10;
					CountDown_HeGrnd(id);
				}
		}
		
		case 4:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		
	}
	menu_destroy(menu);
	return 1;
}

public AntiFurien(id, menu, item ) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				if( Upgrade[ id ] )
				{
					ColorChat(id, GREEN, "%s Poti upgrada HP si AP doar o data pe runda", Prefix );
				}
				else
				{
					Pack(id);
					Upgrade[ id ] = true;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}  
		case 2:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 50;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					
					get_harry( id )
					
					ColorChat(id, GREEN, "%s Ai cumparat Harry Potter.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 3:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 2;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{ 
					fm_give_item ( id, "item_thighpack" )
					ColorChat(id, GREEN, "%s Ai cumparat Defuse KIT.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 4:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP." );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}
		
		
		case 7:
		{
			set_user_pet(id)	
		}
	}
	menu_destroy(menu);
	return 1;
}

public eventFlash(id)
{
	if(is_user_connected(id) && HaveNoFlash [ id ])
	{
		message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id)
		write_short(1)
		write_short(1)
		write_short(1)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) 
{
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && superknife2X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && superknife3X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 3.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

// -- // -- // ---> | Pack HP & AP | <--- // -- // -- //

public Pack( id ) {
	
	new iCredits = fcs_get_user_credits ( id ) - 10;
	if( iCredits < 0 )
	{
		ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
	return 1;
						
	}
	else
	{ 
		new Armor = get_user_armor ( id );
						
		if ( Armor <= 250 )
		{
			fm_set_user_armor ( id, get_user_armor ( id ) + 300 );
		}
						
		new Health = get_user_health ( id );
						
		if ( Health <= 250 )
		{
			fm_set_user_health( id, get_user_health ( id ) + 300 );
			ColorChat(id, GREEN, "%s Ai cumparat Upgrade la Health & Armor!", Prefix );
		}
						
			fcs_set_user_credits ( id, iCredits );
		return 1;
		}
	
	return 0;
}


// -- | He Grenade | -- //

public CountDown_HeGrnd ( id ) {
	
	if(!is_user_alive(id) || get_user_team ( id ) != 1) {
		Hegrnd_Countdown[id] = 0;
	}
	else if(Hegrnd_Countdown[id] > 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Vei putea cumpara grenada in %d secund%s", Hegrnd_Countdown[id], Hegrnd_Countdown[id] == 1 ? "a" : "e");
		Hegrnd_Countdown[id]--;
		set_task(1.0, "CountDown_HeGrnd", id);
	}
	else if(Hegrnd_Countdown[id] <= 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Acum poti cumpara grenada");
		Hegrnd_Countdown[id] = 0;
	}
	
}
	
bool: buyhegrnd ( id ) {
	
	fm_give_item ( id, "weapon_hegrenade" );
	return true;
}

//////////////////// ------------ || Hanrry Potter Wand || ----------- ///////////////////////////

public GiveHarry( id, level, cid ) {
	
	if( !cmd_access( id, level, cid, 3 ) ) 
		return PLUGIN_HANDLED;
	
	new szTtarget[ 32 ], szAmmoHarry[ 21 ];
	
	read_argv( 1, szTtarget, 31 );
	read_argv( 2, szAmmoHarry, 20 );

	new iPlayer = cmd_target( id, szTtarget, 8 );

	new szAdminName[ 32 ], szPlayerName[ 32 ];

	get_user_name( id, szAdminName, 31 );
	get_user_name( iPlayer, szPlayerName, 31 );

	if( !iPlayer )
		return PLUGIN_HANDLED;

	if( !is_user_alive( iPlayer ) ) {

		client_print( id, print_console, "Jucatorul %s nu este in viata !", szPlayerName );
		return 1;
	}

	if( g_HasHarryWand[ iPlayer ] ) {

		client_print( id, print_console, "Jucatorul %s are deja bagheta !", szPlayerName );
		return 1;
	}

	else {
	
		new AmmoForMagic = str_to_num( szAmmoHarry );

		ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s i-a dat lui^x03 %s^x01 bagheta lui Harry cu^x03 %d ammo^x01 !", Tag, szAdminName, szPlayerName, szAmmoHarry );

		get_harry( iPlayer );
		Harry_Ammo[ iPlayer ] += AmmoForMagic;
	}

	return PLUGIN_CONTINUE;
}

public get_harry( id ) {

	if( is_user_alive( id ) ) {

		superknife2X[ id ] = false;
		superknife3X[ id ] = false;
		g_HasHarryWand[ id ] = true;
		engclient_cmd( id, "weapon_knife" );

		Harry_Ammo[ id ] = get_pcvar_num( HarryAmmo );
	}

	else {

		client_print( id, print_console, "Jucatorul nu este in viata! " );
		g_HasHarryWand[ id ] = false;

		return 1;
	}

	return 1;
}

public CurrentWeapon( id )
	if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] )
		set_pev( id, pev_viewmodel2, HarryModel );



public Harry_CmdStart( id, uc_handle, seed ) {
	
	if( is_user_alive( id ) && g_HasHarryWand[ id ] ) {
		
		static CurButton;
		CurButton = get_uc( uc_handle, UC_Buttons );
		new Float:flNextAttack = get_pdata_float( id, 83, 5 );

		if( CurButton & IN_ATTACK ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] > 0  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire( id );

						if( Harry_Ammo[ id ] > 0 ) {
							
							set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
							show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						}
						
						else if( Harry_Ammo[ id ] <= 0 ) {
							
							set_hudmessage( 255, 0, 0, 0.01, 0.90, 0, 6.0, 1.0 );
							show_hudmessage( id, "No Ammo !" );
							
						}
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0]  = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 1;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}		
		}
		
		else if( CurButton & IN_ATTACK2 ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] >= 5  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED2 ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE2 );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire2( id );

						set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
						show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0 ] = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 3;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK2;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}
		}
	}
	
	else if( is_user_alive ( id ) && !g_HasHarryWand[ id ] )
		return PLUGIN_CONTINUE;

	return PLUGIN_CONTINUE;
}

public Harry_Fire( id ) {
	
	static Victim, Body, EndOrigin[ 3 ], BeamOrigin[ 3 ];
	get_user_origin( id, BeamOrigin, 3 );
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam);		// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 108 ); 		// Red
	write_byte( 236 );			// Green
	write_byte( 23 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp );	// sprite
	write_byte( 10 );		// scale in 0.1's
	write_byte( 15 );		// framerate
	write_byte( 4 );		// flags
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_connected( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );
		
		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {

			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_SHOCK );
			write_coord( 0 );
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 255, 122, 122, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			death_message( id, Victim, 1, "Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}
	
	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public Harry_Fire2( id ) {
	
	static Victim, Body, EndOrigin[3], BeamOrigin[3];
	get_user_origin( id, BeamOrigin, 3 ) ;
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam );	// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 150 ); 		// Red
	write_byte( 22 );			// Green
	write_byte( 235 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp2 );
	write_byte( 10 );
	write_byte( 15 );
	write_byte( 4 );
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_alive( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );

		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_NERVEGAS );
			write_coord( 0 ) ;
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 0, 255, 0, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			death_message( id, Victim, 1, "Double Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}

	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public make_knockback( Victim, Float:origin[ 3 ], Float:maxspeed ) {

	new Float:fVelocity[ 3 ];
	
	kickback( Victim, origin, maxspeed, fVelocity );
	entity_set_vector( Victim, EV_VEC_velocity, fVelocity );
	
	return( 1 );
}

stock ShakeScreen( id, const Float:iSeconds ) {

	message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), { 0, 0, 0 }, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 1<<13 );
	message_end(  );
}

stock FadeScreen( id, const Float:iSeconds, const iRed, const iGreen, const iBlue, const iAlpha ) {
      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( iRed );
	write_byte( iGreen );
	write_byte( iBlue );
	write_byte( iAlpha );
	message_end(  );
}		

stock kickback( ent, Float:fOrigin[ 3 ], Float:fSpeed, Float:fVelocity[ 3 ] ) {

	new Float:fEntOrigin[ 3 ];
	entity_get_vector( ent, EV_VEC_origin, fEntOrigin );
	
	new Float:fDistance[ 3 ];
	fDistance[ 0 ] = fEntOrigin[ 0 ] - fOrigin[ 0 ];
	fDistance[ 1 ] = fEntOrigin[ 1 ] - fOrigin[ 1 ];
	fDistance[ 2 ] = fEntOrigin[ 2 ] - fOrigin[ 2 ];

	new Float:fTime =( vector_distance( fEntOrigin, fOrigin ) / fSpeed );
	fVelocity[ 0 ] = fDistance[ 0 ] / fTime;
	fVelocity[ 1 ] = fDistance[ 1 ] / fTime;
	fVelocity[ 2 ] = fDistance[ 2 ] / fTime;
	
	return( fVelocity[ 0 ] && fVelocity[ 1 ] && fVelocity[ 2 ] );
}

// stock from "m79"
stock death_message( Killer, Victim, ScoreBoard, const Weapon[  ] ) {
	
	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_SET );

	ExecuteHamB( Ham_Killed, Victim, Killer, 2 );

	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_NOT );

	make_deathmsg( Killer, Victim, 0, Weapon );
	cs_set_user_money( Killer, cs_get_user_money( Killer ) + get_pcvar_num( HarryKillMoney ) );
	
	if( ScoreBoard ) {

		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Killer );
		write_short( pev( Killer, pev_frags ) );
		write_short( cs_get_user_deaths( Killer ) );
		write_short( 0 );
		write_short( get_user_team( Killer ) );
		message_end(  );
		
		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Victim );
		write_short( pev( Victim, pev_frags ) );
		write_short( cs_get_user_deaths( Victim ) );
		write_short( 0 );
		write_short( get_user_team( Victim ) );
		message_end(  );
	}
}

stock set_weapon_anim( id, anim ) {

	set_pev( id, pev_weaponanim, anim );

	if( is_user_alive( id ) ) {

		message_begin( MSG_ONE, SVC_WEAPONANIM, _, id );
		write_byte( anim );
		write_byte( pev( id, pev_body ) );
		message_end(  );
	}
}

stock get_damage_body( body, Float:fDamage ) {

	switch( body ) {

		case HIT_HEAD: fDamage *= 4.0;

		case HIT_STOMACH: fDamage *= 1.1;

		case HIT_CHEST: fDamage *= 1.5;

		case HIT_LEFTARM: fDamage *= 0.77;

		case HIT_RIGHTARM: fDamage *= 0.77;

		case HIT_LEFTLEG: fDamage *= 0.75;

		case HIT_RIGHTLEG: fDamage *= 0.75;

		default: fDamage *= 1.0;
	}
	
	return floatround( fDamage );
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
Chris Duskblade
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 2801
Joined: 18 Jun 2013, 15:46
Detinator Steam: Da
Reputatie: Fost super moderator
Nume anterior: Cristinel.
Utilizator neserios (tepar)
Location: Timișoara
Has thanked: 62 times
Been thanked: 15 times
Contact:

02 Feb 2014, 23:45

O sa incerc sa vad daca merge , daca merge ai thx .
@EDIT: Nu il pot compila , help cineva ? aveti aici pluginu modificat de mine cu alte preturi :
http://www63.zippyshare.com/v/88716090/file.html
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times
Contact:

03 Feb 2014, 10:35

Poftim :
Pet | Afiseaza codul
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fcs>


#define PLUGIN "Furien: Bat"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
 
#define fm_precache_model(%1)           engfunc(EngFunc_PrecacheModel,%1)
#define fm_precache_sound(%1)           engfunc(EngFunc_PrecacheSound,%1)
#define fm_remove_entity(%1)            engfunc(EngFunc_RemoveEntity, %1)
#define fm_drop_to_floor(%1)            engfunc(EngFunc_DropToFloor,%1)
#define fm_find_ent_by_class(%1,%2)     engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define fm_set_user_gravity(%1,%2)      set_pev(%1,pev_gravity,%2)
 
#define PET_FLAG                        pev_flTimeStepSound
#define PET_KILLED                      389
 
static const pet_model[] = "models/stukabat.mdl"
static const pet_sounds[][] = { "bullchicken/bc_die1.wav", "bullchicken/bc_die2.wav", "bullchicken/bc_die3.wav", "bullchicken/bc_idle1.wav", "bullchicken/bc_pain3.wav" }
static const pet_idle = 13
static const pet_run = 13
static const pet_die = 5
static const Float:pet_idle_speed = 0.3
static const Float:pet_run_speed = 10.0
static const Float:player_gravity = 0.65
 
new item_pet[33]
new item_have[33]
new item_at_spawn[33]
new Float:item_leaptime[33]
new bool:g_has_speed[33]
 
new maxplayers, g_msgSayText
 
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        register_event("DeathMsg","DeathMsg","a")
        register_event("HLTV","HLTV", "a","1=0", "2=0")
       
        register_forward(FM_Think,"FM_Think_hook")
        register_forward(FM_PlayerPreThink, "FM_PlayerPreThink_hook")
       
        RegisterHam(Ham_Spawn, "player", "player_spawn", 1)    
        //RegisterHam(Ham_Touch, "info_target", "player_touch")
       
        register_clcmd("say /pet", "buypet")
        register_clcmd("say_team /pet", "buypet")
       
        maxplayers = get_maxplayers()
        g_msgSayText = get_user_msgid("SayText")
}
 
public plugin_natives()
        register_native("set_user_pet", "native_set_pet", 1)
       
public native_set_pet(id)
        buypet(id)
 
public plugin_precache()
{
        new i = 0
       
        for(i = 0; i < sizeof pet_sounds; i++)
                fm_precache_sound(pet_sounds)
       
        fm_precache_model(pet_model)
}
 
public HLTV()
{
        new entid = -1
        while((entid = fm_find_ent_by_class(entid, "zp_bat")))
        {
                if(pev(entid,PET_FLAG) == PET_KILLED)
                {
                        fm_remove_entity(entid)
                }              
        }      
}
 
public DeathMsg()
{
        new id = read_data(2)
       
        if(item_have[id])
        {
                kill_pet(id)
                item_have[id] = 0
        }
               
        if(cs_get_user_team(id) == CS_TEAM_T)
                item_have[id] = 0
       
        if(g_has_speed[id])
                g_has_speed[id] = false
}
 
public buypet(id)
{
        if (!is_user_alive(id))
        {
                client_printcolor(id, "^4[Ultimate Shop]^1 Nu poti cumpara pet cand esti mort.");
                return PLUGIN_HANDLED;
        }
 
        if (cs_get_user_team(id) != CS_TEAM_CT)
        {
                client_printcolor(id, "^4[Ultimate Shop]^1 Numai^3 Anti-furienii^1 pot cumpara pet.");
                return PLUGIN_HANDLED;
        }
       
        if (!item_have[id])
        {      
                if (fcs_get_user_credits(id) >= 100)
                {
                        fcs_set_user_credits(id, fcs_get_user_credits(id) - 100);
                        client_printcolor(id, "^4[Ultimate Shop]^1 Ai cumparat^3 PET.");
                        create_pet(id)
                }else
                        client_printcolor(id, "^4[Ultimate Shop]^1 Nu ai destule^3 credite.");
        }else
                        client_printcolor(id, "^4[Ultimate Shop]^1 Detii deja un pet!");
               
        return PLUGIN_CONTINUE;
}
 
public kill_pet(id)
{
        if(pev_valid(item_pet[id]))
        {
                set_pev(item_pet[id],pev_sequence,pet_die)
                set_pev(item_pet[id],pev_gaitsequence,pet_die)
                set_pev(item_pet[id],pev_framerate,1.0)
               
                set_pev(item_pet[id],PET_FLAG,PET_KILLED)
               
                fm_drop_to_floor(item_pet[id])
               
                item_have[id] = 0
                g_has_speed[id] = false
        }      
        item_pet[id] = 0
}
 
public player_spawn(player)
{
        if(is_user_alive(player))
        {
                if (cs_get_user_team(player) != CS_TEAM_CT)
                {
                        kill_pet(player)
                        item_have[player] = 0
                }
                if(item_have[player])
                {
                        fm_set_user_gravity(player, player_gravity)
                        set_user_health(player, get_user_health(player) + 250)
                        set_user_armor(player, get_user_armor(player) + 350)
                        g_has_speed[player] = true
                }
                else if(item_at_spawn[player])
                {
                        create_pet(player)
                        item_at_spawn[player] = 0
                        g_has_speed[player] = true
                }
        }
}
 
public create_pet(id)
{
        if(item_have[id])
        {
                client_printcolor(id, "^4[Ultimate Shop]^1 Detii deja un^3 pet.")
                return PLUGIN_HANDLED
        }
        else if(!is_user_alive(id))
        {
                client_printcolor(id, "^4[Ultimate Shop]^1 Petul iti va aparea runda viitoare.")
                item_at_spawn[id] = 1
                return PLUGIN_HANDLED
        }      
        else
        {
                item_pet[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"))
                set_pev(item_pet[id],pev_classname,"zp_bat")
               
                engfunc(EngFunc_SetModel,item_pet[id],pet_model)
               
                new Float:origin[3]
                pev(id,pev_origin,origin)                      
               
                set_pev(item_pet[id],pev_origin,origin)
                set_pev(item_pet[id],pev_solid,SOLID_TRIGGER)
                set_pev(item_pet[id],pev_movetype,MOVETYPE_FLY)
                set_pev(item_pet[id],pev_owner,33)
                set_pev(item_pet[id],pev_nextthink,1.0)
                set_pev(item_pet[id],pev_sequence,0)
                set_pev(item_pet[id],pev_gaitsequence,0)
                set_pev(item_pet[id],pev_framerate,1.0)
               
                set_pev(item_pet[id], pev_renderfx, kRenderFxGlowShell)
                set_pev(item_pet[id], pev_rendercolor, Float:{0.0, 0.0, 200.0})
               
                fm_set_user_gravity(id,player_gravity)
               
                set_user_health(id, get_user_health(id) + 250)
                set_user_armor(id, get_user_armor(id) + 350)
               
                engfunc(EngFunc_EmitSound,item_pet[id],CHAN_AUTO,pet_sounds[random_num(0,sizeof pet_sounds - 1)],1.0, 1.2, 0, PITCH_NORM)              
               
                item_have[id] = 1
                g_has_speed[id] = true
        }
        return PLUGIN_HANDLED
}
 
public FM_Think_hook(ent)
{
        for(new i = 0; i <= maxplayers; i++)
        {
                if(ent == item_pet)
                {
                        static Float:origin[3]
                        static Float:origin2[3]
                        static Float:velocity[3]
                        pev(ent,pev_origin,origin2)
                        get_offset_origin_body(i,Float:{50.0,0.0,0.0},origin)
                       
                        if(get_distance_f(origin,origin2) > 300.0)
                        {
                                set_pev(ent,pev_origin,origin)
                        }
                       
                        else if(get_distance_f(origin,origin2) > 80.0)
                        {
                                get_speed_vector(origin2,origin,250.0,velocity)
                                set_pev(ent,pev_velocity,velocity)
                                if(pev(ent,pev_sequence) != pet_run || pev(ent,pev_framerate) != pet_run_speed)
                                {
                                        set_pev(ent,pev_sequence,pet_run)
                                        set_pev(ent,pev_gaitsequence,pet_run)
                                        set_pev(ent,pev_framerate,pet_run_speed)
                                }
                        }
                       
                        else if(get_distance_f(origin,origin2) < 75.0)
                        {
                                if(pev(ent,pev_sequence) != pet_idle || pev(ent,pev_framerate) != pet_idle_speed)
                                {
                                        set_pev(ent,pev_sequence,pet_idle)
                                        set_pev(ent,pev_gaitsequence,pet_idle)
                                        set_pev(ent,pev_framerate,pet_idle_speed)
                                }
                                set_pev(ent,pev_velocity,Float:{0.0,0.0,0.0})
                        }
                        pev(i,pev_origin,origin)
                        origin[2] = origin2[2]
                        entity_set_aim(ent,origin)                     
                        set_pev(ent,pev_nextthink,1.0)
                        break
                }
        }
}
 
public FM_PlayerPreThink_hook(id)
{
        if (!is_user_alive(id))
                return
       
        if(allowed_leap(id))
        {
                static Float:velocity[3]
                velocity_by_aim(id, 500, velocity)
               
                velocity[2] = 300.0
               
                set_pev(id, pev_velocity, velocity)
               
                item_leaptime[id] = get_gametime()
        }
}
 
public allowed_leap(id)
{      
        if(!item_have[id])
                return false
       
        if (!(pev(id, pev_flags) & FL_ONGROUND) || fm_get_speed(id) < 80)
                return false
       
        static buttons
        buttons = pev(id, pev_button)
       
        if (!is_user_bot(id) && (!(buttons & IN_JUMP) || !(buttons & IN_DUCK)))
                return false
       
        if (get_gametime() - item_leaptime[id] < 3)
                return false
       
        return true
}
 
public is_a_player(ent)
{
        if(ent > 0 && ent < 33)
                return true
       
        return false
}
 
public remove_pet(ent)
{
        if(pev_valid(ent))
                fm_remove_entity(ent)
}
 
// Get entity's speed (from fakemeta_util)
stock fm_get_speed(entity)
{
        static Float:velocity[3]
        pev(entity, pev_velocity, velocity)
       
        return floatround(vector_length(velocity));
}
stock get_offset_origin_body(ent,const Float:offset[3],Float:origin[3])
{
        if(!pev_valid(ent))
                return 0;
       
        new Float:angle[3]
        pev(ent,pev_angles,angle)
       
        pev(ent,pev_origin,origin)
       
        origin[0] += floatcos(angle[1],degrees) * offset[0]
        origin[1] += floatsin(angle[1],degrees) * offset[0]
       
        origin[1] += floatcos(angle[1],degrees) * offset[1]
        origin[0] += floatsin(angle[1],degrees) * offset[1]
       
        return 1;
}
 
stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
        new_velocity[0] = origin2[0] - origin1[0]
        new_velocity[1] = origin2[1] - origin1[1]
        new_velocity[2] = origin2[2] - origin1[2]
        new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
        new_velocity[0] *= num
        new_velocity[1] *= num
        new_velocity[2] *= num
       
        return 1;
}
 
stock entity_set_aim(ent,const Float:origin2[3],bone=0)
{
        if(!pev_valid(ent))
                return 0;
       
        static Float:origin[3]
        origin[0] = origin2[0]
        origin[1] = origin2[1]
        origin[2] = origin2[2]
       
        static Float:ent_origin[3], Float:angles[3]
       
        if(bone)
                engfunc(EngFunc_GetBonePosition,ent,bone,ent_origin,angles)
        else
                pev(ent,pev_origin,ent_origin)
       
        origin[0] -= ent_origin[0]
        origin[1] -= ent_origin[1]
        origin[2] -= ent_origin[2]
       
        static Float:v_length
        v_length = vector_length(origin)
       
        static Float:aim_vector[3]
        aim_vector[0] = origin[0] / v_length
        aim_vector[1] = origin[1] / v_length
        aim_vector[2] = origin[2] / v_length
       
        static Float:new_angles[3]
        vector_to_angle(aim_vector,new_angles)
       
        new_angles[0] *= -1
       
        if(new_angles[1]>180.0) new_angles[1] -= 360
        if(new_angles[1]<-180.0) new_angles[1] += 360
        if(new_angles[1]==180.0 || new_angles[1]==-180.0) new_angles[1]=-179.999999
       
        set_pev(ent,pev_angles,new_angles)
        set_pev(ent,pev_fixangle,1)
       
        return 1;
}
 
stock client_printcolor(id, const input[], any:...)
{
        static iPlayersNum[32], iCount; iCount = 1
        static szMsg[191]
       
        vformat(szMsg, charsmax(szMsg), input, 3)
       
        replace_all(szMsg, 190, "/g", "^4") // green txt
        replace_all(szMsg, 190, "/y", "^1") // orange txt
        replace_all(szMsg, 190, "/ctr", "^3") // team txt
        replace_all(szMsg, 190, "/w", "^0") // team txt
       
        if(id) iPlayersNum[0] = id
        else get_players(iPlayersNum, iCount, "ch")
               
        for (new i = 0; i < iCount; i++)
        {
                if (is_user_connected(iPlayersNum))
                {
                        message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayersNum)
                        write_byte(iPlayersNum)
                        write_string(szMsg)
                        message_end()
                }
        }
}

Shop | Afiseaza codul
/*/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// -------  | -- > Multumiri < -- | ------------- //////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////// ------- | ---> Hades Ownage <--- | ---------- ///////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////                                                /////////////////////
/////////////////////////////////// ------- | ---> YONTU <--- | ---------- ////////////////////////
/////////////////////////////                                                /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
*/

#include < amxmodx >
#include < amxmisc>
#include < engine >
#include < cstrike >
#include < fun >
#include < hamsandwich >
#include < fakemeta_util >
#include < message_const >
#include < ColorChat >
#include < fcs >

#pragma tabsize 0

native set_user_pet(id);

#define PLUGIN "[ Ultimate Shop ] Ultimate Furien Shop"
#define VERSION "1.2"
#define AUTHOR "NicutaMM | Cstrike"

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

// -- | Harry Magic Wand | -- //
#define HARRY_WAND_RECOIL 	0.0			// Recoil
#define HARRY_WAND_SPEED 	0.35			// Click stanga
#define HARRY_WAND_SPEED2 	0.75			// Click dreapta
#define HARRY_WAND_FIRE	random_num( 3, 6 )	// Animatie cand trage cu click stanga
#define HARRY_WAND_FIRE2	random_num( 5, 10 )	// Animatie cand trage cu click dreapta

#define TE_BEAMENTPOINT	1
#define TE_EXPLOSION		3
#define TE_SPRITETRAIL		15
#define TE_BEAMCYLINDER		21

// -- | Shop | -- //

new const Prefix[  ] = "^x04[ Ultimate Shop ]^x01";

// == | Super-Knife | == //

new bool:superknife2X [ 33 ];
new bool:superknife3X [ 33 ];

new v_superknife2X [ 66 ] = "models/v_super_knife2X.mdl";
new v_superknife3X [ 66 ] = "models/v_superknife3X.mdl";

// -- | Upgrade | -- //
new bool: Upgrade[ 33 ];

// -- | He Grenade | -- //
new Hegrnd_Countdown [ 33 ];
new Float: LastMessage [ 33 ];

// -- | Take Damage | -- //
new g_iMaxPlayers;

new bool: HaveNoFlash [ 33 ];
new g_msgScreenFade;

// -- | Harry Magic Wand | -- //

new const Tag[  ] = "[Harry Magic Wand]";

new HarryFireSound[  ] = "harry_wand/harry_shoot1.wav";
new HarryHitSound[  ] = "harry_wand/harry_hit.wav";
new HarryHitSound2[  ] = "harry_wand/harry_shoot2.wav";
new HarryModel[  ] = "models/harry_wand/v_harry_wand.mdl";

new HarryBeam, HarryExp, HarryExp2, DeathSprite;

new bool:g_HasHarryWand[ 33 ];

new Harry_Ammo[ 33 ];
new Float:HarryLastShotTime[ 33 ];

new HarryDamageCvar, HarryDamageCvar2, HarryAmmo, HarryKillMoney, HarryDistance;



public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	//Register Shop
	register_clcmd("say /shop", "FurienShop" );
	register_clcmd("say shop", "FurienShop" );
	register_clcmd("say_team /shop", "FurienShop" );
	register_clcmd("say_team shop", "FurienShop" );
	register_clcmd("say /ultimate", "FurienShop" );
	register_clcmd("say_team ultimate", "FurienShop" );
	
	// -- | Harry Magic Wand | -- //
	register_event( "CurWeapon", "CurrentWeapon", "be", "1=1" );
	
	register_forward( FM_CmdStart, "Harry_CmdStart" );
	register_event("DeathMsg", "eDeath", "a")
	
	HarryDamageCvar = register_cvar( "harry_damage", "100.0" );
	HarryDamageCvar2 = register_cvar( "harry_damage2", "150.0" );
	HarryAmmo = register_cvar( "harry_ammo", "200" );
	HarryKillMoney = register_cvar( "harry_money_reward", "5000" );
	HarryDistance = register_cvar( "harry_distance", "90909" );

	register_concmd( "amx_get_harry", "GiveHarry", ADMIN_RCON, "< nume > < ammo >" );
	
	//Register Arme
	register_event ( "CurWeapon", "CurrWeapon", "be", "1=1" );
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	RegisterHam ( Ham_Spawn, "player", "Spawn", true );
	
	register_event("ScreenFade", "eventFlash", "be", "4=255", "5=255", "6=255", "7>199")
	
	
	g_iMaxPlayers = get_maxplayers ( 	);
	g_msgScreenFade = get_user_msgid("ScreenFade")
}

public eDeath ( ) {
	
	if ( superknife2X [ read_data ( 2 ) ] || superknife3X [ read_data ( 2 ) ] ) {
		
		superknife2X [ read_data ( 2 ) ] = false;
		superknife3X [ read_data ( 2 ) ] = false;
	}
}

public plugin_precache ( ) {
	
	//Super-Knife
	precache_model ( v_superknife2X );
	precache_model ( v_superknife3X );
	
	// Harry Potter Wand
	precache_sound( HarryFireSound );
	precache_sound( HarryHitSound );
	precache_sound( HarryHitSound2 );

	precache_model( HarryModel );

	HarryBeam = precache_model( "sprites/harry_wand/harry_plasma_beam.spr" );
	HarryExp = precache_model( "sprites/harry_wand/harry_plasma_exp2.spr" );
	HarryExp2 = precache_model( "sprites/harry_wand/harry_plasma_exp3.spr" );
	DeathSprite = precache_model( "sprites/harry_wand/harry_skull.spr" );
}

public client_putinserver( id ) {
		
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}

public client_disconnect( id ) {
	
	g_HasHarryWand[ id ] = false;
	Harry_Ammo[ id ] = false;
}


public Spawn( id ) {
	
	Hegrnd_Countdown [ id ] = 0;
	strip_user_weapons(id)
	give_item(id, "weapon_knife" );
	
	g_HasHarryWand[ id ] = false;
	Upgrade[ id ] = false;
	HaveNoFlash [ id ] = false;
	
}
public CurrWeapon ( id ) {
	
	if ( superknife2X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife2X );
	}
	if ( superknife3X [ id ] && get_user_weapon ( id ) == CSW_KNIFE ) {
		
		set_pev ( id, pev_viewmodel2, v_superknife3X );
	}
}

public FurienShop ( id ) {
	
	if ( cs_get_user_team(id) == CS_TEAM_T ) {
		
		ShopFurien( id )
	}
	
	if ( cs_get_user_team (id ) == CS_TEAM_CT ) {
		
		ShopAntiFurien ( id )
	}
}

public ShopAntiFurien ( id ) {   
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Anti-Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "AntiFurien")
	menu_additem(menu, "\yPachet HP + AP - \r50 Credite", "1", 0);
	menu_additem(menu, "\yBagheta Magica - \r150 Credite", "2", 0);
	menu_additem(menu, "\yDefuse Kit - \r2 Credite", "3", 0);
	menu_additem(menu, "\y50 HP - \r35 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash - \r5 Credite^n", "6", 0);
	menu_additem(menu, "\yPet - \r100 Credite", "7", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public ShopFurien( id ) {    
	
	new Temp[101], credits = fcs_get_user_credits(id); 
	
	
	formatex(Temp,100, "\yUltimate Furien Shop \r[ v1.2 ]\y:^nCreditele Tale:\r %d", credits); 
	new menu = menu_create(Temp, "Furien")
	menu_additem(menu, "\ySuperKnife \r[ 2X ]\y - \r35 Credite", "1", 0);
	menu_additem(menu, "\ySuperKnife \r[ 3X ]\y - \r65 Credite", "2", 0 );
	menu_additem(menu, "\yHE Grenade - \r30 Credite", "3", 0 );
	menu_additem(menu, "\y50 HP - \r35 Credite", "4", 0);
	menu_additem(menu, "\y100 AP - \r5 Credite", "5", 0);
	menu_additem(menu, "\yNo Flash \d( Only CT )", "6", 0);
	
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
	
}

public Furien(id, menu, item) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{  
		
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 35;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					superknife2X[ id ] = true;
					superknife3X[ id ] = false;
					g_HasHarryWand[ id ] = false;
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 2x ].", Prefix );
					CurrWeapon( id );
					
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 2:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 65;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "!%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					superknife2X[ id ] = false;
					superknife3X[ id ] = true;
					g_HasHarryWand[ id ] = false;
					CurrWeapon( id );
					
					ColorChat(id, GREEN, "%s Ai cumparat Super-Knife [ 3x ].", Prefix );
					fcs_set_user_credits( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		} 
		
		case 3:
		{
				if(Hegrnd_Countdown[id]) {
					if(LastMessage[id] < get_gametime()) {
						LastMessage[id] = get_gametime() + 1.0;
						set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
						show_hudmessage ( id, "Vei putea cumpara grenada in %d secund%s.",Hegrnd_Countdown[id], Hegrnd_Countdown[id] > 1 ? "e" : "a");
					}
				}
			
				else if ( buyhegrnd ( id ) ) {
				
					Hegrnd_Countdown[id] = 10;
					CountDown_HeGrnd(id);
				}
		}
		case 4:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 35;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			if( cs_get_user_team(id) == CS_TEAM_T)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP.", Prefix);
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		
	}
	menu_destroy(menu);
	return 1;
}

public AntiFurien(id, menu, item ) {
	
	if( item == MENU_EXIT )
	{
		return 1;
	}
	
	new data [ 6 ], szName [ 64 ];
	new access, callback;
	menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
	new key = str_to_num ( data );
	
	switch ( key )
	{
		case 1:
		{
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				if( Upgrade[ id ] )
				{
					ColorChat(id, GREEN, "%s Poti upgrada HP si AP doar o data pe runda", Prefix );
				}
				else
				{
					Pack(id);
					Upgrade[ id ] = true;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}  
		case 2:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 150;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix );
					return 1;
					
				}
				else
				{ 
					
					get_harry( id );
					
					ColorChat(id, GREEN, "%s Ai cumparat Harry Potter.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 3:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 2;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{ 
					fm_give_item ( id, "item_thighpack" )
					ColorChat(id, GREEN, "%s Ai cumparat Defuse KIT.", Prefix );
					fcs_set_user_credits ( id, iCredits );
					return 1;
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 4:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 35;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
					return 1;
					
				}
				else
				{
					new Health = get_user_health ( id );
					if ( Health < 250 ) {
						fm_set_user_health( id, get_user_health ( id ) + 50 );
						ColorChat(id, GREEN, "%s Ai cumparat 50 HP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Health >= 250 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 250 HP.", Prefix );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		
		case 5:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					new Armor = get_user_armor ( id );
					if ( Armor < 300 ) {
						fm_set_user_armor( id, get_user_armor ( id ) + 100 );
						ColorChat(id, GREEN, "%s Ai cumparat 100 AP.", Prefix );
						fcs_set_user_credits ( id, iCredits );
						return 1;
					}
					
					if ( Armor >= 300 ) {
						
						ColorChat( id, GREEN, "%s Nu poti cumpara mai mult de 300 AP." );
						return 1;
					}
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
		}
		case 6:
		{
			
			if( cs_get_user_team(id) == CS_TEAM_CT)
			{
				new iCredits = fcs_get_user_credits ( id ) - 5;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "%s Nu ai credite suficiente.", Prefix);
					return 1;
					
				}
				else
				{
					HaveNoFlash [ id ] = true;
					
					ColorChat(id, GREEN, "%s Ai cumparat No Flash.", Prefix );
					fcs_set_user_credits(id, iCredits);
				}
			}
			else
			{
				ColorChat(id, GREEN, "%s Doar Counter-Teroristi au acces la accest meniu.", Prefix );
			}
			
		}
		
		
		case 7:
		{
			set_user_pet(id)	
		}
	}
	menu_destroy(menu);
	return 1;
}

public eventFlash(id)
{
	if(is_user_connected(id) && HaveNoFlash [ id ])
	{
		message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id)
		write_short(1)
		write_short(1)
		write_short(1)
		write_byte(0)
		write_byte(0)
		write_byte(0)
		write_byte(255)
		message_end()
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) 
{
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && superknife2X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && superknife3X [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_KNIFE && cs_get_user_team( iAttacker ) == CS_TEAM_T )
		{
			SetHamParamFloat( 4, fDamage * 3.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

// -- // -- // ---> | Pack HP & AP | <--- // -- // -- //

public Pack( id ) {
	
	new iCredits = fcs_get_user_credits ( id ) - 50;
	if( iCredits < 0 )
	{
		ColorChat( id, GREEN, "%s Nu ai suficiente credite.", Prefix);
	return 1;
						
	}
	else
	{ 
		new Armor = get_user_armor ( id );
						
		if ( Armor <= 250 )
		{
			fm_set_user_armor ( id, get_user_armor ( id ) + 300 );
		}
						
		new Health = get_user_health ( id );
						
		if ( Health <= 250 )
		{
			fm_set_user_health( id, get_user_health ( id ) + 300 );
			ColorChat(id, GREEN, "%s Ai cumparat Upgrade la Health & Armor!", Prefix );
		}
						
			fcs_set_user_credits ( id, iCredits );
		return 1;
		}
	
	return 0;
}


// -- | He Grenade | -- //

public CountDown_HeGrnd ( id ) {
	
	if(!is_user_alive(id) || get_user_team ( id ) != 1) {
		Hegrnd_Countdown[id] = 0;
	}
	else if(Hegrnd_Countdown[id] > 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Vei putea cumpara grenada in %d secund%s", Hegrnd_Countdown[id], Hegrnd_Countdown[id] == 1 ? "a" : "e");
		Hegrnd_Countdown[id]--;
		set_task(1.0, "CountDown_HeGrnd", id);
	}
	else if(Hegrnd_Countdown[id] <= 0) {
		set_hudmessage(255, 170, 0, -1.0, 0.87, 0, 6.0, 1.0)
		show_hudmessage(id, "Acum poti cumpara grenada");
		Hegrnd_Countdown[id] = 0;
	}
	
}
	
bool: buyhegrnd ( id ) {
	
				new iCredits = fcs_get_user_credits ( id ) - 30;
				if( iCredits < 0 )
				{
					ColorChat( id, GREEN, "!%s Nu ai suficiente credite.", Prefix);
				}
				else
				{
					fm_give_item ( id, "weapon_hegrenade" );
					fcs_set_user_credits(id, iCredits);
				}
	return true;
}

//////////////////// ------------ || Hanrry Potter Wand || ----------- ///////////////////////////

public GiveHarry( id, level, cid ) {
	
	if( !cmd_access( id, level, cid, 3 ) ) 
		return PLUGIN_HANDLED;
	
	new szTtarget[ 32 ], szAmmoHarry[ 21 ];
	
	read_argv( 1, szTtarget, 31 );
	read_argv( 2, szAmmoHarry, 20 );

	new iPlayer = cmd_target( id, szTtarget, 8 );

	new szAdminName[ 32 ], szPlayerName[ 32 ];

	get_user_name( id, szAdminName, 31 );
	get_user_name( iPlayer, szPlayerName, 31 );

	if( !iPlayer )
		return PLUGIN_HANDLED;

	if( !is_user_alive( iPlayer ) ) {

		client_print( id, print_console, "Jucatorul %s nu este in viata !", szPlayerName );
		return 1;
	}

	if( g_HasHarryWand[ iPlayer ] ) {

		client_print( id, print_console, "Jucatorul %s are deja bagheta !", szPlayerName );
		return 1;
	}

	else {
	
		new AmmoForMagic = str_to_num( szAmmoHarry );

		ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s i-a dat lui^x03 %s^x01 bagheta lui Harry cu^x03 %d ammo^x01 !", Tag, szAdminName, szPlayerName, szAmmoHarry );

		get_harry( iPlayer );
		Harry_Ammo[ iPlayer ] += AmmoForMagic;
	}

	return PLUGIN_CONTINUE;
}

public get_harry( id ) {

	if( is_user_alive( id ) ) {

		superknife2X[ id ] = false;
		superknife3X[ id ] = false;
		g_HasHarryWand[ id ] = true;
		engclient_cmd( id, "weapon_knife" );

		Harry_Ammo[ id ] = get_pcvar_num( HarryAmmo );
	}

	else {

		client_print( id, print_console, "Jucatorul nu este in viata! " );
		g_HasHarryWand[ id ] = false;

		return 1;
	}

	return 1;
}

public CurrentWeapon( id )
	if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] )
		set_pev( id, pev_viewmodel2, HarryModel );



public Harry_CmdStart( id, uc_handle, seed ) {
	
	if( is_user_alive( id ) && g_HasHarryWand[ id ] ) {
		
		static CurButton;
		CurButton = get_uc( uc_handle, UC_Buttons );
		new Float:flNextAttack = get_pdata_float( id, 83, 5 );

		if( CurButton & IN_ATTACK ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] > 0  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire( id );

						if( Harry_Ammo[ id ] > 0 ) {
							
							set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
							show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						}
						
						else if( Harry_Ammo[ id ] <= 0 ) {
							
							set_hudmessage( 255, 0, 0, 0.01, 0.90, 0, 6.0, 1.0 );
							show_hudmessage( id, "No Ammo !" );
							
						}
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0]  = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 1;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}		
		}
		
		else if( CurButton & IN_ATTACK2 ) {

			if( get_user_weapon( id ) == CSW_KNIFE && g_HasHarryWand[ id ] ) {

				if( Harry_Ammo[ id ] >= 5  && flNextAttack <= 0.0 ) {

					if( get_gametime(  ) - HarryLastShotTime[ id ] > HARRY_WAND_SPEED2 ) {
						
						set_weapon_anim( id, HARRY_WAND_FIRE2 );
						emit_sound( id, CHAN_WEAPON, HarryFireSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
						
						Harry_Fire2( id );

						set_hudmessage( 0, 127, 255, 0.01, 0.85, 0, 6.0, 1.0 );
						show_hudmessage( id, "Remaining Ammo: %d !", Harry_Ammo[ id ] );
						
						static Float:Punch_Angles[ 3 ];
						
						Punch_Angles[ 0 ] = -5.0;
						Punch_Angles[ 1 ] = HARRY_WAND_RECOIL;
						Punch_Angles[ 2 ] = HARRY_WAND_RECOIL;
						
						set_pev( id, pev_punchangle, Punch_Angles );

						Harry_Ammo[ id ] -= 3;
						HarryLastShotTime[ id ] = get_gametime(  );
						
					}	
				}
				
				CurButton &= ~IN_ATTACK2;
				set_uc( uc_handle, UC_Buttons, CurButton );
			}
		}
	}
	
	else if( is_user_alive ( id ) && !g_HasHarryWand[ id ] )
		return PLUGIN_CONTINUE;

	return PLUGIN_CONTINUE;
}

public Harry_Fire( id ) {
	
	static Victim, Body, EndOrigin[ 3 ], BeamOrigin[ 3 ];
	get_user_origin( id, BeamOrigin, 3 );
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam);		// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 108 ); 		// Red
	write_byte( 236 );			// Green
	write_byte( 23 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp );	// sprite
	write_byte( 10 );		// scale in 0.1's
	write_byte( 15 );		// framerate
	write_byte( 4 );		// flags
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_connected( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );
		
		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {

			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_SHOCK );
			write_coord( 0 );
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 255, 122, 122, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 0 );		// red
			write_byte( 200 );		// green
			write_byte( 200 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar ) );
			
			death_message( id, Victim, 1, "Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}
	
	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public Harry_Fire2( id ) {
	
	static Victim, Body, EndOrigin[3], BeamOrigin[3];
	get_user_origin( id, BeamOrigin, 3 ) ;
	get_user_origin( id, EndOrigin, 3 );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 1 );
	write_short( id | 0x1000 );
	write_coord( BeamOrigin[ 0 ] );	// Start X
	write_coord( BeamOrigin[ 1 ] );	// Start Y
	write_coord( BeamOrigin[ 2 ] );	// Start Z
	write_short( HarryBeam );	// Sprite
	write_byte( 1 );      		// Start frame				
	write_byte( 1 );     		// Frame rate					
	write_byte( 1 );			// Life
	write_byte( 40 );   		// Line width				
	write_byte( 0 );    		// Noise
	write_byte( 150 ); 		// Red
	write_byte( 22 );			// Green
	write_byte( 235 );			// Blue
	write_byte( 150 );     		// Brightness					
	write_byte( 25 );      		// Scroll speed					
	message_end(  );

	message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
	write_byte( 3 );
	write_coord( EndOrigin[ 0 ] );
	write_coord( EndOrigin[ 1 ] );
	write_coord( EndOrigin[ 2 ] );
	write_short( HarryExp2 );
	write_byte( 10 );
	write_byte( 15 );
	write_byte( 4 );
	message_end(  );
	
	get_user_aiming( id, Victim, Body, get_pcvar_num( HarryDistance ) );

	if( is_user_alive( Victim ) ) {

		new Float:Damage = float( get_damage_body( Body, get_pcvar_float( HarryDamageCvar ) ) );

		new Float:VictimOrigin[ 3 ];
		VictimOrigin[ 0 ] = float( EndOrigin[ 0 ] );
		VictimOrigin[ 1 ] = float( EndOrigin[ 1 ] );
		VictimOrigin[ 2 ] = float( EndOrigin[ 2 ] );
		
		if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) >= 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			ExecuteHam( Ham_TakeDamage, Victim, id, id, Damage, DMG_NERVEGAS );
			
			message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "Damage" ), _, Victim );
			write_byte( 0 );
			write_byte( 0 );
			write_long( DMG_NERVEGAS );
			write_coord( 0 ) ;
			write_coord( 0 );
			write_coord( 0 );
			message_end(  );
			
			FadeScreen( Victim, 4.0, 0, 255, 0, 100 );
			ShakeScreen( Victim, 3.0 );
		}

		else if( get_user_health( Victim ) - get_pcvar_float( HarryDamageCvar2 ) < 1 && is_user_alive( Victim ) && !fm_get_user_godmode( Victim ) && get_user_team( Victim ) != get_user_team( id ) ) {
			
			new iOrigin[ 3 ];
			get_user_origin( Victim, iOrigin, 0 );

			message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); 
			write_byte( 21 );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] );
			write_coord( iOrigin[ 0 ] );
			write_coord( iOrigin[ 1 ] );
			write_coord( iOrigin[ 2 ] + 60 );	// end axis + radius
			write_short( HarryExp2 );	// sprite
			write_byte( 0 );		// startfrate
			write_byte( 0 );		// framerate
			write_byte( 10 );		// life in 0.1 sec
			write_byte( 60 );		// width
			write_byte( 0 );		// amplitude
			write_byte( 217 );		// red
			write_byte( 132 );		// green
			write_byte( 47 );		// blue
			write_byte( 153 );		// brightness
			write_byte( 0 );		// speed
			message_end(  );
			
			message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
			write_byte( 15 );
			write_coord( iOrigin[ 0 ] ); 	// start position (X)
			write_coord( iOrigin[ 1 ] ); 	// start position (Y)
			write_coord( iOrigin[ 2 ] + 40 ); // start position (Z)
			write_coord( iOrigin[ 0 ] ); 	// end position (X)
			write_coord( iOrigin[ 1 ] );	// end position (Y)
			write_coord( iOrigin[ 2 ] );	// end position (Z)
			write_short( DeathSprite );	// sprite index
			write_byte( 50 );		// count
			write_byte( 20 );		// life in 0.1's
			write_byte( 2 );		// scale in 0.1's
			write_byte( 50 );		// velocity along vector in 10's
			write_byte( 10 );		// randomness of velocity in 10's
			message_end(  );
			
			make_knockback( Victim, VictimOrigin, 3 * get_pcvar_float( HarryDamageCvar2 ) );
			
			death_message( id, Victim, 1, "Double Magic Wand" );
		}
	}

	else {

		static ClassName[ 32 ];
		pev( Victim, pev_classname, ClassName, charsmax( ClassName ) );

		if( equal( ClassName, "func_breakable" ) )
			if( entity_get_float( Victim, EV_FL_health ) <= 80 )
				force_use( id, Victim );
	}

	emit_sound( id, CHAN_WEAPON, HarryHitSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
}

public make_knockback( Victim, Float:origin[ 3 ], Float:maxspeed ) {

	new Float:fVelocity[ 3 ];
	
	kickback( Victim, origin, maxspeed, fVelocity );
	entity_set_vector( Victim, EV_VEC_velocity, fVelocity );
	
	return( 1 );
}

stock ShakeScreen( id, const Float:iSeconds ) {

	message_begin( MSG_ONE, get_user_msgid( "ScreenShake" ), { 0, 0, 0 }, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 1<<13 );
	message_end(  );
}

stock FadeScreen( id, const Float:iSeconds, const iRed, const iGreen, const iBlue, const iAlpha ) {
      
	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( floatround( 4096.0 * iSeconds, floatround_round ) );
	write_short( 0x0000 );
	write_byte( iRed );
	write_byte( iGreen );
	write_byte( iBlue );
	write_byte( iAlpha );
	message_end(  );
}		

stock kickback( ent, Float:fOrigin[ 3 ], Float:fSpeed, Float:fVelocity[ 3 ] ) {

	new Float:fEntOrigin[ 3 ];
	entity_get_vector( ent, EV_VEC_origin, fEntOrigin );
	
	new Float:fDistance[ 3 ];
	fDistance[ 0 ] = fEntOrigin[ 0 ] - fOrigin[ 0 ];
	fDistance[ 1 ] = fEntOrigin[ 1 ] - fOrigin[ 1 ];
	fDistance[ 2 ] = fEntOrigin[ 2 ] - fOrigin[ 2 ];

	new Float:fTime =( vector_distance( fEntOrigin, fOrigin ) / fSpeed );
	fVelocity[ 0 ] = fDistance[ 0 ] / fTime;
	fVelocity[ 1 ] = fDistance[ 1 ] / fTime;
	fVelocity[ 2 ] = fDistance[ 2 ] / fTime;
	
	return( fVelocity[ 0 ] && fVelocity[ 1 ] && fVelocity[ 2 ] );
}

// stock from "m79"
stock death_message( Killer, Victim, ScoreBoard, const Weapon[  ] ) {
	
	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_SET );

	ExecuteHamB( Ham_Killed, Victim, Killer, 2 );

	set_msg_block( get_user_msgid( "DeathMsg" ), BLOCK_NOT );

	make_deathmsg( Killer, Victim, 0, Weapon );
	cs_set_user_money( Killer, cs_get_user_money( Killer ) + get_pcvar_num( HarryKillMoney ) );
	
	if( ScoreBoard ) {

		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Killer );
		write_short( pev( Killer, pev_frags ) );
		write_short( cs_get_user_deaths( Killer ) );
		write_short( 0 );
		write_short( get_user_team( Killer ) );
		message_end(  );
		
		message_begin( MSG_BROADCAST, get_user_msgid( "ScoreInfo" ) );
		write_byte( Victim );
		write_short( pev( Victim, pev_frags ) );
		write_short( cs_get_user_deaths( Victim ) );
		write_short( 0 );
		write_short( get_user_team( Victim ) );
		message_end(  );
	}
}

stock set_weapon_anim( id, anim ) {

	set_pev( id, pev_weaponanim, anim );

	if( is_user_alive( id ) ) {

		message_begin( MSG_ONE, SVC_WEAPONANIM, _, id );
		write_byte( anim );
		write_byte( pev( id, pev_body ) );
		message_end(  );
	}
}

stock get_damage_body( body, Float:fDamage ) {

	switch( body ) {

		case HIT_HEAD: fDamage *= 4.0;

		case HIT_STOMACH: fDamage *= 1.1;

		case HIT_CHEST: fDamage *= 1.5;

		case HIT_LEFTARM: fDamage *= 0.77;

		case HIT_RIGHTARM: fDamage *= 0.77;

		case HIT_LEFTLEG: fDamage *= 0.75;

		case HIT_RIGHTLEG: fDamage *= 0.75;

		default: fDamage *= 1.0;
	}
	
	return floatround( fDamage );
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests