Thread: [Help / Support] Ducking invisible zm
View Single Post
OST_Aloe
Junior Member
Join Date: Apr 2019
Location: Russia
Old 02-23-2021 , 12:29   Re: Ducking invisible zm
Reply With Quote #4

Try replacing a piece of code
PHP Code:
public fm_PlayerPreThink(player)
{
    if (!
is_user_alive(player) || !zp_get_user_zombie(id))
        return 
FMRES_IGNORED
        
    
if (zp_get_user_zombie_class(player) != g_zclass_ai_zombie)
        return 
FMRES_IGNORED
    
    
if (!(pev(idpev_flags) & FL_DUCKING))
    {
        
set_pev(idpev_rendermodekRenderNormal)
        
set_pev(idpev_renderamt255.0)
        
        new 
iRandomNum random_num(zisAzisB)
        
        if (
iRandomNum == zisA)
        {
            
emit_sound(playerCHAN_VOICEzombie_idle_sound1VOL_NORMATTN_NORM0PITCH_NORM)
        }
        
        else if (
iRandomNum == zisB)
        {
            
emit_sound(playerCHAN_VOICEzombie_idle_sound2VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }
        
    else
    {
        
set_pev(playerpev_rendermodekRenderTransAlpha)
        
set_pev(playerpev_renderamtget_pcvar_float(g_ai_zombie_invisible))
    }

    return 
FMRES_IGNORED

====>>>
PHP Code:
public fm_PlayerPreThink(id)
{
    if (!
is_user_alive(id) || !zp_get_user_zombie(id))
        return 
FMRES_IGNORED
        
    
if (zp_get_user_zombie_class(id) != g_zclass_ai_zombie)
        return 
FMRES_IGNORED
    
    
if (!(pev(idpev_flags) & FL_DUCKING))
    {
        
set_pev(idpev_rendermodekRenderNormal)
        
set_pev(idpev_renderamt255.0)
        
        new 
iRandomNum random_num(zisAzisB)
        
        if (
iRandomNum == zisA)
        {
            
emit_sound(idCHAN_VOICEzombie_idle_sound1VOL_NORMATTN_NORM0PITCH_NORM)
        }
        
        else if (
iRandomNum == zisB)
        {
            
emit_sound(idCHAN_VOICEzombie_idle_sound2VOL_NORMATTN_NORM0PITCH_NORM)
        }
    }
        
    else
    {
        
set_pev(idpev_rendermodekRenderTransAlpha)
        
set_pev(idpev_renderamtget_pcvar_float(g_ai_zombie_invisible))
    }

    return 
FMRES_IGNORED

OST_Aloe is offline