Raised This Month: $ Target: $400
 0% 

Remove C4


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-20-2012 , 13:18   Re: Remove C4
Reply With Quote #14

Here is Connor's method with my commands:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
// #include <cstrike>

#define VERSION "0.0.1"
#define PLUGIN ""

const XO_WEAPON 4

const m_pPlayer 41
const m_flNextPrimaryAttack 46

new bool:g_bCanPlantC4
new HamHook:g_hhC4PrimaryAttack

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
g_hhC4PrimaryAttack RegisterHam(Ham_Weapon_PrimaryAttack"weapon_c4""CC4_PrimaryAttack")
    
    
register_concmd("c4_enable""CmdEnable"ADMIN_RCON"Allows C4 to be planted");
    
register_concmd("c4_disable""CmdDisable"ADMIN_RCON"Stops C4 from being planted");
}

public 
CC4_PrimaryAttackiC4 )
{
    new 
id get_pdata_cbase(iC4m_pPlayerXO_WEAPON)
    
client_print(idprint_chat"C4 is actually disabled !!")
    
set_pdata_float(iC4m_flNextPrimaryAttack1.0XO_WEAPON)
    return 
HAM_SUPERCEDE
}

public 
CmdEnable(idlevelcid)
{
    if(
cmd_access(idlevelcid1))
    {
        
setEnabled(idtrue);
    }
    return 
PLUGIN_HANDLED;
}

public 
CmdDisable(idlevelcid)
{
    if(
cmd_access(idlevelcid1))
    {
        
setEnabled(idfalse);
    }
    return 
PLUGIN_HANDLED;
}

setEnabled(idbool:enabled)
{
    if(
enabled == g_bCanPlantC4)
    {
        
console_print(id"C4 is already %sabled."enabled "en" "dis");
    }
    else
    {
        
g_bCanPlantC4 enabled;
        
        if(
enabledEnableHamForward(g_hhC4PrimaryAttack)
        else        
DisableHamForward(g_hhC4PrimaryAttack)
        
        
console_print(id"C4 is now %sabled."enabled "en" "dis");
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 00:43.


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