Raised This Month: $12 Target: $400
 3% 

Remove C4


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

Quote:
Originally Posted by ConnorMcLeod View Post
OMG don't hook CmdStart for this lol !!!
Yo, that code is 4 years old. Give me a break, lol.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-20-2012 , 11:24   Re: Remove C4
Reply With Quote #12

What is the best? Connor, can you add a cvar for enable/disable?
__________________

Last edited by kramesa; 01-20-2012 at 11:24.
kramesa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-20-2012 , 13:18   Re: Remove C4
Reply With Quote #13

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
briancmccoy
Junior Member
Join Date: Apr 2013
Old 04-20-2013 , 03:17   Re: Remove C4
Reply With Quote #14

Include this line #include <amxmisc> in source code else compiling gives error

/tmp/textaKu2rM.sma(36) : error 017: undefined symbol "cmd_access" /tmp/textaKu2rM.sma(45) : error 017: undefined symbol "cmd_access" 2 Errors. Could not locate output file /home/groups/amxmodx/public_html/websc3/textaKu2rM.amx (compile failed).
briancmccoy is offline
Reply



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 11:54.


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