Raised This Month: $ Target: $400
 0% 

Issue with CHEGrenade::SecondaryAttack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CVarsMaster
Junior Member
Join Date: Mar 2009
Old 01-25-2013 , 23:03   Issue with CHEGrenade::SecondaryAttack
Reply With Quote #1

On windows this works rights, pressing the right click I can execute the related function, but on linux it just works 1 time and after that I ALSO can't throw a nade, but on windows it works like a charm

PHP Code:
// CBasePlayerItem
const XO_CBASEPLAYERITEM 4
const m_pPlayer 41

// CBasePlayer
const XO_CBASEPLAYER 5
const m_pClientActiveItem =     374

// CBaseMonster
const XO_CBASEMONSTER 5
const m_flNextAttack 83

// CBaseEntity
const XO_CBASEENTITY 3
const m_flStartThrow 30

// CBasePlayerWeapon
const XO_CBASEPLAYERWEAPON 4
const m_flNextSecondaryAttack 47

// plugin_init:
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_hegrenade""OnHESecondaryAttack")

public 
OnHESecondaryAttack(hegrenade)
{
    if(
get_pdata_float(hegrenadem_flStartThrowXO_CBASEENTITY) > 0.0// is this right? trying to check if grenade is not ready to throw
        
return HAM_IGNORED
        
    
new id get_pdata_cbase(hegrenadem_pPlayerXO_CBASEPLAYERITEM)
    
    if(!(
<= id <= g_maxplayers))
        return 
HAM_IGNORED
    
    ExecuteHamB
(Ham_Item_Holsterhegrenade0// trying to do a weapon switch
    
set_pdata_cbase(idm_pClientActiveItem, -1XO_CBASEPLAYERWEAPON)
    
ExecuteHamB(Ham_Item_Deployhegrenade)
    
    
set_pdata_float(idm_flNextAttack0.3XO_CBASEMONSTER// a delay of 0.3
    
set_pdata_float(hegrenadem_flNextSecondaryAttack0.3XO_CBASEPLAYERWEAPON)
    
    
client_print(idprint_center"Pressed the button at %.2f"get_gametime())
    
    return 
HAM_SUPERCEDE// prevent supposed shield functions

EDIT: I've noticed that i set the wrong linux offset for ClientActiveItem, i was reseting ActiveItem and that was causing that i wasn't able to throw and those things. Thanks anyway

Last edited by CVarsMaster; 01-26-2013 at 01:23.
CVarsMaster is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-26-2013 , 04:08   Re: Issue with CHEGrenade::SecondaryAttack
Reply With Quote #2

m_pClientActiveItem +5
m_flNextAttack + 5
__________________
Arkshine 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 02:27.


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