Thread: [Solved] Force Player Pickup
View Single Post
headshot910
Member
Join Date: Apr 2012
Old 03-29-2020 , 00:50   Re: Force Player Pickup
Reply With Quote #3

I hooked it with Ham_Item_PostFrame and somehow it's priority is the weapon i just drop

PHP Code:
#define PICKUP_RANGE 300.0
public plugin_init() 
{
    
RegisterHam(Ham_Item_PostFrame"weapon_knife""asdas"1)    
}

public 
asdasEnt )
{
    if(
pev_valid(Ent) != 2)
        return
    static 
idid get_pdata_cbase(Ent414)
    if(
get_pdata_cbase(id373) != Ent)
        return
    
    new 
Float:fOrigin] , classname32 ];
    
    
pevid pev_origin fOrigin );
    
    while((
find_ent_in_sphere(afOriginPICKUP_RANGE)) != 0)
    {
        if(
is_user_connected(a))continue
        
        
pev(a,pev_classname,classname,charsmax(classname))        
        if(!
equal(classname,"weaponbox"))continue
        
fake_touch(a,id)        
        break;
    } 

And it work good now thanks you again
__________________
Hi!
I'm here!

Last edited by headshot910; 03-29-2020 at 00:51.
headshot910 is offline