Raised This Month: $166 Target: $400
 41% 

Help / Support Ducking invisible zm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Casperski
Junior Member
Join Date: Aug 2019
Location: DPR Ukraine
Old 01-30-2021 , 07:57   Ducking invisible zm
Reply With Quote #1

Hi! I'm looking for plugin invisible zombie when ducking. I saw thread with code of this zm but when i'm compiling him that give me error (compiled in amx 1.8.1 and in online compilator ver 1.8.2 to 1.9.0). Can anyone share .sma of this zm pls?
Casperski is offline
OST_Aloe
Junior Member
Join Date: Apr 2019
Location: Russia
Old 02-20-2021 , 15:06   Re: Ducking invisible zm
Reply With Quote #2

Before helping, you need the plugin code that you compiled. Use an offline compiler, not online.
OST_Aloe is offline
Casperski
Junior Member
Join Date: Aug 2019
Location: DPR Ukraine
Old 02-21-2021 , 02:17   Re: Ducking invisible zm
Reply With Quote #3

Quote:
Originally Posted by OST_Aloe View Post
Before helping, you need the plugin code that you compiled. Use an offline compiler, not online.
I'm found this code from https://forums.alliedmods.net/showth...t=94862&page=3 and create .sma file. Then try to compile him with compiler on my pc and got this errors:https://ibb.co/NsGLHWp
PHP Code:
/*
            [ZP] Class : [A]dvanced [I]nvisible Zombie
                ( special Zombie class )
                    by Fry!
                    
                    
    Description :
            
            AI zombie in full name ( Advanced Invisible ) have ability when you duck you will be invisible.
            Zombie has a weird feature when you will duck you will breathe out some sounds. Invisible can change by cvar.
    
    
    Cvars :
    
            zp_ai_zombie_invisibility "0"    - Amount of invisibility (0 max invisible - 255 max visible)
    
    
    Changelog :
    
            16/06/2009 - v1.0 - First release
            28/06/2009 - v1.0.5 - removed if player is connected or disconnected, dropped death event, fixed minor bug, removed player flag if he is on ground, optimized code.
            12/07/2009 - v1.0.8 - changing else instead of if in second flag check, removed stock, added 2 sounds while zombie is ducking to know if he is near you.
*/

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Class : [A]dvanced [I]nvisible Zombie"
#define VERSION "1.0.8"
#define AUTHOR "Fry!"

new const zclass_name[] = "Gorunmez Zombi"
new const zclass_info[] = "Egilince Gorunmez Olur"
new const zclass_model[] = "gorunmez_zombi"
new const zclass_clawmodel[] = "gorunmez_zombi_el.mdl"
const zclass_health 5000
const zclass_speed 190
const Float:zclass_gravity 1.0
const Float:zclass_knockback 1.35

new const zombie_idle_sound1[] = "zombie_plague/zombie_moan.wav"
new const zombie_idle_sound2[] = "zombie_plague/zombie_breathing.wav" 

new zisAzisB
new g_zclass_ai_zombieg_ai_zombie_invisible

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar("zp_zclass_advanced_invisble_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
    
    
g_ai_zombie_invisible register_cvar("zp_ai_zombie_invisibility""0")
    
    
register_forward(FM_PlayerPreThink"fm_PlayerPreThink")
}

public 
plugin_precache()
{
    
g_zclass_ai_zombie zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)

    
zisA engfunc(EngFunc_PrecacheSoundzombie_idle_sound1)
    
zisB engfunc(EngFunc_PrecacheSoundzombie_idle_sound2)
}

public 
zp_user_infected_post(playerinfector)
{
    if (
zp_get_user_zombie_class(player) == g_zclass_ai_zombie)
    {
        if ((
pev(playerpev_flags) & FL_DUCKING))
        {
            
set_pev(playerpev_rendermodekRenderTransAlpha)
            
set_pev(playerpev_renderamtget_pcvar_float(g_ai_zombie_invisible))
        }
    }
    return 
PLUGIN_CONTINUE
}

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

Attached Files
File Type: sma Get Plugin or Get Source (zp_zclass_AIZombie.sma - 4 views - 3.7 KB)
Casperski is offline
OST_Aloe
Junior Member
Join Date: Apr 2019
Location: Russia
Old 02-23-2021 , 13: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
Casperski
Junior Member
Join Date: Aug 2019
Location: DPR Ukraine
Old 02-24-2021 , 04:01   Re: Ducking invisible zm
Reply With Quote #5

Quote:
Originally Posted by OST_Aloe View Post
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

Thx you very much. This is works!
Casperski is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:50.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode