AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Reload Speed (https://forums.alliedmods.net/showthread.php?t=107644)

ujjl 10-28-2009 15:23

[HELP] Reload Speed
 
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.)


All times are GMT -4. The time now is 17:42.

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