Raised This Month: $ Target: $400
 0% 

Blocking weapon fire, cvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
J4CK
Member
Join Date: Dec 2008
Location: India
Old 08-01-2011 , 16:10   Blocking weapon fire, cvar
Reply With Quote #1

I found plugin by ConnorMcLeod (source: #47)
But i can't add cvar for enable/disable.
What's wrong ?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

// weapons offsets
#define XO_WEAPONS 4
#define m_pPlayer 41
#define m_iId 43
#define m_flNextPrimaryAttack 46
#define m_flNextSecondaryAttack 47

// players offsets
#define XO_PLAYER 5
#define m_flNextAttack 83

public plugin_init()
{
    
register_cvar("amx_nodamage""0")

    new 
szWeaponName[20]
    for(new 
i=CSW_P228i<=CSW_P90i++)
    {
        if( 
get_weaponname(iszWeaponNamecharsmax(szWeaponName)) && get_cvar_num("amx_nodamage") == )
        {
            
RegisterHam(Ham_Item_DeployszWeaponName"Weapons_Deploy"true)
        }
    }
}

public 
Weapons_Deploy(iWeapon)
{

    new 
id get_pdata_cbase(iWeaponm_pPlayerXO_WEAPONS)
    new 
iId get_pdata_int(iWeaponm_iIdXO_WEAPONS)
    
set_pdata_float(iWeaponm_flNextPrimaryAttack99999.0XO_WEAPONS)
    
set_pdata_float(iWeaponm_flNextSecondaryAttack99999.0XO_WEAPONS)
    
set_pdata_float(idm_flNextAttack99999.0XO_PLAYER)

J4CK 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 03:27.


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