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_ent( id, wpnid=0, weaponname[] = "" ) {
new ent = -1, entid, entname[32];
// Get User Origin
new Float:origin[3];
pev( id, pev_origin, origin );
// Find Weapon
while( ( ent = engfunc( EngFunc_FindEntityInSphere, ent, origin, Float:1.0 ) ) != 0 ) {
if( pev_valid(ent) )
{
if( wpnid )
{
entid = get_pdata_int( ent, OFFSET_WPN_ID, OFFSET_LINUX );
if( wpnid == entid ) return ent;
}
else if( weaponname[0] )
{
pev( ent, pev_classname, entname, 31 );
if( equal(entname, weaponname) ) 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
__________________