Thx. I already found another solution.
PHP Code:
public fw_Weapon_PrimaryAttack_Pre(weapon_ent)
{
playerEntityId = get_pdata_cbase(weapon_ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
fov = pev(playerEntityId,pev_fov)
set_pev(playerEntityId,pev_fov,10)
if(!pev_valid(playerEntityId) || cs_get_weapon_ammo(weapon_ent) < 1)
return HAM_IGNORED;
oldFlags = entity_get_int(playerEntityId, EV_INT_flags);
entity_get_vector(playerEntityId, EV_VEC_velocity, oldVelocity);
// Make the attack function think we're on the ground
entity_set_int(playerEntityId, EV_INT_flags, oldFlags | FL_ONGROUND | FL_DUCKING);
// If we're already in the air, make the attack function think we're not moving.
// Not sure if this needs to be here.
if (oldFlags & FL_ONGROUND) {
entity_set_vector(playerEntityId, EV_VEC_velocity, zeroVector);
}
return HAM_IGNORED;
}
public fw_Weapon_PrimaryAttack_Post(weapon_ent)
{
set_pev(playerEntityId,pev_fov,fov)
entity_set_vector(weapon_ent, EV_VEC_punchangle, Float:{0.0,0.0,0.0});
new id = get_pdata_cbase(weapon_ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
entity_set_int(id, EV_INT_flags, oldFlags);
entity_set_vector(id, EV_VEC_velocity, oldVelocity);
return HAM_HANDLED;
}
Parts are from the cs1.3 plugin that's around. And this should be more efficient due to less copying than the iaimgood one. BUT I don't know if it works for other weapons as well.
At least I think it is like that
__________________