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

cstrike functions : cs_set_weapon_burst , ...


Post New Thread Reply   
 
Thread Tools Display Modes
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 12-20-2009 , 16:16   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #11

Quote:
Originally Posted by grimvh2 View Post
Dunno why but it still doesnt work xD

Code:
new clip, ammo, weapon = get_user_weapon(id,clip,ammo);
if(weapon == CSW_GLOCK18)
{
   new ent = get_pdata_cbase(id, 368);  
   cs_set_weapon_burst(ent,0);
}
Weird, it works for me 100% fine, I've been using that in my serer for 3 months and never failed.
01101101 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 12-20-2009 , 16:58   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #12

Indeed, thats strange.
__________________
I am out of order!
grimvh2 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-20-2009 , 17:20   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #13

It's depending how you use it.

368 = m_pLastPrimaryItem ; the weapon you're holding, so the active item, may not the last primary item. Plus it won't work for pistol too. ( m_pLastSecondaryItem ). Player needs to hold the weapon in his hands to change something, so you need to retrieve the active weapon index. (m_pActiveItem)
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-20-2009 , 17:51   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #14

Also, if you hold multiple primary weapons, offset 368 will hold only 1 of them.
2nd ond will be linked to 1st one with offset m_pNext, 3rd will be linkg the same way to 2nd, etc..
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 12-20-2009 , 20:24   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #15

try this.work fine for me.
PHP Code:
        RegisterHam(Ham_Item_Deploy,"weapon_m4a1","fwd_Item_Deploy");
        
RegisterHam(Ham_Item_Deploy,"weapon_usp","fwd_Item_Deploy");
        
RegisterHam(Ham_Item_Deploy,"weapon_glock18","fwd_Item_Deploy");
        
RegisterHam(Ham_Item_CanHolster,"weapon_knife","fwd_Item_CanHolster");

public 
fwd_Item_Deploy(ent)
{
    static 
WeaponId;
    
WeaponId cs_get_weapon_id(ent);

    switch(
WeaponId)
    {
        case 
CSW_USP,CSW_M4A1:
        {
            if(!
cs_get_weapon_silen(ent))
            
cs_set_weapon_silen(ent);
        }
        case 
CSW_GLOCK18:
        {
            if(!
cs_get_weapon_burst(ent))
            
cs_set_weapon_burst(ent);
        }
    }
}

public 
fwd_Item_CanHolster(ent)
{
        return 
HAM_SUPERCEDE;

zwfgdlc is offline
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 12-21-2009 , 03:45   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #16

Quote:
Originally Posted by Arkshine View Post
It's depending how you use it.

368 = m_pLastPrimaryItem ; the weapon you're holding, so the active item, may not the last primary item. Plus it won't work for pistol too. ( m_pLastSecondaryItem ). Player needs to hold the weapon in his hands to change something, so you need to retrieve the active weapon index. (m_pActiveItem)
Well, thats why its useful for me, since I have to retrieve the weapon entity at the same time I give it to him, if I give him a pistol, it won't do the job with 373, but it will with 369.

Depending on the situation is which one you should use.
01101101 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-21-2009 , 05:57   Re: cstrike functions : cs_set_weapon_burst , ...
Reply With Quote #17

You don't need offset in your case, just retrieving the output of give_item().
__________________
Arkshine 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 14:53.


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