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

Adding Burst-Fire Mode to a weapon


Post New Thread Reply   
 
Thread Tools Display Modes
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 17:40   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #11

Thats why I asked for more info....

Weapons in cs can't have the burst mode, other than famas and glock
__________________
stuff
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 17:47   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #12

I've found this : https://www.amxmodx.org/api/cstrike/cs_set_weapon_burst

"Only the Glock and Famas can be set to burst fire mode as they are the only guns in the game that provide such a mode."

So this plugin can't turn another weapon to burst fire mode..
D4rkSiD3Rs is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 17:50   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #13

Quote:
Originally Posted by maqi View Post
This should work

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

#pragma semicolon 1

#define PLUGIN "Force burst"
#define VERSION "1.0a"

#define TASKID_BURST 16123

new const m_rgpPlayerItems_CBasePlayer[6] = {367,368,...};

public 
plugin_init( ) 
{
    
register_pluginPLUGINVERSION"maqi" );
    
    
RegisterHamHam_Spawn"player""Event_PlayerSpawnPost");
    
    
register_event"WeapPickup""Event_WeaponPickup""be" );
}

public 
Event_WeaponPickupiIndex )
{
    if( !
is_user_connectediIndex ) )
        return;
    
    if( 
remove_taskTASKID_BURST iIndex ) )
        
set_task0.5"Task_EnablePlayerBurst"TASKID_BURST iIndex );
}

public 
Event_PlayerSpawnPostiIndex )
{
    if( !
is_user_connectediIndex ) )
        return;
    
    if( 
remove_taskTASKID_BURST iIndex ) )
        
set_task0.5"Task_EnablePlayerBurst"TASKID_BURST iIndex );
}

public 
Task_EnablePlayerBurst( const iTaskID )
{
    new 
iIndex iTaskID TASKID_BURST;
    
    if( 
user_has_weaponiIndexCSW_FAMAS ) && HamGetWeaponEntityIDiIndexCSW_FAMAS ) )
        
EnableWeaponBurstiIndexCSW_FAMAS );
    
    if( 
user_has_weaponiIndexCSW_GLOCK18 ) && HamGetWeaponEntityIDiIndexCSW_GLOCK18 ) )
        
EnableWeaponBurstiIndexCSW_GLOCK18 );
}


EnableWeaponBurstiIndexiWeapon )
{
    if( !
cs_get_weapon_burstHamGetWeaponEntityIDiIndexiWeapon ) ) )
        
cs_set_weapon_burstHamGetWeaponEntityIDiIndexiWeapon ), );
}

stock HamGetWeaponEntityIDiIndexiWeaponID )
{
    new 
iWeaponEnt;
    for(new 
i=1i<6i++)
    {
        
iWeaponEnt get_pdata_cbaseiIndexm_rgpPlayerItems_CBasePlayer[i] );
        while( 
pev_valid(iWeaponEnt) )
        {
            if( 
get_pdata_int(iWeaponEnt434) == iWeaponID )
                return 
iWeaponEnt;
                
            
iWeaponEnt get_pdata_cbaseiWeaponEnt42);
        }
    }
    return 
0;

EDIT: Edited the code above to actually work when people are buying/picking up weapons.
Quote:
Originally Posted by maqi View Post
Thats why I asked for more info....

Weapons in cs can't have the burst mode, other than famas and glock
Ok, to explain more, I want to make the machine gun M249 in burst fire mode.

Last edited by D4rkSiD3Rs; 07-01-2018 at 17:57.
D4rkSiD3Rs is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 18:01   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #14

Sorry for the misunderstanding, but you should have explained better.
__________________
stuff
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 18:03   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #15

Quote:
Originally Posted by maqi View Post
Sorry for the misunderstanding, but you should have explained better.
lol, sorry for not explaining better ^^ can you make that plugin?
D4rkSiD3Rs is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 07-01-2018 , 18:04   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #16

Quote:
I want to make the machine gun M249 in burst fire mode.
You can't.
__________________
My English is A0
E1_531G is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 18:05   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #17

Its A LOT, more complex than this, so im gonna go ahead and say i can't, sorry.
__________________
stuff
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 18:05   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #18

Quote:
Originally Posted by E1_531G View Post
You can't.
It's possible ^^ i've seen it in a server 6 years ago
D4rkSiD3Rs is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 18:06   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #19

Quote:
Originally Posted by maqi View Post
Its A LOT, more complex than this, so im gonna go ahead and say i can't, sorry.
Ok, no problem. waiting for someone to help us.
D4rkSiD3Rs is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 07-02-2018 , 07:37   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #20

So, just try:
hook secondary attack (with Ham) on weapon_m249 and use cs_set_weapon_burst( entity, 1 ), if you are right it will work otherwise it won't.

But I think you have seen a modified weapon based on Famas.
__________________
My English is A0
E1_531G 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 01:39.


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