[Cerere]Menu AntiFurien+GoldWeap

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
mezzzu
Membru eXtream
Membru eXtream
Posts: 2235
Joined: 19 Dec 2010, 17:31
Detinator Steam: Da
CS Status: Working...
Reputatie: Utilizator neserios (tepar)
Fost manager FURIEN.EXTREAMCS.COM
Restrictie moderator
Has thanked: 85 times
Been thanked: 136 times

30 Dec 2013, 02:00

As dori si eu un meniu pentru Antifurien cu urmatoarele arme , dar pe langa asta sa se mai adauge si o arma speciala doar pentru VIP ( admin_level_h , exact cu acele cvar-uri din pluginul urmator : https://forums.alliedmods.net/showthread.php?t=92393 .


M4A1
AK47
M3
AUG
FAMAS
MP5
XM1014

GOLD AK47[VIP ONLY]


Mersi !
Rapidserver
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:

30 Dec 2013, 13:50

Am dat edit ti-am pus goldenu la vip admin_level_h dar tot nu gasesc unde am pus o paranteza in plus sa se uite cineva:D.
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN  "Anti-Furien Weapons"
#define VERSION  "1.0"
#define AUTHOR  "vladu888"

#define ADMIN_VIP ADMIN_LEVEL_H

new const vGoldenAK[ 64 ] = "models/AntiFurienVip/v_goldenak47.mdl"
new const pGoldenAK[ 64 ] = "models/AntiFurienVip/p_goldenak47.mdl"

new m_spriteTexture

#define is_valid_player(%1) (1 <= %1 <= 32)

new bool:WeaponChoosed[33]
new bool:AreGoldenAK[33]


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	RegisterHam( Ham_Spawn, "player", "hamPlayerSpawnPost", 1 )
	register_clcmd( "say /guns", "AntiFrMenu" )
        register_event( "CurWeapon", "Event_CurWeapon", "be", "1=1" )
	register_event("CurWeapon", "GoldenEffect", "be", "1=1", "3>0" )
	RegisterHam( Ham_TakeDamage, "player", "fwTakeDamage" )

}
public plugin_precache( )
{

	precache_model( vGoldenAK )
	precache_model( pGoldenAK ) 
	m_spriteTexture = precache_model( "sprites/dot.spr" )

}
public hamPlayerSpawnPost( id )
{
	if( is_user_alive( id ) )
	{
		strip_user_weapons( id );

		if( cs_get_user_team( id ) == CS_TEAM_T )
		{
			give_item( id, "weapon_knife" );
                        
		}
		
		else if( cs_get_user_team( id ) == CS_TEAM_CT )
		{
			AntiFr( id );
			WeaponChoosed[ id ] = false;
		}

}
}
public AntiFr( id )
{
	new menu = menu_create( "\rAlegeti Arma!", "AntiFrHandler" );	
	
	menu_additem( menu, "\wM4A1", "1", 0 );
	menu_additem( menu, "\wAK47", "2", 0 );
	menu_additem( menu, "\wM3", "3", 0 );
	menu_additem( menu, "\wAUG", "4", 0 );
        menu_additem( menu, "\wFAMAS", "5", 0 );
        menu_additem( menu, "\wMP5", "6", 0 );
        menu_additem( menu, "\wXM1014", "7", 0 );
        menu_additem( menu, "\wGolden AK47\r(VIP ONLY)", "8", ADMIN_VIP );
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 
	
	menu_display( id, menu, 0 );
	
}
public AntiFrHandler( id, menu, item )
{
	if( !is_user_connected(  id  )  )
	{
		return 1;
	}
	
	if( cs_get_user_team( id ) == CS_TEAM_T )
        {
               return 1;
        }
	if( item == MENU_EXIT )
	{
		set_task( 0.1, "AntiFr", id );
		return 1;
	}
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo( menu, item, iaccess, data, 5, iName, 63, callback );
	
	new key = str_to_num( data );
	
	switch( key )
	{
		case 1:
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_m4a1" )
			cs_set_user_bpammo( id, CSW_M4A1, 200 )
		}
		case 2:
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 200 )
			cs_set_user_bpammo( id, CSW_DEAGLE, 70 )
			 
		}
		case 3: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_m3" )
			cs_set_user_bpammo( id, CSW_M3, 200 )
		}
		case 4: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_aug" )
			cs_set_user_bpammo( id, CSW_AUG, 200 )
		}
                case 5: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_famas" )
			cs_set_user_bpammo( id, CSW_FAMAS, 200 )
		}
                case 6: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_mp5navy" )
			cs_set_user_bpammo( id, CSW_MP5NAVY, 200 )
		}
                case 7: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_xm1014" )
			cs_set_user_bpammo( id, CSW_XM1014, 200 )
		}
                case 8:
		{
			AreGoldenAK[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 200 )
                        set_pev( id, pev_viewmodel2, vGoldenAK )
			set_pev( id, pev_weaponmodel2, pGoldenAK )
	        }

        }
	return 0;
        }

