This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Remove C4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 07-18-2008 , 17:20   Remove C4
Reply With Quote #1

Does anyone know how to script a plugin to block a c4 from the terrorist? Or if there is a plugin where it restricts the c4 from being planted? Please Help :'(
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-18-2008 , 18:22   Re: Remove C4
Reply With Quote #2

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

public plugin_init()
{
    
register_plugin("Can't Plant C4""0.1""Exolent");
    
register_forward(FM_CmdStart"FwdCmdStart"0);
    
    return 
PLUGIN_CONTINUE;
}

public 
FwdCmdStart(plruc_handleseed)
{
    static 
clipammo;
    if( !
is_user_alive(plr)
    || 
get_user_weapon(plrclipammo) != CSW_C4 )
    {
        return 
FMRES_IGNORED;
    }
    
    new 
buttons get_uc(uc_handleUC_Buttons);
    if( 
buttons&IN_ATTACK )
    {
        
buttons &= ~IN_ATTACK;
        
set_uc(uc_handleUC_Buttonsbuttons);
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-20-2008 , 15:23   Re: Remove C4
Reply With Quote #3

Does this remove the C4?
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Old 08-20-2008, 15:29
DruGzOG
This message has been deleted by DruGzOG. Reason: My Mistake
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-20-2008 , 17:23   Re: Remove C4
Reply With Quote #4

If the terrorist has the c4 out, he cannot plant.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 08-22-2008 , 09:15   Re: Remove C4
Reply With Quote #5

Alright, Sweet Thanks +karma
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-17-2012 , 18:03   Re: Remove C4
Reply With Quote #6

Can add cvar for enable/disable?
__________________
kramesa is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-18-2012 , 16:40   Re: Remove C4
Reply With Quote #7

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

new bool:gEnabled true;

public 
plugin_init()
{
    
register_plugin("Can't Plant C4""0.1""Exolent");
    
    
register_concmd("c4_enable""CmdEnable"ADMIN_RCON"Allows C4 to be planted");
    
register_concmd("c4_disable""CmdDisable"ADMIN_RCON"Stops C4 from being planted");
    
    
register_forward(FM_CmdStart"FwdCmdStart"0);
}

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 == gEnabled)
    {
        
console_print(id"C4 is already %sabled."enabled "en" "dis");
    }
    else
    {
        
gEnabled enabled;
        
console_print(id"C4 is now %sabled."enabled "en" "dis");
    }
}

public 
FwdCmdStart(plruc_handleseed)
{
    static 
clipammo;
    if( !
gEnabled
    
|| !is_user_alive(plr)
    || 
get_user_weapon(plrclipammo) != CSW_C4 )
    {
        return 
FMRES_IGNORED;
    }
    
    new 
buttons get_uc(uc_handleUC_Buttons);
    if( 
buttons&IN_ATTACK )
    {
        
buttons &= ~IN_ATTACK;
        
set_uc(uc_handleUC_Buttonsbuttons);
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 01-20-2012, 10:47
kramesa
This message has been deleted by kramesa.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-20-2012 , 10:53   Re: Remove C4
Reply With Quote #8

Quote:
Originally Posted by kramesa View Post
Dont works
You realize that it's not a cvar, but a command. Right?
__________________
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 , 10:57   Re: Remove C4
Reply With Quote #9

Man, sorry, i used c4_enable for enables plant c4 -.-

thanks.
__________________
kramesa is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-20-2012 , 11:08   Re: Remove C4
Reply With Quote #10

OMG don't hook CmdStart for this lol !!!

Set g_bCanPlantC4 anywhere and under any conditions you want :

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

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_c4""CC4_PrimaryAttack")
}

public 
CC4_PrimaryAttackiC4 )
{
    if( !
g_bCanPlantC4 )
    {
        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
    
}
    return 
HAM_IGNORED

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-20-2012 at 11:10.
ConnorMcLeod 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 17:41.


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