Raised This Month: $32 Target: $400
 8% 

Adding Burst-Fire Mode to a weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 16:24   Adding Burst-Fire Mode to a weapon
Reply With Quote #1

Hello,
I'm looking for a plugin which add Burst-Fire Mode mod automatically to a weapon (like glock, famas..)
D4rkSiD3Rs is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 16:27   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #2

This is simple, give me more info ill make it. When someone spawns u want his burst mode to be set ?

Also, is it not ? I have no idea hahaha
__________________
stuff
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 16:33   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #3

No, I want it to be only on a specific weapon not for all weapons (for example M249)
D4rkSiD3Rs is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 16:36   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #4

I have no idea what M249 is, what mod is this for ?
__________________
stuff
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 16:37   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #5

It's the machine gun, on Counter-Strike 1.6 x)
D4rkSiD3Rs is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 16:39   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #6

It can't have burst, only famas and glock can.
__________________
stuff
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 16:44   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #7

That's why i'm asking for that plugin!
D4rkSiD3Rs is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 16:45   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #8

Sure, give me a few minutes to finish a dungeon.
__________________
stuff
maqi is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-01-2018 , 17:09   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #9

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.
__________________
stuff

Last edited by maqi; 07-01-2018 at 17:21.
maqi is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-01-2018 , 17:35   Re: Adding Burst-Fire Mode to a weapon
Reply With Quote #10

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.
I tested it on my furien mod but it's not working! I edited it to be on M249

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_M249 ) && HamGetWeaponEntityIDiIndexCSW_M249 ) )
        
EnableWeaponBurstiIndexCSW_M249 );
}


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;

D4rkSiD3Rs 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 00:47.


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