AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved How can move and shoot while defusing the bomb (https://forums.alliedmods.net/showthread.php?t=319639)

brian763 11-12-2019 10:20

How can move and shoot while defusing the bomb
 
I found the Counter-Strike 1.3 plugin, but in Counter-Strike 1.3, you can move while defusing the bomb, also you can shoot.

I already searched the forum ,but have not found how to allow move and shoot while defusing.

Greatly appreciated it if you could help me.

https://forums.alliedmods.net/showthread.php?p=1298986

brian763 11-14-2019 06:56

Re: How can move and shoot while defusing the bomb
 
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Allow Move && Shoot While Defusing"
#define VERSION "1.0"
#define AUTHOR "Brian"

public plugin_init()
{
    if(
engfunc(EngFunc_FindEntityByString, -1"classname","func_bomb_target") || engfunc(EngFunc_FindEntityByString, -1"classname","info_bomb_target"))
    {
        
register_event("BarTime""event_defusing""be""1=5""1=10")
        
register_plugin(PLUGINVERSIONAUTHOR)
    }
    else
    {
        
register_plugin(PLUGINVERSIONAUTHOR)
        return
    }
}

public 
event_defusing(id)
{
    
set_user_maxspeed(id,250.0)


I found a way to allow move while defusing the bomb.
But I didn't find how to enable the Primary attack while defusing the bomb


I try this but not work:cry:
PHP Code:

public event_defusing(id)
{
    
set_user_maxspeed(id,250.0)
    if (
pev(id,pev_button)&IN_ATTACK && !(pev(id,pev_oldbuttons)&IN_ATTACK))
    {
        const 
m_pActiveItem 373;
        new 
iWeaponEnt get_pdata_cbaseid m_pActiveItem );
        
ExecuteHamHam_Weapon_PrimaryAttack iWeaponEnt );
    }


Greatly appreciated it if you could help me.

brian763 11-14-2019 10:25

Re: How can move and shoot while defusing the bomb
 
I added some code to allow shoot while defusing the bomb.

PHP Code:

#include <hamsandwich>
#include <engine>
#include <cstrike>

#define PLUGIN "Allow Move && Shoot While Defusing"
#define VERSION "1.0"
#define AUTHOR "Brian"

const IsDefusing = (1<<8)
#define is_user_defusing(%0)    ( get_pdata_int(%0,232,5) & IsDefusing )


public plugin_init()
{
    if(
engfunc(EngFunc_FindEntityByString, -1"classname","func_bomb_target") || engfunc(EngFunc_FindEntityByString, -1"classname","info_bomb_target"))
    {
        
register_event("BarTime""event_defusing""be""1=5""1=10")
        
register_forwardFM_CmdStart"CmdStart" )
        
register_plugin(PLUGINVERSIONAUTHOR)
    }
    else
    {
        
register_plugin(PLUGINVERSIONAUTHOR)
        return
    }
}

public 
event_defusing(id)
{
    
set_user_maxspeed(id,250.0)
}

public 
CmdStart(iduc_handleseed)
{
    if ( !
is_user_aliveid ) )
        return 
FMRES_IGNORED
    
    
if ( is_user_defusing(id) )
    {
        if ( ( 
get_uc(uc_handleUC_Buttons) & IN_ATTACK ) && !( pevid pev_oldbuttons ) & IN_ATTACK ) )
        {
            
set_ucuc_handle UC_Buttons get_ucuc_handle UC_Buttons ) & ~IN_ATTACK );
            
            const 
m_pActiveItem 373;
            new 
iWeaponEnt get_pdata_cbaseid m_pActiveItem );
            
ExecuteHamHam_Weapon_PrimaryAttack iWeaponEnt );
        }
    }
    
    return 
FMRES_HANDLED


But no sound while shooting
press the left button once to shoot only once
Unable to control the right rate of fire
:oops:

Greatly appreciated it if you could help me.

brian763 11-16-2019 00:25

Re: How can move and shoot while defusing the bomb
 
Solved
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <cstrike>

#define PLUGIN "Allow Move && Shoot While Defusing"
#define VERSION "1.0"
#define AUTHOR "Brian"

const IsDefusing = (1<<8)
#define is_user_defusing(%0)    ( get_pdata_int(%0,232,5) & IsDefusing )

public plugin_init()
{
    if(
engfunc(EngFunc_FindEntityByString, -1"classname","func_bomb_target") || engfunc(EngFunc_FindEntityByString, -1"classname","info_bomb_target"))
    {
        
register_event("BarTime""event_defusing""be""1=5""1=10")
        
register_plugin(PLUGINVERSIONAUTHOR)
    }
    else
    {
        
register_plugin(PLUGINVERSIONAUTHOR)
        return
    }
}

