Raised This Month: $ Target: $400
 0% 

How do stop defusing bomb[solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zwfgdlc
Senior Member
Join Date: May 2006
Old 02-22-2009 , 13:26   How do stop defusing bomb[solved]
Reply With Quote #1

How do stop defusing bomb.sorry for my english.
PHP Code:
register_event("BarTime""event_function""be""1=5""1=10")
public 
event_function(id)
{
       
//how do stop?


Last edited by zwfgdlc; 02-23-2009 at 11:19.
zwfgdlc is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 02-22-2009 , 21:54   Re: How do stop defusing bomb
Reply With Quote #2

PHP Code:
 register_forward(FM_PlayerPreThink,"block_buttons"); 
PHP Code:
public block_buttons(id)
{
 if( 
== )
 {
  return 
1;
 }else{
  
set_pevidpev_buttonpev(id,pev_button) & ~IN_USE); }
 return 
1;

BOYSplayCS is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-22-2009 , 23:27   Re: How do stop defusing bomb
Reply With Quote #3

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

#define PLUGIN "Block Defuse"
#define VERSION "1.0"
#define AUTHOR "bugsy"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_logevent("bomb_defuse"3"2=Begin_Bomb_Defuse_Without_Kit");
    
register_logevent("bomb_defuse"3"2=Begin_Bomb_Defuse_With_Kit");
}

public 
bomb_defuse()
{
    new 
id get_loguser_index();
    
client_cmd(id,"-use");
}

stock get_loguser_index() 
{
    new 
szLoguser[64], szName[32];
    
read_logargv(0szLogusersizeof szLoguser 1);
    
parse_loguser(szLoguserszNamesizeof szName 1);
    
    return 
get_user_index(szName);

__________________

Last edited by Bugsy; 02-22-2009 at 23:30.
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-23-2009 , 03:11   Re: How do stop defusing bomb
Reply With Quote #4

What you want to do, stop a player from defusing or prevent a player from defusing ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 02-23-2009 , 03:25   Re: How do stop defusing bomb
Reply With Quote #5

@Connor
i want to stop a player from defusing.or set the player don't defuse bomb.
i try this.
PHP Code:
register_event("BarTime""event_function""be""1=5""1=10"
public 
event_function(id

       
client_cmd(id,"-use");

but the method have bug.
zwfgdlc is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 02-23-2009 , 03:36   Re: How do stop defusing bomb
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Block Defuse"
#define VERSION "1.0"
#define AUTHOR "bugsy"


public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_logevent("bomb_defuse"3"2=Begin_Bomb_Defuse_Without_Kit");
    
register_logevent("bomb_defuse"3"2=Begin_Bomb_Defuse_With_Kit");
}

public 
bomb_defuse()
{
    new 
id get_loguser_index();
    
client_cmd(id,"-use");
}

stock get_loguser_index() 
{
    new 
szLoguser[64], szName[32];
    
read_logargv(0szLogusersizeof szLoguser 1);
    
parse_loguser(szLoguserszNamesizeof szName 1);
    
    return 
get_user_index(szName);

thanks.but the method have bug,if the player fast double press "E" key,do not stop the player from defuing.
zwfgdlc is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-23-2009 , 04:15   Re: How do stop defusing bomb
Reply With Quote #7

For both, basically, supercede forward Ham_Use with "grenade" entities should work.

PHP Code:
/*    Copyright © 2009, ConnorMcLeod

    Bomb Defusion is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Bomb Defusion; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

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

#define PLUGIN "Bomb Defusion"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define MAX_PLAYERS    32

new g_iDefuser
new g_bCantDefuse[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    if( !
engfuncEngFunc_FindEntityByString FM_NULLENT "classname" "func_bomb_target" )
    &&  !
engfuncEngFunc_FindEntityByString FM_NULLENT "classname" "info_bomb_target" )  )
    {
        
pause("ad")
        return
    }

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")

    
RegisterHam(Ham_Use"grenade""C4_Use")

    
register_concmd("stop_defuse""Command_StopDefuse"ADMIN_KICK)
}

public 
client_putinserverid )
{
    
g_bCantDefuseid ] = false
}

public 
Event_HLTV_New_Round()
{
    
g_iDefuser 0
}

public 
C4_Use(iC4ididactivatoruse_typeFloat:value)
{
    if( 
use_type != || value != 1.0 || get_user_team(id) != )
    {
        return 
HAM_IGNORED
    
}

    
g_iDefuser id

    
if( g_bCantDefuse[g_iDefuser] )
    {
        return 
HAM_SUPERCEDE
    
}

    return 
HAM_IGNORED
}

public 
Command_StopDefuse(idlevel)
{
    if( !(
get_user_flags(id) & level) )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
plr
    
if( read_argc() == )
    {
        new 
szArg[32]
        
read_argv(1szArgcharsmax(szArg))
        
plr cmd_target(idszArg)
    }

    if( !
plr )
    {
        
plr g_iDefuser
    
}

    if( !
plr )
    {
        return 
PLUGIN_HANDLED
    
}

    
g_bCantDefuse[plr] = true

    
new szName[32]
    
get_user_name(plrszNamecharsmax(szName))

    
client_print(idprint_console"%s can't defuse the bomb anymore"szName)

    return 
PLUGIN_HANDLED

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 02-23-2009 , 11:07   Re: How do stop defusing bomb
Reply With Quote #8

work,thanks ConnorMcLeod.+karma
zwfgdlc 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 17:07.


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