View Single Post
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 10-27-2008 , 17:05   Re: DOD Pistol Ammo Clips
Reply With Quote #6

it works.. but i made a small change so that it goes by the actual pistol that players are carrying and not by the team

added:
PHP Code:
#define OFFSET_WPN_ID    91
#define OFFSET_LINUX    4 
and
PHP Code:
stock dod_get_weapon_entidwpnid=0weaponname[] = "" ) {
    new 
ent = -1entidentname[32];

    
// Get User Origin
    
new Float:origin[3];
    
pevidpev_originorigin );
    
    
// Find Weapon
    
while( ( ent engfuncEngFunc_FindEntityInSphereentoriginFloat:1.0 ) ) != ) {
        if( 
pev_valid(ent) )
        {
            if( 
wpnid )
            {
                
entid get_pdata_intentOFFSET_WPN_IDOFFSET_LINUX );
                if( 
wpnid == entid ) return ent;
            }
            else if( 
weaponname[0] )
            {
                
peventpev_classnameentname31 );
                if( 
equal(entnameweaponname) ) return ent;
            }
        }
    }
    return 
0;

in event_death changed:
PHP Code:
p_type get_user_team(vid)
if (
p_type != AXIS)
    
p_type dod_get_map_info(MI_ALLIES_TEAM) ? BRITISH ALLIES 
to:
PHP Code:
if(dod_get_weapon_ent(vid,0,"weapon_colt"))
    
p_type ALLIES
else if(dod_get_weapon_ent(vid,0,"weapon_webley"))
    
p_type BRITISH
else
    
p_type AXIS 
and also in HAM_pistol_touch changed:
PHP Code:
p_team get_user_team(player)
if (
p_team != AXIS)
    
p_team dod_get_map_info(MI_ALLIES_TEAM) ? BRITISH ALLIES 
to:
PHP Code:
if(dod_get_weapon_ent(player,0,"weapon_colt"))
    
p_team ALLIES
else if(dod_get_weapon_ent(player,0,"weapon_webley"))
    
p_team BRITISH
else
    
p_team AXIS 
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic