Raised This Month: $ Target: $400
 0% 

Help to make a fast reload shotguns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
artist
Member
Join Date: Nov 2013
Old 01-07-2015 , 19:25   Help to make a fast reload shotguns
Reply With Quote #1

Very quickly recharged shotguns...

My attempts:

Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define m_pPlayer       41 #define m_fInReload         54 #define m_flNextReload      75 #define m_fInSpecialReload  55 #define m_flTimeWeaponIdle  48 #define m_flNextAttack      83 #define m_flNextPrimaryAttack   46 #define m_flNextSecondaryAttack 47 public plugin_init() {     RegisterHam(Ham_Weapon_Reload, "weapon_m3", "reload_shotguns", 1)     RegisterHam(Ham_Weapon_Reload, "weapon_xm1014", "reload_shotguns", 1) } public reload_shotguns(ent) {     static id; id = get_pdata_cbase(ent, m_pPlayer, 4)     static Float:time_reload; time_reload = 0.5     static special; special = get_pdata_int(ent, m_fInSpecialReload, 4)         if(!special)     {         time_reload *= get_pdata_float(id, m_flNextAttack, 5)         set_pdata_int(ent, m_fInSpecialReload, 1, 4)         set_pdata_float(id, m_flNextAttack, time_reload, 5)         set_pdata_float(ent, m_flTimeWeaponIdle, time_reload, 4)         set_pdata_float(id, m_flNextPrimaryAttack, time_reload, 5)         set_pdata_float(id, m_flNextSecondaryAttack, time_reload, 5)     }     else if(special == 1)     {         time_reload *= get_pdata_float(ent, m_flNextReload, 4)         set_pdata_int(ent, m_fInSpecialReload, 2, 4)         set_pdata_float(ent, m_flNextReload, time_reload, 4)         set_pdata_float(ent, m_flTimeWeaponIdle, time_reload, 4)     }     else set_pdata_int(ent, m_fInSpecialReload, 1, 4)     return HAM_SUPERCEDE }

Mainly affects:
Code:
set_pdata_int(ent, m_fInSpecialReload, 2, 4)

How to make that?

Last edited by artist; 01-07-2015 at 19:32.
artist is offline
Kuma77
Senior Member
Join Date: Sep 2014
Location: Behind PC
Old 01-08-2015 , 04:38   Re: Help to make a fast reload shotguns
Reply With Quote #2

Try this, its not tested yet


PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>



const LINUX_OFFSET_WEAPONS            4
const m_flNextAttack                148
const m_pPlayer                        28
const m_fInSpecialReload            34
const m_flNextPrimaryAttack            35
const m_flNextSecondaryAttack        36
const m_flTimeWeaponIdle            37


public plugin_init()
{
    
RegisterHam(Ham_Weapon_Reload"weapon_m3""reload_shotguns"1)
    
RegisterHam(Ham_Weapon_Reload"weapon_xm1014""reload_shotguns"1)
}
public 
reload_shotguns(const shotguns)
{
        new 
player get_pdata_cbase(shotgunsm_pPlayerLINUX_OFFSET_WEAPONS)
    
    
set_pdata_float(player m_flNextAttack2.0)
    
set_pdata_float(shotgunsm_flTimeWeaponIdle     2.9LINUX_OFFSET_WEAPONS)
    
set_pdata_float(shotgunsm_flNextPrimaryAttack  2.1LINUX_OFFSET_WEAPONS)
    
set_pdata_float(shotgunsm_flNextSecondaryAttack2.1LINUX_OFFSET_WEAPONS)

__________________
SPACE TIME
Kuma77 is offline
Reply


Thread Tools
Display Modes

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 15:32.


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