Raised This Month: $ Target: $400
 0% 

[HELP] Reload Speed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ujjl
Senior Member
Join Date: Jul 2009
Location: Hungary
Old 10-28-2009 , 15:23   [HELP] Reload Speed
Reply With Quote #1

Hi! I want to speed up the reload speed in Half-Life. In my case for shotgun and crossbow.

Here is the code, where i stucked:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

//offsets
const m_pPlayer                  28
//const m_iId                = 30    //?
const m_flNextPrimaryAttack    35
const m_flNextSecondaryAttack  36
//const m_flTimeWeaponIdle     = 37
const m_fInReload                43
//const m_flNextAttack         = ??

const Float:reload_speed 0.2    // default: 4.5

public plugin_init()
{
    
register_plugin("Reload Speed""0.0.1""ujjl")
    
RegisterHam(Ham_Item_PostFrame"weapon_crossbow""Item_PostFrame_Post"1)
    
//RegisterHam(Ham_Weapon_Reload, "weapon_shotgun", "fwd_Reload",1)

}



public 
Item_PostFrame_Post(Entity)
{    
    if( 
get_pdata_int(Entitym_fInReload4) )
    {
    new 
player_id get_pdata_cbase(Entitym_pPlayer4)    //who are reloading
    
    
client_print(player_id,print_chat,"You are reloading your crossbow.")
    
    
/*
        set_pdata_float(player_id, m_flNextAttack, crossbow_reload_speed, 5)
        set_pdata_float(iEnt, m_flTimeWeaponIdle, crossbow_reload_speed , 4)
    */
     
    
}

Feel free to edit.

Can you help me find the m_flTimeWeaponIdle and m_flNextAttack offsets? (Or making this code to work.)
ujjl 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 17:42.


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