Raised This Month: $ Target: $400
 0% 

[HELP] Problem with Putting Recoil on Glock


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-04-2017 , 06:20   Re: [HELP] Problem with Putting Recoil on Glock
Reply With Quote #3

Hey Crazy.! Thanks for the reply. I did what you said but now some of the bullet holes are scattered behind me. I must've made a mistake but I can't find it. Here's what I did:
PHP Code:
#define m_pPlayer 41
...
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_glock18""Fw_PrimaryAttack_Pre");
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_glock18""Fw_PrimaryAttack_Post"1);
...
public 
Fw_PrimaryAttack_Pre(weapon_ent)
{
    if(!
cs_get_weapon_ammo(weapon_ent))
        return 
HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
Fw_PrimaryAttack_Post(weapon_ent)
{
    if (!
pev_valid(weapon_ent))
        return;
    
    new 
id get_pdata_cbase(weapon_entm_pPlayer4)
    
    if (!
is_user_alive(id))
        return;
    
    
set_pev(idpev_punchangleget_pcvar_float(cvar_glock_recoil));

Also, I see this code all the time:
PHP Code:
pev_valid 
But never knew what it is for. The API says it Checks the validity of an entity. But validity for what?....
__________________
hellmonja is offline
 



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 23:09.


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