public AntiFrMenu( id )
{
	if( cs_get_user_team( id ) == CS_TEAM_CT && WeaponChoosed[ id ] )
	{
		client_print( id, print_center, "Ti-ai ales deja armele !" );
		return 1;
	}
	
	if( cs_get_user_team( id ) == CS_TEAM_T || WeaponChoosed[ id ] || !is_user_alive( id ) )
	{
		return 1;
	}
	
	AntiFr( id );
	return 0;
        }

}
public Event_CurWeapon( id ) {
	new Arma = read_data( 2 )
	
	if( Arma == CSW_AK47 && AreGoldenAK[ id ] ) {
		set_pev( id, pev_viewmodel2, vGoldenAK )
		set_pev( id, pev_weaponmodel2, pGoldenAK )
	}
}
public fwTakeDamage( Victim, Inflictor, Attacker, Float:Damage ) {
	if( is_valid_player( Attacker ) && get_user_weapon( Attacker ) == CSW_AK47 && AreGoldenAK[ Attacker ] ) {
		SetHamParamFloat( 4, Damage * 2 )
	}

}	
public GoldenEffect( id ) 
{
	new clip,ammo
	new Arma = get_user_weapon(id,clip,ammo)
	
	if (Arma == CSW_AK47 && AreGoldenAK[ id ] ) {
		new vec1[ 3 ], vec2[ 3 ]
		get_user_origin( id, vec1, 1 ) 
		get_user_origin( id, vec2, 4 ) 
		
		message_begin( MSG_BROADCAST,SVC_TEMPENTITY )
		write_byte ( 0 )     
		write_coord( vec1[ 0 ] )
		write_coord( vec1[ 1 ] )
		write_coord( vec1[ 2 ] )
		write_coord( vec2[ 0 ] )
		write_coord( vec2[ 1 ] )
		write_coord( vec2[ 2 ] )
		write_short( m_spriteTexture )
		write_byte( 1 )  
		write_byte( 5 ) 
		write_byte( 2 ) 
		write_byte( 10 ) 
		write_byte( 0  ) 
		write_byte( 255  )     
		write_byte( 215  )       
		write_byte(  0 )       
		write_byte( 200 ) 
		write_byte( 150 ) 
		message_end( )
}

}
Image
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost 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 Dec 2013, 14:42

Poftim :
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>


#pragma tabsize 0

#define PLUGIN  "Anti-Furien Weapons"
#define VERSION  "1.0"
#define AUTHOR  "vladu888"


#define is_valid_player(%1) (1 <= %1 <= 32)

#define VIP ADMIN_LEVEL_H // Flagul pus este "t"

new AK_V_MODEL[64] = "models/v_golden_ak47.mdl"
new AK_P_MODEL[64] = "models/p_golden_ak47.mdl"

/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets,  cvar_custommodel, cvar_uclip

new bool:g_HasAk[33]

new bool:WeaponChoosed[33]

new g_hasZoom[ 33 ]
new bullets[ 33 ]

// Sprite
new m_spriteTexture

const Wep_ak47 = ((1<<CSW_AK47))


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	register_clcmd( "say /guns", "AntiFrMenu" )
	
		/* CVARS */
	cvar_dmgmultiplier = register_cvar("goldenak_dmg_multiplier", "5")
	cvar_custommodel = register_cvar("goldenak_custom_model", "1")
	cvar_goldbullets = register_cvar("goldenak_gold_bullets", "1")
	cvar_uclip = register_cvar("goldenak_unlimited_clip", "1")
	
	register_concmd("amx_goldenak", "CmdGiveAk", ADMIN_BAN, "<name>")
	// Death Msg
	register_event("DeathMsg", "Death", "a")
	// Weapon Pick Up
	register_event("WeapPickup","checkModel","b","1=19")
	// Current Weapon Event
	register_event("CurWeapon","checkWeapon","be","1=1")
	register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
	// Ham TakeDamage
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	register_forward( FM_CmdStart, "fw_CmdStart" )
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)

}
public client_connect(id)
{
	g_HasAk[id] = false
}

public client_disconnect(id)
{
	g_HasAk[id] = false
}

public Death()
{
	g_HasAk[read_data(2)] = false
}



public plugin_precache()
{
	precache_model(AK_V_MODEL)
	precache_model(AK_P_MODEL)
	m_spriteTexture = precache_model("sprites/dot.spr")
	precache_sound("weapons/zoom.wav")
}
public fwHamPlayerSpawnPost(id)
{
	if( is_user_alive( id ) )
	{
		strip_user_weapons( id );

		if( cs_get_user_team( id ) == CS_TEAM_T )
		{
			give_item( id, "weapon_knife" );
                        
		}
		
		else if( cs_get_user_team( id ) == CS_TEAM_CT )
		{
			AntiFr( id );
			WeaponChoosed[ id ] = false;
			g_HasAk[id] = false;
		}
}
}
public AntiFr( id )
{
	new menu = menu_create( "\rAlegeti Arma!", "AntiFrHandler" );	
	
	menu_additem( menu, "\wM4A1", "1", 0 );
	menu_additem( menu, "\wAK47", "2", 0 );
	menu_additem( menu, "\wM3", "3", 0 );
	menu_additem( menu, "\wAUG", "4", 0 );
        menu_additem( menu, "\wFAMAS", "5", 0 );
        menu_additem( menu, "\wMP5", "6", 0 );
        menu_additem( menu, "\wXM1014", "7", 0 );
        menu_additem( menu, "\wGolden AK47\r(VIP ONLY)", "8", VIP );
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 
	
	menu_display( id, menu, 0 );
	
}
public AntiFrHandler( id, menu, item )
{
	if( !is_user_connected(  id  )  )
	{
		return 1;
	}
	
	if( cs_get_user_team( id ) == CS_TEAM_T )
        {
               return 1;
        }
	if( item == MENU_EXIT )
	{
		set_task( 0.1, "AntiFr", id );
		return 1;
	}
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo( menu, item, iaccess, data, 5, iName, 63, callback );
	
	new key = str_to_num( data );
	
	switch( key )
	{
		case 1:
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_m4a1" )
			cs_set_user_bpammo( id, CSW_M4A1, 200 )
		}
		case 2:
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 200 )
			cs_set_user_bpammo( id, CSW_DEAGLE, 70 )
			 
		}
		case 3: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_m3" )
			cs_set_user_bpammo( id, CSW_M3, 200 )
		}
		case 4: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_aug" )
			cs_set_user_bpammo( id, CSW_AUG, 200 )
		}
                case 5: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_famas" )
			cs_set_user_bpammo( id, CSW_FAMAS, 200 )
		}
                case 6: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_mp5navy" )
			cs_set_user_bpammo( id, CSW_MP5NAVY, 200 )
		}
                case 7: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_xm1014" )
			cs_set_user_bpammo( id, CSW_XM1014, 200 )
		}
                case 8:
		{
			WeaponChoosed[ id ] = true;
			set_task(0.1, "CmdGiveAk", id);
	        }

        }
	return 0;
        }

public AntiFrMenu( id )
{
	if( cs_get_user_team( id ) == CS_TEAM_CT && WeaponChoosed[ id ] )
	{
		client_print( id, print_center, "Ti-ai ales deja armele !" );
		return 1;
	}
	
	if( cs_get_user_team( id ) == CS_TEAM_T || WeaponChoosed[ id ] || !is_user_alive( id ) )
	{
		return 1;
	}
	
	AntiFr( id );
	return 0;
        }
public checkModel(id)
{
	if ( !g_HasAk[id] )
		return PLUGIN_HANDLED
	
	new szWeapID = read_data(2)
	
	if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && get_pcvar_num(cvar_custommodel) )
	{
		set_pev(id, pev_viewmodel2, AK_V_MODEL)
		set_pev(id, pev_weaponmodel2, AK_P_MODEL)
	}
	return PLUGIN_HANDLED
}

public checkWeapon(id)
{
	new plrClip, plrAmmo, plrWeap[32]
	new plrWeapId
	
	plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
	
	if (plrWeapId == CSW_AK47 && g_HasAk[id])
	{
		checkModel(id)
	}
	else 
	{
		return PLUGIN_CONTINUE
	}
	
	if (plrClip == 0 && get_pcvar_num(cvar_uclip))
	{
		// If the user is out of ammo..
		get_weaponname(plrWeapId, plrWeap, 31)
		// Get the name of their weapon
		give_item(id, plrWeap)
		engclient_cmd(id, plrWeap) 
		engclient_cmd(id, plrWeap)
		engclient_cmd(id, plrWeap)
	}
	return PLUGIN_HANDLED
}



public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
	if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker] )
	{
		SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
	}
}

public fw_CmdStart( id, uc_handle, seed )
{
	if( !is_user_alive( id ) ) 
		return PLUGIN_HANDLED
	
	if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
	{
		new szClip, szAmmo
		new szWeapID = get_user_weapon( id, szClip, szAmmo )
		
		if( szWeapID == CSW_AK47 && g_HasAk[id] == true && !g_hasZoom[id] == true)
		{
			g_hasZoom[id] = true
			cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
			emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
		}
		
		else if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && g_hasZoom[id])
		{
			g_hasZoom[ id ] = false
			cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
			
		}
		
	}
	return PLUGIN_HANDLED
}


public make_tracer(id)
{
	if (get_pcvar_num(cvar_goldbullets))
	{
		new clip,ammo
		new wpnid = get_user_weapon(id,clip,ammo)
		new pteam[16]
		
		get_user_team(id, pteam, 15)
		
		if ((bullets[id] > clip) && (wpnid == CSW_AK47) && g_HasAk[id]) 
		{
			new vec1[3], vec2[3]
			get_user_origin(id, vec1, 1) // origin; your camera point.
			get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
			
			
			//BEAMENTPOINTS
			message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
			write_byte (0)     //TE_BEAMENTPOINTS 0
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2])
			write_coord(vec2[0])
			write_coord(vec2[1])
			write_coord(vec2[2])
			write_short( m_spriteTexture )
			write_byte(1) // framestart
			write_byte(5) // framerate
			write_byte(2) // life
			write_byte(10) // width
			write_byte(0) // noise
			write_byte( 255 )     // r, g, b
			write_byte( 215 )       // r, g, b
			write_byte( 0 )       // r, g, b
			write_byte(200) // brightness
			write_byte(150) // speed
			message_end()
		}
		
		bullets[id] = clip
	}
	
}

public CmdGiveAk(id,level,cid)
{
	if (!cmd_access(id,level,cid,2))
		return PLUGIN_HANDLED;
	new arg[32];
	read_argv(1,arg,31);
	
	new player = cmd_target(id,arg,7);
	if (!player) 
		return PLUGIN_HANDLED;
	
	new name[32];
	get_user_name(player,name,31);
	
	give_item(player, "weapon_ak47")
	g_HasAk[player] = true
	
	return PLUGIN_HANDLED
}

stock drop_prim(id) 
{
	new weapons[32], num
	get_user_weapons(id, weapons, num)
	for (new i = 0; i < num; i++) {
		if (Wep_ak47 & (1<<weapons)) 
		{
			static wname[32]
			get_weaponname(weapons, wname, sizeof wname - 1)
			engclient_cmd(id, "drop", wname)
		}
	}
}
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
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
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: 230 times
Been thanked: 128 times
Contact:

30 Dec 2013, 14:43

Ai pus jos doua " } "
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN  "Anti-Furien Weapons"
#define VERSION  "1.0"
#define AUTHOR  "vladu888"

#define ADMIN_VIP ADMIN_LEVEL_H

new const vGoldenAK[ 64 ] = "models/AntiFurienVip/v_goldenak47.mdl"
new const pGoldenAK[ 64 ] = "models/AntiFurienVip/p_goldenak47.mdl"

new m_spriteTexture

#define is_valid_player(%1) (1 <= %1 <= 32)

new bool:WeaponChoosed[33]
new bool:AreGoldenAK[33]


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	RegisterHam( Ham_Spawn, "player", "hamPlayerSpawnPost", 1 )
	register_clcmd( "say /guns", "AntiFrMenu" )
        register_event( "CurWeapon", "Event_CurWeapon", "be", "1=1" )
	register_event("CurWeapon", "GoldenEffect", "be", "1=1", "3>0" )
	RegisterHam( Ham_TakeDamage, "player", "fwTakeDamage" )

}
public plugin_precache( )
{

	precache_model( vGoldenAK )
	precache_model( pGoldenAK ) 
	m_spriteTexture = precache_model( "sprites/dot.spr" )

}
public hamPlayerSpawnPost( id )
{
	if( is_user_alive( id ) )
	{
		strip_user_weapons( id );

		if( cs_get_user_team( id ) == CS_TEAM_T )
		{
			give_item( id, "weapon_knife" );
                        
		}
		
		else if( cs_get_user_team( id ) == CS_TEAM_CT )
		{
			AntiFr( id );
			WeaponChoosed[ id ] = false;
		}

}
}
public AntiFr( id )
{
	new menu = menu_create( "\rAlegeti Arma!", "AntiFrHandler" );	
	
	menu_additem( menu, "\wM4A1", "1", 0 );
	menu_additem( menu, "\wAK47", "2", 0 );
	menu_additem( menu, "\wM3", "3", 0 );
	menu_additem( menu, "\wAUG", "4", 0 );
        menu_additem( menu, "\wFAMAS", "5", 0 );
        menu_additem( menu, "\wMP5", "6", 0 );
        menu_additem( menu, "\wXM1014", "7", 0 );
        menu_additem( menu, "\wGolden AK47\r(VIP ONLY)", "8", ADMIN_VIP );
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 
	
	menu_display( id, menu, 0 );
	
}
public AntiFrHandler( id, menu, item )
{
	if( !is_user_connected(  id  )  )
	{
		return 1;
	}
	
	if( cs_get_user_team( id ) == CS_TEAM_T )
        {
               return 1;
        }
	if( item == MENU_EXIT )
	{
		set_task( 0.1, "AntiFr", id );
		return 1;
	}
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo( menu, item, iaccess, data, 5, iName, 63, callback );
	
	new key = str_to_num( data );
	
	switch( key )
	{
		case 1:
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_m4a1" )
			cs_set_user_bpammo( id, CSW_M4A1, 200 )
		}
		case 2:
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 200 )
			cs_set_user_bpammo( id, CSW_DEAGLE, 70 )
			 
		}
		case 3: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_m3" )
			cs_set_user_bpammo( id, CSW_M3, 200 )
		}
		case 4: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_aug" )
			cs_set_user_bpammo( id, CSW_AUG, 200 )
		}
                case 5: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_famas" )
			cs_set_user_bpammo( id, CSW_FAMAS, 200 )
		}
                case 6: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_mp5navy" )
			cs_set_user_bpammo( id, CSW_MP5NAVY, 200 )
		}
                case 7: 
		{
			WeaponChoosed[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_xm1014" )
			cs_set_user_bpammo( id, CSW_XM1014, 200 )
		}
                case 8:
		{
			AreGoldenAK[ id ] = true;
			give_item( id, "weapon_knife" )
			give_item( id, "weapon_ak47" )
			cs_set_user_bpammo( id, CSW_AK47, 200 )
                        set_pev( id, pev_viewmodel2, vGoldenAK )
			set_pev( id, pev_weaponmodel2, pGoldenAK )
	        }

        }
	return 0;
        }

public AntiFrMenu( id )
{
	if( cs_get_user_team( id ) == CS_TEAM_CT && WeaponChoosed[ id ] )
	{
		client_print( id, print_center, "Ti-ai ales deja armele !" );
		return 1;
	}
	
	if( cs_get_user_team( id ) == CS_TEAM_T || WeaponChoosed[ id ] || !is_user_alive( id ) )
	{
		return 1;
	}
	
	AntiFr( id );
	return 0;
        }

}
public Event_CurWeapon( id ) {
	new Arma = read_data( 2 )
	
	if( Arma == CSW_AK47 && AreGoldenAK[ id ] ) {
		set_pev( id, pev_viewmodel2, vGoldenAK )
		set_pev( id, pev_weaponmodel2, pGoldenAK )
	}
}
public fwTakeDamage( Victim, Inflictor, Attacker, Float:Damage ) {
	if( is_valid_player( Attacker ) && get_user_weapon( Attacker ) == CSW_AK47 && AreGoldenAK[ Attacker ] ) {
		SetHamParamFloat( 4, Damage * 2 )
	}

}	
public GoldenEffect( id ) 
{
	new clip,ammo
	new Arma = get_user_weapon(id,clip,ammo)
	
	if (Arma == CSW_AK47 && AreGoldenAK[ id ] ) {
		new vec1[ 3 ], vec2[ 3 ]
		get_user_origin( id, vec1, 1 ) 
		get_user_origin( id, vec2, 4 ) 
		
		message_begin( MSG_BROADCAST,SVC_TEMPENTITY )
		write_byte ( 0 )     
		write_coord( vec1[ 0 ] )
		write_coord( vec1[ 1 ] )
		write_coord( vec1[ 2 ] )
		write_coord( vec2[ 0 ] )
		write_coord( vec2[ 1 ] )
		write_coord( vec2[ 2 ] )
		write_short( m_spriteTexture )
		write_byte( 1 )  
		write_byte( 5 ) 
		write_byte( 2 ) 
		write_byte( 10 ) 
		write_byte( 0  ) 
		write_byte( 255  )     
		write_byte( 215  )       
		write_byte(  0 )       
		write_byte( 200 ) 
		write_byte( 150 ) 
		message_end( )
}
Contact: Activitate scazuta.
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:

30 Dec 2013, 15:49

Tot da eorare dane trebuai jos 2 altundeva e gresit.
Image
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost 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 Dec 2013, 15:55

8-| uitate sus la ce ti-am modificat eu !
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:

30 Dec 2013, 16:12

Dar eu nu vreau vesriunea ta, e separata din ce ti-o dat mezzzu.
Image
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 10:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost 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 Dec 2013, 16:38

/:) El a spus ca vrea un plugin de arme cu arma respectiva pentru vip si eu am luat meniul tau si am inclus arma. Nu asta a cerut ? Si daca te uiti are si cvaruri ;)
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:

30 Dec 2013, 18:36

n-am observat ca vrea si cvaruri asa ms pentru edit.
Image
User avatar
sDs|Aragon*
Membru, skill +2
Membru, skill +2
Posts: 576
Joined: 29 Dec 2011, 21:38
Detinator Steam: Da
SteamID: Mihai_Parkour10
Reputatie: Fost scripter eXtreamCS
Location: Caracal
Has thanked: 3 times
Been thanked: 132 times
Contact:

01 Jan 2014, 05:27

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "Weapons Menu"
#define VERSION "1.0"
#define AUTHOR "Aragon*"

#define VIP_LEVEL	ADMIN_LEVEL_H

//------| Weapons Menu |------//
#define DMG_HEGRENADE 		(1<<24)
new Menu, Shell, BloodSpray, BloodDrop, bool:HaveWeapons[33], Float:cl_pushangle[33][3];
new PrimaryWeapons[][][] = {
	{ "M4A1",     "weapon_m4a1" },
	{ "AK47",     "weapon_ak47" },
	{ "M3",       "weapon_m3" },
	{ "AUG",      "weapon_aug" },
	{ "Famas",    "weapon_famas" },
	{ "MP5 Navy", "weapon_mp5navy" },
	{ "XM1014",   "weapon_xm1014" }
}

new Grenades[][] = {
	"weapon_hegrenade",
	"weapon_flashbang"//,
	//"weapon_smokegrenade"
}

#define AK47GOLD_WEAPONKEY	109
#define weapon_ak47gold		"weapon_aug"
#define CSW_AK47GOLD		CSW_AUG
new AK47GoldModel_V[] = "models/v_ak47gold.mdl";
new AK47GoldModel_P[] = "models/p_ak47gold.mdl";
new AK47GoldModel_W[] = "models/w_ak47gold.mdl";
new AK47Gold_Sound[][] = {
	"weapons/ak47-1.wav",
	"weapons/ak47-2.wav"
};	
new bool:HaveAK47Gold[33], AK47CaseNum, Bullets[33], BulletSprite, ak47gold_clip[33], ak47gold_reload[33], ak47gold_event;
new ak47golddamage, ak47goldclip, ak47goldreloadtime, ak47goldrecoil;

public plugin_init() {
	RegisterHam(Ham_Spawn, "player", "HAM_Spawn_Post", 1);
	
	Shell = engfunc(EngFunc_PrecacheModel, "models/rshell.mdl");
	
	// AK47 Gold
	register_clcmd("weapon_ak47gold", "Hook_AK47Gold");
	
	register_message(get_user_msgid("DeathMsg"), "AK47Gold_DeathMsg");
	
	register_event("CurWeapon", "AK47Gold_ViewModel", "be", "1=1");
	register_event("CurWeapon", "AK47Gold_MakeTracer", "be", "1=1", "3>0")
	register_event("WeapPickup","AK47Gold_ViewModel","b","1=19");
	
	register_forward(FM_SetModel, "AK47Gold_WorldModel");
	register_forward(FM_UpdateClientData, "AK47Gold_UpdateClientData_Post", 1);
	register_forward(FM_PlaybackEvent, "AK47Gold_PlaybackEvent");
	
	RegisterHam(Ham_TakeDamage, "player", "AK47Gold_TakeDamage");
	RegisterHam(Ham_TraceAttack, "worldspawn", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "player", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "func_breakable", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "func_wall", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "func_door", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "func_door_rotating", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "func_plat", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_TraceAttack, "func_rotating", "AK47Gold_TraceAttack_Post", 1);
	RegisterHam(Ham_Item_Deploy , weapon_ak47gold, "AK47Gold_Deploy_Post", 1);
	RegisterHam(Ham_Weapon_PrimaryAttack, weapon_ak47gold, "AK47Gold_PrimaryAttack");
	RegisterHam(Ham_Weapon_PrimaryAttack, weapon_ak47gold, "AK47Gold_PrimaryAttack_Post", 1);
	RegisterHam(Ham_Item_AddToPlayer, weapon_ak47gold, "AK47Gold_AddToPlayer");
	RegisterHam(Ham_Weapon_Reload, weapon_ak47gold, "AK47Gold_Reload");
	RegisterHam(Ham_Weapon_Reload, weapon_ak47gold, "AK47Gold_Reload_Post", 1);
	RegisterHam(Ham_Item_PostFrame, weapon_ak47gold, "AK47Gold_PostFrame");
	
	ak47golddamage = register_cvar("amx_ak47gold_damage", "45");			//| AK47 Gold Damage |//
	ak47goldclip = register_cvar("amx_ak47gold_clip", "30");				//| AK47 Gold Clip |//
	ak47goldreloadtime = register_cvar("amx_ak47gold_reload_time", "2.45");		//| AK47 Gold Reload Time |//
	ak47goldrecoil = register_cvar("amx_ak47gold_recoil", "0.8");			//| AK47 Gold Recoil |//
}

public plugin_precache() {
	BloodSpray = precache_model("sprites/bloodspray.spr");
	BloodDrop  = precache_model("sprites/blood.spr");
	
	// AK47 Gold
	register_forward(FM_PrecacheEvent, "AK47Gold_PrecacheEvent_Post", 1);
	
	BulletSprite = precache_model("sprites/dot.spr")
	
	precache_model(AK47GoldModel_V);
	precache_model(AK47GoldModel_P);
	precache_model(AK47GoldModel_W);
	for(new i = 0; i < sizeof(AK47Gold_Sound); i++)
		engfunc(EngFunc_PrecacheSound, AK47Gold_Sound);	
}

public plugin_natives() {
	// AK47 Gold
	register_native("get_user_ak47gold", "get_user_ak47gold", 1);
	register_native("set_user_ak47gold", "set_user_ak47gold", 1);
}

public HAM_Spawn_Post(id) {
	if(is_user_connected(id) && get_user_team(id) == 2) {
		fm_strip_user_weapons(id);
		HaveWeapons[id] = false
		set_user_ak47gold(id, false);
		
		Equipment(id)
	}
}

public Equipment(id) {
	if(is_user_alive(id) && get_user_team(id) == 2) {
		Menu = menu_create("\rEquipment", "EquipmentCmd");
		
		for(new i = 0; i < sizeof Grenades; ++i)
			fm_give_item(id, Grenades);
		new WeaponName[256], WeaponNum[256]
		for(new i = 0; i < sizeof PrimaryWeapons; ++i) {
			formatex(WeaponName,sizeof(WeaponName)-1,"\w%s", PrimaryWeapons[0]);
			formatex(WeaponNum,sizeof(WeaponNum)-1,"%d", i);
			menu_additem(Menu, WeaponName, WeaponNum, 0);
		}
		menu_addblank(Menu, 0);
		if(get_user_flags(id) & VIP_LEVEL)
			formatex(WeaponName,sizeof(WeaponName)-1,"\yAK47 Gold");
		else
			formatex(WeaponName,sizeof(WeaponName)-1,"\dAK47 Gold - \rOnly VIP");
		formatex(WeaponNum,sizeof(WeaponNum)-1,"%d", sizeof PrimaryWeapons + 1);
		
		AK47CaseNum = str_to_num(WeaponNum)
		menu_additem(Menu, WeaponName, WeaponNum, 0);
		
		menu_setprop(Menu, MPROP_PERPAGE, 0)
		menu_setprop(Menu, MPROP_EXIT, MEXIT_NEVER)
		menu_display(id, Menu, 0);
	}
}

public EquipmentCmd(id, menu, item) {
	if(item == MENU_EXIT) {
		menu_destroy(menu);
		
		Equipment(id)
		return PLUGIN_HANDLED;
	}
	else if(!is_user_alive(id) || get_user_team(id) != 2) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new Data[6], Name[64];
	new Access, CallBack;
	menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
	new Key = str_to_num(Data);
	if(Key == AK47CaseNum) {
		if(get_user_flags(id) & VIP_LEVEL) {
			set_user_ak47gold(id, true);
			fm_give_item(id, "weapon_deagle");
			cs_set_user_bpammo(id, CSW_DEAGLE, 100);
			HaveWeapons[id] = true
		}
		else {
			menu_destroy(menu);
			
			Equipment(id)
			return PLUGIN_HANDLED;
		}
	}
	else {
		fm_give_item(id, PrimaryWeapons[Key][1]);
		cs_set_user_bpammo(id, get_weaponid(PrimaryWeapons[Key][1]), 200)
		fm_give_item(id, "weapon_deagle");
		cs_set_user_bpammo(id, CSW_DEAGLE, 100);
		HaveWeapons[id] = true
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public AK47Gold_DeathMsg(msg_id, msg_dest, id) {
	static TruncatedWeapon[33], Attacker, Victim;
	
	get_msg_arg_string(4, TruncatedWeapon, charsmax(TruncatedWeapon));
	
	Attacker = get_msg_arg_int(1);
	Victim = get_msg_arg_int(2);
	
	if(!is_user_connected(Attacker) || Attacker == Victim)
		return PLUGIN_CONTINUE;
	
	if(equal(TruncatedWeapon, "ak47") && get_user_weapon(Attacker) == CSW_AK47GOLD) {
		if(get_user_ak47gold(Attacker))
			set_msg_arg_string(4, "AK47 Gold");
	}
	return PLUGIN_CONTINUE;
}

public AK47Gold_ViewModel(id) {
	if(get_user_weapon(id) == CSW_AK47GOLD && get_user_ak47gold(id)) {
		set_pev(id, pev_viewmodel2, AK47GoldModel_V);
		set_pev(id, pev_weaponmodel2, AK47GoldModel_P);
	}
}

public AK47Gold_MakeTracer(id) {
	if(get_user_weapon(id) == CSW_AK47GOLD && get_user_ak47gold(id)) {
		new Clip, AK47Gold
		AK47Gold = find_ent_by_owner(-1, weapon_ak47gold, id);
		Clip = cs_get_weapon_ammo(AK47Gold);
		
		if(Bullets[id] > Clip) {		
			static EndOrigin[3];
			get_user_origin(id, EndOrigin, 4);
			message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
			write_byte(TE_BEAMENTPOINT);
			write_short(id | 0x1000);
			write_coord(EndOrigin[0]);	// Start X
			write_coord(EndOrigin[1]);	// Start Y
			write_coord(EndOrigin[2]);	// Start Z
			write_short(BulletSprite);	// Sprite
			write_byte(0);      		// Start frame				
			write_byte(1);     		// Frame rate					
			write_byte(1);			// Life
			write_byte(20);   		// Line width				
			write_byte(0);    		// Noise
			write_byte(255); 		// Red
			write_byte(215);		// Green
			write_byte(0);			// Blue
			write_byte(150);     		// Brightness					
			write_byte(0);      		// Scroll speed					
			message_end();
		}
		Bullets[id] = Clip
	}
}

public AK47Gold_WorldModel(entity, model[]) {
	if(!is_valid_ent(entity))
		return FMRES_IGNORED;
	
	static ClassName[33];
	entity_get_string(entity, EV_SZ_classname, ClassName, charsmax(ClassName));
	
	if(!equal(ClassName, "weaponbox"))
		return FMRES_IGNORED;
	
	new Owner = entity_get_edict(entity, EV_ENT_owner);	
	new AK47Gold = find_ent_by_owner(-1, weapon_ak47gold, entity);
	
	if(get_user_ak47gold(Owner) && is_valid_ent(AK47Gold) && equal(model, "models/w_ak47.mdl")) {
		entity_set_int(AK47Gold, EV_INT_impulse, AK47GOLD_WEAPONKEY);
		HaveAK47Gold[Owner] = false;
		entity_set_model(entity, AK47GoldModel_W);
		return FMRES_SUPERCEDE;
	}
	return FMRES_IGNORED;
}

public AK47Gold_UpdateClientData_Post(id, sendweapons, cd_handle) {
	if(is_user_alive(id) && is_user_connected(id)) {
		if(get_user_weapon(id) == CSW_AK47GOLD && get_user_ak47gold(id))	
			set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001);
	}
}

public AK47Gold_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2) {
	if(!is_user_connected(invoker))
		return FMRES_IGNORED;
	if(eventid != ak47gold_event)
		return FMRES_IGNORED;
	
	playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2);
	
	return FMRES_SUPERCEDE;
}

public AK47Gold_PrecacheEvent_Post(type, const name[]) {
	if (equal("events/mp5navy.sc", name)) {
		ak47gold_event = get_orig_retval();
		return FMRES_HANDLED;
	}
	return FMRES_IGNORED;
}

public AK47Gold_TakeDamage(victim, inflictor, attacker, Float:damage, damagetype) {
	if(is_user_connected(attacker) && !(damagetype & DMG_HEGRENADE)) {
		new Body, Target, Float:NewDamage;
		if(get_user_weapon(attacker) == CSW_AK47GOLD && get_user_ak47gold(attacker)) {
			if(is_user_connected(victim)) {
				get_user_aiming(attacker, Target, Body, 999999);
				NewDamage = float(get_damage_body(Body, get_pcvar_float(ak47golddamage)));
				SetHamParamFloat(4, NewDamage);
			} 
			else {
				SetHamParamFloat(4, get_pcvar_float(ak47golddamage));
			}
		}
	}
}

public AK47Gold_TraceAttack_Post(ent, attacker, Float:Damage, Float:Dir[3], pentru, DamageType) {
	if(!is_user_alive(attacker) || !is_user_connected(attacker))
		return HAM_IGNORED;
	if(get_user_weapon(attacker) != CSW_AK47GOLD)
		return HAM_IGNORED;
	if(!get_user_ak47gold(attacker))
		return HAM_IGNORED;
	
	static Float:End[3];
	get_tr2(pentru, TR_vecEndPos, End);
	
	Make_Bullet(attacker, End);
	
	return HAM_HANDLED;
}

public AK47Gold_AddToPlayer(Weapon, id) {
	if(is_valid_ent(Weapon) && is_user_connected(id) && entity_get_int(Weapon, EV_INT_impulse) == AK47GOLD_WEAPONKEY) {
		HaveAK47Gold[id] = true;
		entity_set_int(Weapon, EV_INT_impulse, 0);
	}
}

public AK47Gold_Deploy_Post(entity) {
	static Owner;
	Owner = get_pdata_cbase(entity, 41, 4);
	if(get_user_ak47gold(Owner)) {
		set_pev(Owner, pev_viewmodel2, AK47GoldModel_V);
		set_pev(Owner, pev_weaponmodel2, AK47GoldModel_P);
		set_pdata_float(Owner, 83, 1.03, 5);
		set_weapon_anim(Owner, 2);
		static clip;
		clip = cs_get_weapon_ammo(entity);
		if(clip > 0)
			ak47gold_reload[Owner] = 0;
	}
}

public AK47Gold_PrimaryAttack(Weapon) {
	new id = get_pdata_cbase(Weapon, 41, 4);
	
	if (get_user_ak47gold(id)) {
		pev(id,pev_punchangle,cl_pushangle[id]);
		ak47gold_clip[id] = cs_get_weapon_ammo(Weapon);
	}
}