public 
event_defusing(id)
{
    
set_user_maxspeed(id,250.0)
    const 
m_bIsDefusing 232;
    
set_pdata_int(idm_bIsDefusing50x00FF0000)


But in Counter Stirke 1.3 deploy new weapon will not interrupt the bartime
I want to know how to simulate it
Does not mean I play Counter Stirke 1.3, I play Counter Stirke 1.6!
Greatly appreciated it if you could help me.

DJEarthQuake 11-18-2019 12:38

Re: How can move and shoot while defusing the bomb
 
Quote:

Originally Posted by brian763 (Post 2673094)
Solved
public event_defusing(id)
{
set_user_maxspeed(id,250.0)
const m_bIsDefusing = 232;
set_pdata_int(id, m_bIsDefusing, 5, 0x00FF0000)

But in Counter Stirke 1.3 deploy new weapon will not interrupt the bartime
I want to know how to do it
Greatly appreciated it if you could help me.

From my understanding m_bIsDefusing is a bool.

The hard-coding is 949 not 232.
You are also trying to set a possible C++ color byte where an diff goes.
Quote:

native set_pdata_int(_index, _Offset, _Value, _linuxdiff = 5, _macdiff = 5)
;
Code:
                    "m_bIsDefusing"  // bool                     {                         "type"      "boolean"                         "windows"   "929"                         "linux"     "949"                         "mac"       "949"                     }

Do you mean the plugin Amxx 1.3?
How does below code not crash?
Quote:

set_pdata_int(id, m_bIsDefusing, 5, 0x00FF0000)

iceeedr 11-18-2019 13:21

Re: How can move and shoot while defusing the bomb
 
Or maybe

PHP Code:

set_ent_data(id"CGrenade""m_bStartDefuse"1


^SmileY 11-18-2019 16:35

Re: How can move and shoot while defusing the bomb
 
I sugfest use csx module or iceedr solution.

DarthMan 11-20-2019 03:52

Re: How can move and shoot while defusing the bomb
 
Quote:

Originally Posted by brian763 (Post 2673094)
Solved
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <cstrike>

#define PLUGIN "Allow Move && Shoot While Defusing"
#define VERSION "1.0"
#define AUTHOR "Brian"

const IsDefusing = (1<<8)
#define is_user_defusing(%0)    ( get_pdata_int(%0,232,5) & IsDefusing )

public plugin_init()
{
    if(
engfunc(EngFunc_FindEntityByString, -1"classname","func_bomb_target") || engfunc(EngFunc_FindEntityByString, -1"classname","info_bomb_target"))
    {
        
register_event("BarTime""event_defusing""be""1=5""1=10")
        
register_plugin(PLUGINVERSIONAUTHOR)
    }
    else
    {
        
register_plugin(PLUGINVERSIONAUTHOR)
        return
    }
}

public 
event_defusing(id)
{
    
set_user_maxspeed(id,250.0)
    const 
m_bIsDefusing 232;
    
set_pdata_int(idm_bIsDefusing50x00FF0000)


But in Counter Stirke 1.3 deploy new weapon will not interrupt the bartime
I want to know how to do it
Greatly appreciated it if you could help me.

Counter-Strike 1.3 ... what a coincidence.
No-Steam = No support!

Please buy CS 1.6 on Steam, update your server using SteamCMD, get AMXX 1.9 or 1.10, 1.8.2 will be discontinued soon, and use set_ent_data(id, "CBasePlayer", "m_bIsDefusing", false);

I think that's the proper way to disable defusing. Or try iceedr solution, that may work as well.

plugin_init is also done wrong, there's no need to return. Also, add register_plugin(PLUGIN, VERSION, AUTHOR) first before the if.
For the BarTime event, try using register_message to hook it as pre and return PLUGIN_HANDLED.

Anyway, you're not gonna get any future help if this method doesn't work, as long as you're not updating the server to latest HLDS build using SteamCMD. Only the latest version of HLDS with an updated server without the dproto module is supported here.

brian763 11-20-2019 06:19

Re: How can move and shoot while defusing the bomb
 
Quote:

Originally Posted by DarthMan (Post 2673655)
Counter-Strike 1.3 ... what a coincidence.
No-Steam = No support!

Please buy CS 1.6 on Steam, update your server using SteamCMD, get AMXX 1.9 or 1.10, 1.8.2 will be discontinued soon, and use set_ent_data(id, "CBasePlayer", "m_bIsDefusing", false);

I think that's the proper way to disable defusing. Or try iceedr solution, that may work as well.

plugin_init is also done wrong, there's no need to return. Also, add register_plugin(PLUGIN, VERSION, AUTHOR) first before the if.
For the BarTime event, try using register_message to hook it as pre and return PLUGIN_HANDLED.

Anyway, you're not gonna get any future help if this method doesn't work, as long as you're not updating the server to latest HLDS build using SteamCMD. Only the latest version of HLDS with an updated server without the dproto module is supported here.

NO, I play the Counter-Strike 1.6.Also,I buyed CS 1.6 on Steam.
I mean I just want to simulate the behavior of the Counter-Strike 1.3.
You misunderstand:nono:


All times are GMT -4. The time now is 02:58.

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