 |
|
Junior Member
Join Date: Jul 2019
Location: MT - BRAZIL.
|

04-19-2021
, 22:29
Re: Pick up gun owner info
|
#4
|
Quote:
Originally Posted by Bugsy
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()
{
RegisterHam( Ham_Touch , "weaponbox" , "WeaponboxTouch" , true );
register_forward( FM_SetModel , "SetModel" );
}
public WeaponboxTouch( iEntity )
{
static iOwner , iOtherInfo;
if ( pev( iEntity , pev_flags ) & FL_ONGROUND )
{
iOwner = pev( iEntity , pev_owner );
//iOwner = player who dropped item
iOtherInfo = pev( iEntity , pev_iuser2 );
//iOtherInfo = value set to pev_iuser2 when item was dropped
}
}
public SetModel( iEntity , const szModel[] )
{
new szClassname[ 32 ];
pev( iEntity , pev_classname , szClassname , charsmax( szClassname ) );
if ( equal ( szClassname , "weaponbox" ) )
{
set_pev( iEntity , 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?
|
|
|
|