AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   force famas bustfire (https://forums.alliedmods.net/showthread.php?t=143493)

Max! 11-20-2010 16:13

force famas bustfire
 
I need to make it so the famas can only burstfire and that right click does nothing to it

Exolent[jNr] 11-20-2010 16:32

Re: force famas bustfire
 
You can hook Ham_Item_Deploy and set m_flNextSecondaryAttack to 9999.0, and also use cs_set_weapon_burst.
Then hook Ham_Weapon_PrimaryAttack and set m_flNextSecondaryAttack to 9999.0.
You might also have to set m_flNextSecondaryAttack to 9999.0 when the player finishes reloading too.

ConnorMcLeod 11-20-2010 16:49

Re: force famas bustfire
 
Try this :

PHP Code:

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

#define VERSION "0.0.1"
#define PLUGIN "Force Famas BurstFire"

#define XO_WEAPON                4
#define m_pPlayer                41
#define m_flNextSecondaryAttack    47
#define m_fWeaponState            74

const WEAPONSTATE_FAMAS_BURST_MODE  = ( << )

#define get_weapon_owner(%0) get_pdata_cbase(%0, m_pPlayer, XO_WEAPON)
#define set_weapon_nextsecondaryattack(%0,%1)    set_pdata_float(%0, m_flNextSecondaryAttack, %1, XO_WEAPON)
#define set_famas_burst(%0) set_pdata_int(%0, m_fWeaponState, WEAPONSTATE_FAMAS_BURST_MODE, XO_WEAPON)

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
RegisterHam(Ham_Spawn"weapon_famas""CFamas_Spawn_Post"1)
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_famas""CFamas_SecondaryAttack"0)
}

public 
CFamas_Spawn_PostiWeapon )
{
    
set_famas_burstiWeapon )
}

public 
CFamas_SecondaryAttackiWeapon )
{
    new 
id get_weapon_owneriWeapon )
    
client_print(idprint_center"Only Burst Mode Is Allowed")
    
set_weapon_nextsecondaryattack(iWeaponget_gametime() + 0.3)
    return 
HAM_SUPERCEDE



LukeyB 12-17-2011 11:53

Re: force famas bustfire
 
Sorry to bring up an old post, but is there anyway to use this just to force bots to use burst mode?

bibu 12-17-2011 12:54

Re: force famas bustfire
 
Use it with "is_user_bot".

LukeyB 12-17-2011 13:26

Re: force famas bustfire
 
That worked. I put in the wrong place before. Thanks!

LukeyB 12-17-2011 13:54

Re: force famas bustfire
 
What am I missing to get this to work with glock18?

PHP Code:

#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 
#define VERSION "0.0.1" 
#define PLUGIN "Force GLOCK18 BurstFire" 
#define XO_WEAPON                4 
#define m_pPlayer                41 
#define m_flNextSecondaryAttack    47
#define m_fWeaponState            74 
const WEAPONSTATE_GLOCK18_BURST_MODE  = ( << 
#define get_weapon_owner(%0) get_pdata_cbase(%0, m_pPlayer, XO_WEAPON) 
#define set_weapon_nextsecondaryattack(%0,%1)    set_pdata_float(%0, m_flNextSecondaryAttack, %1, XO_WEAPON) 
#define set_GLOCK18_burst(%0) set_pdata_int(%0, m_fWeaponState, WEAPONSTATE_GLOCK18_BURST_MODE, XO_WEAPON) 
public plugin_init() 

    
register_plugin(PLUGINVERSION"ConnorMcLeod"
    
RegisterHam(Ham_Spawn"weapon_GLOCK18""CGLOCK18_Spawn_Post"1
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_GLOCK18""CGLOCK18_SecondaryAttack"0

public 
CGLOCK18_Spawn_PostiWeapon 
{    
    
set_GLOCK18_burstiWeapon 

public 
CGLOCK18_SecondaryAttackiWeapon 

    new 
id get_weapon_owneriWeapon 
    if( 
is_user_botid ) )
    
client_print(idprint_center"Only Burst Mode Is Allowed"
    
set_weapon_nextsecondaryattack(iWeaponget_gametime() + 0.3
    return 
HAM_SUPERCEDE 



LukeyB 12-17-2011 14:08

Re: force famas bustfire
 
Also, currently the famas code is forcing human players to burst as well as bots. I would like it only to force bots. Any help would be much appreciated.

bibu 12-17-2011 14:39

Re: force famas bustfire
 
Don't triple post...

You should check also in Spawn Post. And probably glock got another offsets than famas.

ConnorMcLeod 12-17-2011 14:46

Re: force famas bustfire
 
When you put a condition ( if )
All the code that should follow that condition should be into { and }

PHP Code:

public CGLOCK18_SecondaryAttackiWeapon 

    new 
id get_weapon_owneriWeapon 
    if( 
is_user_botid ) )
    {
        
client_print(idprint_center"Only Burst Mode Is Allowed"
        
set_weapon_nextsecondaryattack(iWeaponget_gametime() + 0.3
        return 
HAM_SUPERCEDE 
    
}
    return 
HAM_IGNORED




All times are GMT -4. The time now is 11:14.

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