Raised This Month: $ Target: $400
 0% 

Pick up gun owner info


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
FeehSK
Junior Member
Join Date: Jul 2019
Location: MT - BRAZIL.
Old 04-19-2021 , 22:29   Re: Pick up gun owner info
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
You can get the player who dropped it by checking the pev_owner value of the weaponbox entity. To get additional details, you can use pev_classname, pev_model, etc. If you need a specific value customer for your plugin, you can use a pev_iuser field. But be aware that other plugins may use the field and could cause conflict with yours.

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

public plugin_init() 
{
    
RegisterHamHam_Touch "weaponbox" "WeaponboxTouch" true );
    
register_forwardFM_SetModel "SetModel" );
}

public 
WeaponboxTouchiEntity )
{
    static 
iOwner iOtherInfo
    
    if ( 
peviEntity pev_flags ) & FL_ONGROUND )
    {
        
iOwner peviEntity pev_owner );
        
//iOwner = player who dropped item
        
        
iOtherInfo peviEntity pev_iuser2 );
        
//iOtherInfo = value set to pev_iuser2 when item was dropped
    
}


public 
SetModeliEntity , const szModel[] )
{
    new 
szClassname32 ];
    
    
peviEntity pev_classname szClassname charsmaxszClassname ) );
    
    if ( 
equal szClassname "weaponbox" ) )
    {
        
set_peviEntity pev_iuser2 12345 );
    }


Can you show me an example of what it would be like for the Y player to see the skin that X dropped?
FeehSK is offline
Send a message via Skype™ to FeehSK
 



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 02:33.


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