Raised This Month: $ Target: $400
 0% 

Brass Knuckles adding "kick"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 07-11-2006 , 02:29   Brass Knuckles adding "kick"
Reply With Quote #1

Hey guys just wondering if you could tell me why the plugin below isnt 'kicking' the person that gets hit with them..like its suposed to be like a real punch.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>

new PLUGIN_NAME[] =    "Brass Knuckles"
new PLUGIN_VERSION[] =     "1.0"
new PLUGIN_AUTHOR[] =    "Cheap_Suit"

new bool:g_bknuckles[33]
public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
register_event("Damage""Event_Damage""be""2!0")
    
register_event("DeathMsg""Event_Death""a")
    
register_forward(FM_EmitSound"EmitSound")
}

public 
plugin_precache()
{
    
precache_model("models/p_bknuckles.mdl")
    
precache_model("models/v_bknuckles.mdl")
    
precache_sound("bknuckles/knife_hit1.wav")
    
precache_sound("bknuckles/knife_hit2.wav")
    
precache_sound("bknuckles/knife_hit3.wav")
    
precache_sound("bknuckles/knife_hit4.wav")
    
precache_sound("bknuckles/knife_stab.wav")
}

public 
client_connect(idg_bknuckles[id] = false
public Event_Death() g_bknuckles[read_data(2)] = false

public Event_Damage(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
PLUGIN_CONTINUE

    
new AttakerWeaponAttakerPartHit
    
new Attacker get_user_attacker(idAttakerWeaponAttakerPartHit)

    if(
AttakerWeapon != CSW_KNIFE)
        return 
PLUGIN_CONTINUE

    
if(!g_bknuckles[Attacker])
        return 
PLUGIN_CONTINUE

    
new Float:Random_Float[3]
    for(new 
03i++) Random_Float[i] = random_float(100.0150.0)
    
Punch_View(idRandom_Float)

    return 
PLUGIN_CONTINUE
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
PLUGIN_CONTINUE

    
new temp[2], weapon get_user_weapon(idtemp[0], temp[1])
    if(
weapon == CSW_KNIFE)
    {
        
entity_set_string(idEV_SZ_viewmodel"models/v_bknuckles.mdl")
        
entity_set_string(idEV_SZ_weaponmodel"models/p_bknuckles.mdl")
    }
    return 
PLUGIN_CONTINUE
}

public 
EmitSound(idchannelsample[])
{
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
FMRES_IGNORED

    
new temp[2], weapon get_user_weapon(idtemp[0], temp[1])
    if(
weapon == CSW_KNIFE)
    {
        if(
g_bknuckles[id])
        {
            if(
equal(sample,"weapons/knife_hit1.wav"))
            {
                
emit_sound(idCHAN_WEAPON"bknuckles/knife_hit1.wav"1.0ATTN_NORM0PITCH_NORM)
                return 
FMRES_SUPERCEDE
            
}
            else if(
equal(sample,"weapons/knife_hit2.wav"))
            {
                
emit_sound(idCHAN_WEAPON"bknuckles/knife_hit2.wav"1.0ATTN_NORM0PITCH_NORM)
                return 
FMRES_SUPERCEDE
            
}
            else if(
equal(sample,"weapons/knife_hit3.wav"))
            {
                
emit_sound(idCHAN_WEAPON"bknuckles/knife_hit3.wav"1.0ATTN_NORM0PITCH_NORM)
                return 
FMRES_SUPERCEDE
            
}
            else if(
equal(sample,"weapons/knife_hit4.wav"))
            {
                
emit_sound(idCHAN_WEAPON"bknuckles/knife_hit4.wav"1.0ATTN_NORM0PITCH_NORM)
                return 
FMRES_SUPERCEDE
            
}
            else if(
equal(sample,"weapons/knife_stab.wav"))
            {
                
emit_sound(idCHAN_WEAPON"bknuckles/knife_stab.wav"1.0ATTN_NORM0PITCH_NORM)
                return 
FMRES_SUPERCEDE
            
}
        }
    }
    return 
FMRES_IGNORED
}

stock Punch_View(idFloat:ViewAngle[3])
{
    
entity_set_vector(idEV_VEC_punchangleViewAngle)

SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
 



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 08:04.


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