Raised This Month: $ Target: $400
 0% 

Need Some Help I Got A problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 08-11-2009 , 12:10   Re: Need Some Help I Got A problem
Reply With Quote #5

Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <gunxpmod>
#include <xs>

new PLUGIN_NAME[] 	= "Unlock : Baseball Bat"
new PLUGIN_AUTHOR[] 	= "DoviuX"
new PLUGIN_VERSION[] 	= "1.0"

new g_KnockBack
new g_baseballbat

new const BAT_MDL[] = 	"models/UmbrellaSwarm/v_BaseBallBat.mdl";

new bool:g_BASEBALLBAT[33] 

public plugin_init()
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
	register_gxm_item("BaseBall Bat", "Big KnockBack", 80)

    	g_KnockBack = register_cvar("gxm_bat_knockback", "100")
	register_event("CurWeapon",	"Event_CurWeaponbat", "be", "1=1")

    	RegisterHam(Ham_TakeDamage, "player", "Player_TakeDamage", 1)

}
public plugin_precache()  
{
	engfunc(EngFunc_PrecacheModel, BAT_MDL);
}
public gxm_item_enabled(id) {
	g_BASEBALLBAT[id] = true
}
public client_connect(id) 
{
	g_BASEBALLBAT[id] = false
}
public Event_CurWeaponbat(id) 
{
	if (!g_BASEBALLBAT[id])
	return PLUGIN_CONTINUE;

	new Gun = read_data(2) 
	
	if( Gun == CSW_KNIFE)
	{
		set_pev(id, pev_viewmodel2, BAT_MDL)
	}
	return PLUGIN_CONTINUE;
}
public Player_TakeDamage(id, inflictor, attacker, Float:flDamage, damagebits)
{
    if(    !attacker
    ||    id == attacker
    ||    inflictor != attacker//    )
    ||    get_user_weapon(attacker) != g_baseballbat    )
    {
        return
    }

    new Float:fDir[3], Float:fOrigin[3], Float:fVelocity[3]

    pev(id, pev_origin, fDir)
    pev(attacker, pev_origin, fOrigin)

    xs_vec_sub(fDir, fOrigin, fDir)
    xs_vec_normalize(fDir, fDir)

    flDamage *= get_pcvar_num(g_KnockBack)
    if( flDamage > 1500.0 )
        flDamage = 1500.0

    pev(id, pev_velocity, fVelocity)
    xs_vec_mul_scalar(fDir, flDamage, fDir)
    xs_vec_add(fVelocity, fDir, fVelocity)
    set_pev(id, pev_velocity, fVelocity)
}
?
DoviuX is offline
Send a message via Skype™ to DoviuX
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode