AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   No recoil problem (https://forums.alliedmods.net/showthread.php?t=171953)

GAARA54 11-13-2011 03:35

No recoil problem
 
Hi

i have plugin which set no recoil, but plugin have problems with sight
i need to narrow sight + no recoil, but plugins set only no recoil

Code:

PHP Code:

public fw_Weapon_PrimaryAttack_Post(entity)
{
    new 
id pev(entitypev_owner)

    if (
g_norecoil[id])
    {
        new 
Floatpush[3]
        
pev(idpev_punchanglepush)
        
xs_vec_sub(pushcl_pushangle[id], push)
        
xs_vec_mul_scalar(push0.0push)
        
xs_vec_add(pushcl_pushangle[id], push)
        
set_pev(idpev_punchanglepush)
        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED;


http://forums.alliedmods.net/attachm...1&d=1321181075

This is code from zp cv47:

PHP Code:

public fw_Aug_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new Player get_pdata_cbase(Weapon415)
    
    if(
g_has_aklong[Player])
    {
        new 
Float:push[3]
        
pev(Player,pev_punchangle,push)
        
xs_vec_sub(push,cl_pushangle[Player],push)
        
        
xs_vec_mul_scalar(push,get_pcvar_float(cvar_recoil_aklong),push)
        
xs_vec_add(push,cl_pushangle[Player],push)
        
set_pev(Player,pev_punchangle,push)
        
        if (!
g_clip_ammo[Player])
            return
        
        
emit_sound(PlayerCHAN_WEAPONSound_Fire[0], VOL_NORMATTN_NORM0PITCH_NORM)
        
UTIL_PlayWeaponAnimation(Playeranim_shoot1)
    
        
make_blood_and_bulletholes(Player)
    }    


xs_vec_mul_scalar(push,get_pcvar_float(cvar_r ecoil_aklong),push)

cvar_recoil_aklong = 0.55


http://forums.alliedmods.net/attachm...1&d=1321181072

i try to set by anology:

PHP Code:

public fw_Weapon_PrimaryAttack_Post(entity)
{
    new 
id pev(entitypev_owner)

    if (
g_norecoil[id])
    {
        new 
Floatpush[3]
        
pev(idpev_punchanglepush)
        
xs_vec_sub(pushcl_pushangle[id], push)
        
xs_vec_mul_scalar(push0.55push)
        
xs_vec_add(pushcl_pushangle[id], push)
        
set_pev(idpev_punchanglepush)
        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED;


but this don't arrow sight + this crash no recoil, how to add to this code feature which can narrow sight ?


FIRST PICTURE - MY NO RECOIL PLUGIN
SECOND - ZP EXTRA MP5

I NEED EFFECT LIKE SECOND PICTURE

The Inhabitant Of Heavens 11-13-2011 06:25

Re: No recoil problem
 
Code:

public fw_UpdateClientData_Post(Player, SendWeapons, CD_Handle)
{
        if(!is_user_alive(Player) || (get_user_weapon(Player) != CSW_???) || !g_has_???[Player])
        return FMRES_IGNORED
       
        set_cd(CD_Handle, CD_flNextAttack, halflife_time () + 0.001)
        return FMRES_HANDLED
}

?

GAARA54 11-13-2011 06:35

Re: No recoil problem
 
i need this function not for weapon plugin. for no recoil plugin. (from weapon plugin to extra no recoil)
extra no recoil plugin with effect like second picture
for this:

PHP Code:

public fw_Weapon_PrimaryAttack_Post(entity)
{
    new 
id pev(entitypev_owner)

    if (
g_norecoil[id])
    {
        new 
Floatpush[3]
        
pev(idpev_punchanglepush)
        
xs_vec_sub(pushcl_pushangle[id], push)
        
xs_vec_mul_scalar(push0.0push)
        
xs_vec_add(pushcl_pushangle[id], push)
        
set_pev(idpev_punchanglepush)
        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED;




All times are GMT -4. The time now is 08:26.

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