public AK47Gold_PrimaryAttack_Post(Weapon) {
	new id = get_pdata_cbase(Weapon, 41, 4);
	new ActiveItem = get_pdata_cbase(id, 373) ;
	
	if(ak47gold_clip[id] > 0 && pev_valid(ActiveItem)) {
		if(is_user_alive(id) && get_user_ak47gold(id)) {
			set_pdata_int(ActiveItem, 57, Shell, 4) ;
			set_pdata_float(id, 111, get_gametime());
			
			new Float:Push[3];
			pev(id,pev_punchangle,Push);
			xs_vec_sub(Push,cl_pushangle[id],Push);
			
			xs_vec_mul_scalar(Push,get_pcvar_float(ak47goldrecoil),Push);
			xs_vec_add(Push,cl_pushangle[id],Push);
			set_pev(id,pev_punchangle,Push);
			
			emit_sound(id, CHAN_WEAPON, AK47Gold_Sound[random_num(0,1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
			set_weapon_anim(id, random_num(3,5));
		}
	}
}

public AK47Gold_Reload(ent) {
	if(!pev_valid(ent))
		return HAM_IGNORED;
	
	new id;
	id = pev(ent, pev_owner);
	
	if(!is_user_alive(id) || !get_user_ak47gold(id))
		return HAM_IGNORED;
	
	ak47gold_clip[id] = -1;
	
	new Ammo = cs_get_user_bpammo(id, CSW_AK47GOLD);
	if(Ammo <= 0)
		return HAM_SUPERCEDE;
	
	new Clip = get_pdata_int(ent, 51, 4);
	if(Clip >= get_pcvar_num(ak47goldclip))
		return HAM_SUPERCEDE;
	
	ak47gold_clip[id] = Clip;
	ak47gold_reload[id] = 1;
	
	return HAM_IGNORED;
}

public AK47Gold_Reload_Post(ent) {
	if(!pev_valid(ent))
		return HAM_IGNORED;
	
	new id;
	id = pev(ent, pev_owner);
	
	if(!is_user_alive(id) || !get_user_ak47gold(id))
		return HAM_IGNORED;
	
	if(ak47gold_clip[id] == -1)
		return HAM_IGNORED;
	
	new Float:reload_time = get_pcvar_float(ak47goldreloadtime);
	
	set_pdata_int(ent, 51, ak47gold_clip[id], 4);
	set_pdata_float(ent, 48, reload_time, 4);
	set_pdata_float(id, 83, reload_time, 5);
	set_pdata_int(ent, 54, 1, 4);
	set_weapon_anim(id, 1);
	return HAM_IGNORED;
}

public AK47Gold_PostFrame(ent) {
	if(!pev_valid(ent))
		return HAM_IGNORED;
	
	new id;
	id = pev(ent, pev_owner);
	
	if(!is_user_alive(id) || !get_user_ak47gold(id))
		return HAM_IGNORED;
	
	new Float:NextAttack = get_pdata_float(id, 83, 5);
	new Ammo = cs_get_user_bpammo(id, CSW_AK47GOLD);
	
	new Clip = get_pdata_int(ent, 51, 4);
	new InReload = get_pdata_int(ent, 54, 4);
	
	if(InReload && NextAttack <= 0.0) {
		new Temp = min(get_pcvar_num(ak47goldclip) - Clip, Ammo);
		
		set_pdata_int(ent, 51, Clip + Temp, 4);
		cs_set_user_bpammo(id, CSW_AK47GOLD, Ammo - Temp);		
		set_pdata_int(ent, 54, 0, 4);
		
		InReload = 0;
		ak47gold_reload[id] = 0;
	}		
	
	return HAM_IGNORED;
}

public Hook_AK47Gold(id) {
	engclient_cmd(id, weapon_ak47gold);
}

public get_user_ak47gold(id) {
	return HaveAK47Gold[id];
}

public set_user_ak47gold(id, ak47gold) {
	if(ak47gold) {
		if(!HaveAK47Gold[id]) {
			HaveAK47Gold[id] = true;
			ak47gold_reload[id] = 0;
			fm_give_item(id, weapon_ak47gold);
			new Clip = fm_get_user_weapon_entity(id, CSW_AK47GOLD);
			cs_set_weapon_ammo(Clip, get_pcvar_num(ak47goldclip));
			cs_set_user_bpammo(id, CSW_AK47GOLD, 200);
		}
	}
	else {
		if(HaveAK47Gold[id]) {
			HaveAK47Gold[id] = false;
		}
	}
}

stock Make_Bullet(id, Float:Origin[3]) {
	// Find target
	new target, body;
	get_user_aiming(id, target, body, 999999);
	
	if(target > 0 && target <= get_maxplayers()) {
		new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3];
		pev(id, pev_origin, fStart);
		
		velocity_by_aim(id, 64, fVel);
		
		fStart[0] = Origin[0];
		fStart[1] = Origin[1];
		fStart[2] = Origin[2];
		fEnd[0] = fStart[0]+fVel[0];
		fEnd[1] = fStart[1]+fVel[1];
		fEnd[2] = fStart[2]+fVel[2];
		
		new res;
		engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res);
		get_tr2(res, TR_vecEndPos, fRes);
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY) ;
		write_byte(TE_BLOODSPRITE);
		write_coord(floatround(fStart[0]));
		write_coord(floatround(fStart[1]));
		write_coord(floatround(fStart[2]));
		write_short(BloodSpray);
		write_short(BloodDrop);
		write_byte(70);
		write_byte(random_num(1,2));
		message_end();
		
		
	} 
	else {
		new decal = 41;
		
		if(target) {
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
			write_byte(TE_DECAL);
			write_coord(floatround(Origin[0]));
			write_coord(floatround(Origin[1]));
			write_coord(floatround(Origin[2]));
			write_byte(decal);
			write_short(target);
			message_end();
		} 
		else {
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
			write_byte(TE_WORLDDECAL);
			write_coord(floatround(Origin[0]));
			write_coord(floatround(Origin[1]));
			write_coord(floatround(Origin[2]));
			write_byte(decal);
			message_end();
		}
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(TE_GUNSHOTDECAL);
		write_coord(floatround(Origin[0]));
		write_coord(floatround(Origin[1]));
		write_coord(floatround(Origin[2]));
		write_short(id);
		write_byte(decal);
		message_end();
	}
}

stock set_weapon_anim(id, anim) {
	set_pev(id, pev_weaponanim, anim);
	if(is_user_connected(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:damage) {
	switch(body) {
		case HIT_HEAD:
			damage *= 1.3;
		case HIT_STOMACH: 
			damage *= 1.0;
		case HIT_CHEST: 
			damage *= 1.1;
		case HIT_LEFTARM: 
			damage *= 0.7;
		case HIT_RIGHTARM: 
			damage *= 0.7;
		case HIT_LEFTLEG: 
			damage *= 0.75;
		case HIT_RIGHTLEG: 
			damage *= 0.75;
		default: 
		damage *= 1.0;
	}
	
	return floatround(damage);
}
User avatar
interlude
Membru, skill 0
Membru, skill 0
Posts: 35
Joined: 18 Aug 2012, 21:16
Detinator Steam: Da
CS Status: Injur de dulce!
Detinator server CS: Hero.CS1.Ro
SteamID: tomy_sile
Location: Lawrence, Kansas
Been thanked: 2 times
Contact:

01 Jan 2014, 15:09

Cei doi prieteni :))
Contact:
http://www.facebook.com/Forward.Interlude
Y!M: Interlude_Ciprian
Game_Forc3

Skype: Interlude.CounterStrike

Image
mezzzu
Membru eXtream
Membru eXtream
Posts: 2235
Joined: 19 Dec 2010, 17:31
Detinator Steam: Da
CS Status: Working...
Reputatie: Utilizator neserios (tepar)
Fost manager FURIEN.EXTREAMCS.COM
Restrictie moderator
Has thanked: 85 times
Been thanked: 136 times

01 Jan 2014, 17:20

interlude wrote:Cei doi prieteni :))
:"> ...

@ Mersi Mihai
Post Reply

Return to “Cereri”

  • Information