Raised This Month: $ Target: $400
 0% 

Changing V_model Animation - Kinda buggy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-30-2010 , 16:02   Changing V_model Animation - Kinda buggy
Reply With Quote #1

Well, another problem.

Global:
PHP Code:
new loaded[33
Register:
PHP Code:
    RegisterHam(Ham_Weapon_Deploy"weapon_knife""knife_deploy");
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_knife""knife_attack");
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_knife""knife_attack2"); 

PHP Code:
public knife_deploy( const iEntity ) {
            new 
id get_pdata_cbaseiEntitym_pPlayer)
        
entity_set_string(idEV_SZ_viewmodel"models/v_rpg.mdl")
        
entity_set_string(idEV_SZ_weaponmodel"models/p_rpg.mdl")
        if(
loaded[id])//if is loaded
        
{
            
set_pdata_floatiEntitym_flNextSecondaryAttack99999.0); // disable loading
            
set_pdata_floatiEntitym_flNextPrimaryAttack0.5); // enable firing
            
message_begin(MSG_ONESVC_WEAPONANIM_id)///set animation
            
write_byte(0//idle1
            
write_byte(pev(id,pev_body))
            
message_end()
                    }
        if(!
loaded[id])// if is unloaded
        
{
            
set_pdata_floatiEntitym_flNextSecondaryAttack0.5); // enable loading
            
set_pdata_floatiEntitym_flNextPrimaryAttack9999.0); // disable firing
            
message_begin(MSG_ONESVC_WEAPONANIM_id)///set animation
            
write_byte(8//idle2
            
write_byte(pev(id,pev_body))
            
message_end()  
        }


        
}

public 
knife_attack( const iEntity ) {
    new 
id get_pdata_cbaseiEntitym_pPlayer)
        
loaded[id] = 0
        set_task
(2.0"check_bazooka"id// set idle2 anim.
        
message_begin(MSG_ONESVC_WEAPONANIM_id// set animation 
        
write_byte(3//fire
        
write_byte(pev(id,pev_body))
        
message_end()  
        
fire_rocket(id)//fire rocket
        
set_pdata_floatiEntitym_flNextSecondaryAttack3.0); /// enable loading
        
set_pdata_floatiEntitym_flNextPrimaryAttack99999.0); // disable firing
        
emit_sound(idCHAN_VOICE"weapons/glauncher.wav"VOL_NORMATTN_NORM0PITCH_NORM)
        
}

public 
knife_attack2( const iEntity ) {
            new 
id get_pdata_cbaseiEntitym_pPlayer)    
        
loaded[id] = // is loaded
        
set_task(2.5"check_bazooka"id// set idle animation
         
set_pdata_floatiEntitym_flNextSecondaryAttack9999.0); // disable loading
        
set_pdata_floatiEntitym_flNextPrimaryAttack2.5); // enable firing
        
message_begin(MSG_ONESVC_WEAPONANIM_id)/// set animation
        
write_byte(2///reload
        
write_byte(pev(id,pev_body))
        
message_end()  
        


Sometimes animation gets bugged and sometimes (ussualy, when I'm ducking or running backward) instead of reloading it plays draw2 animation.
Is there any other method to do this? SVC_WEAPONANIM is kinda buggy .
Gadzislaw007 is offline
Reply



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 00:18.


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