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

Questions on Amxmodx 1.8.3


Post New Thread Reply   
 
Thread Tools Display Modes
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-28-2016 , 14:10   Re: Questions on Amxmodx 1.8.3
Reply With Quote #11

Quote:
Originally Posted by JusTGo View Post
on amxx 1.8.3 he can use Ham_CS_Player_ResetMaxSpeed.
That's essentially Ham_Item_PreFrame. They both represent same numbers, it's only that Ham_CS_Player_ResetMaxSpeed wasn't defined before 1.8.3-dev.
You can go around it by typing the following in your plugin:
PHP Code:
#if AMXX_VERSION_NUM < 183
const HamHam_CS_Player_ResetMaxSpeed Ham_Item_PreFrame;
#endif 
klippy is offline
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 05-02-2016 , 08:39   Re: Questions on Amxmodx 1.8.3
Reply With Quote #12

Is there a native to drop player's weapons? or how can i create a native to execute this stock?

PHP Code:
stock drop_weapons(iddropwhat)
{
    
// Get user weapons
    
new weapons[32], num_weaponsindexindex2weaponidweaponid2dropammo true
    get_user_weapons
(idweaponsnum_weapons)
    
    
// Loop through them and drop primaries or secondaries
    
for (index 0index num_weaponsindex++)
    {
        
// Prevent re-indexing the array
        
weaponid weapons[index]
        
        if ((
dropwhat == PRIMARY_ONLY && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
        || (
dropwhat == SECONDARY_ONLY && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
        {
            
// Get weapon entity
            
new wname[32], weapon_ent
            get_weaponname
(weaponidwnamecharsmax(wname))
            
weapon_ent fm_find_ent_by_owner(-1wnameid)
            
            
// Check if another weapon uses same type of ammo first
            
for (index2 0index2 num_weaponsindex2++)
            {
                
// Prevent re-indexing the array
                
weaponid2 weapons[index2]
                
                
// Only check weapons that we are not going to drop
                
if ((dropwhat == PRIMARY_ONLY && ((1<<weaponid2) & SECONDARY_WEAPONS_BIT_SUM))
                || (
dropwhat == SECONDARY_ONLY && ((1<<weaponid2) & PRIMARY_WEAPONS_BIT_SUM)))
                {
                    if (
AMMOID[weaponid2] == AMMOID[weaponid])
                        
dropammo false
                
}
            }
            
            
// Drop weapon's BP Ammo too?
            
if (dropammo)
            {
                
// Hack: store weapon bpammo on PEV_ADDITIONAL_AMMO
                
set_pev(weapon_entPEV_ADDITIONAL_AMMOcs_get_user_bpammo(idweaponid))
                
cs_set_user_bpammo(idweaponid0)
            }
            
            
// Player drops the weapon
            
engclient_cmd(id"drop"wname)
        }
    }


Last edited by Whitez; 05-02-2016 at 08:40.
Whitez is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-02-2016 , 19:37   Re: Questions on Amxmodx 1.8.3
Reply With Quote #13

Quote:
Originally Posted by Whitez View Post
how can i create a native to execute this stock?
You can create your own natives with "Dynamic Natives". There is a tutorial in the Tutorials section.
__________________
fysiks is offline
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 05-02-2016 , 19:39   Re: Questions on Amxmodx 1.8.3
Reply With Quote #14

Done, thank you
Whitez is offline
Reply


Thread Tools
Display Modes

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 03:50.


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