AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   [ZP] Addon: First Zombie Translucent/Invisible || v0.4 (https://forums.alliedmods.net/showthread.php?t=143157)

Without Soul 11-15-2010 09:22

[ZP] Addon: First Zombie Translucent/Invisible || v0.4
 
1 Attachment(s)
[ZP] Addon: First Zombie Translucent/Invisible || v0.4

Author: Arseny aka Without Soul
Version: 0.4 (18.11.2010)

Requirements:
Zombie Plague, Fun

Description:
Gives to the first zombie or translucent, or invisibility on certain quantity of seconds (set CVars).
Also the warning message is shown to all people, depending from chosen mode.

PS It is my first plugin, don't judge strictly :)

Install:
1) Extract archive.
2) Next modules and includes may be enabled/present: Zombie Plague, Fun.
3) File "zp_fz_translucent.amxx" place in amxmodx/plugins.
4) File "zp_fz_translucent.txt" place in amxmodx/data/lang.
5) File "zp_fz_translucent.sma" place in amxmodx/scripting.
6) Write "zp_fz_translucent.amxx" in plugins.ini.
7) Restart server.

CVars:
zp_fz_mode <1|0> // Mode: 0 - translucent, 1 - invisibility. Default - 0.
zp_fz_amount <0-100> // Percent of visibility of first zombie, from 0 to 100 % (if zp_fz_mode = 0). Default - 50%.
zp_fz_duration <1-30> // Time on which invisibility is given (if zp_fz_mode = 1). Default - 10 seconds.
zp_fz_warn_humans <1|0> // Warn or not humans. Default - 1.

Credits:
Weltgericht
Excalibur.007

Changelog:
Code:

0.1                First release.
       
0.2                Added a new mode: a semi-transparent for the entire round, either complete invisibility of a certain number of seconds (specified CVar).
                Added three CVars.
                Added a language file.
             
0.3                FIX: Invisible in Nemesis.
                Warning to all people, depending of type of regime (controlled CVar).

0.4                CVar "zp_fz_amount" now depending from 0 to 100 %.
                Fixed shadow under invisible & translucent zombie.

Sorry for my bad English, i use translator.

Excalibur.007 11-17-2010 18:20

Re: [ZP] Addon: First Zombie Translucent
 
Quite original.

Allow the CVar to make more than 99 :|. Although, your main idea is to make it transclucent, some people may want to add more than that or make it fully invis.

This is mine when I needed it.
PHP Code:

set_user_rendering(idkRenderFxNone000kRenderTransAlpha255

Using kRenderFxNone is better than glowshell. It destroys the invis. Try comparing kRenderFxNone and kRenderFxGlowShell with kRenderTransAlpha.

If you set alpha to like 50 or below, you most likely will see them during the light. (Darkest will make them almost fully invis). You can spot them with flashlight as well! Use flashlight at them, you will notice there's a shadow on the floor. (ONLY APPLIES TO kRenderFxNone)

georgik57 11-17-2010 23:39

Re: [ZP] Addon: First Zombie Translucent
 
nice idea
good job

Without Soul 11-18-2010 11:03

Re: [ZP] Addon: First Zombie Translucent
 
Thanks all for comments!

UPDATE:
CVar "zp_fz_amount" now depending from 0 to 100 %.
Fixed shadow under invisible & translucent zombie.

Enjoy %)

albert123 11-18-2010 11:05

Re: [ZP] Addon: First Zombie Translucent
 
Good, i like it.

SaBBa 01-23-2015 03:32

Re: [ZP] Addon: First Zombie Translucent/Invisible || v0.4
 
Works fine,
Thanks

Slavut1chh 12-11-2015 13:27

Re: [ZP] Addon: First Zombie Translucent/Invisible || v0.4
 
Zombie is translucent on:
Survivor
Swarm
Multi

Also zombie is still translucent after 10 seconds.

Zombie Plague 5.0.8

Krtola 12-14-2015 17:33

Re: [ZP] Addon: First Zombie Translucent/Invisible || v0.4
 
In this version invisibility is blocked in swarm and survivor round.
I do not know how to set up for multi.
About timer(seconds),is there any error in logs?
PHP Code:

#include <amxmodx>
#include <zombieplague>
#include <fun>

#define PLUGIN_NAME        "[ZP] Addon: First Zombie Translucent/Invisible"
#define PLUGIN_VERSION    "0.4"
#define PLUGIN_AUTHOR    "Arseny aka Without Soul"

new Timer[33];
new 
g_HudSync;
new 
cvar_Modecvar_Amountcvar_Durationcvar_WarnHumans;

public 
plugin_init() {
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
register_dictionary("zp_fz_translucent.txt");
    
    
cvar_Mode register_cvar("zp_fz_mode""0");
    
cvar_Amount register_cvar("zp_fz_amount""50");
    
cvar_Duration register_cvar("zp_fz_duration""10");
    
cvar_WarnHumans register_cvar("zp_fz_warn_humans""1");
    
    
g_HudSync CreateHudSyncObj();
}

public 
zp_user_infected_post(idinfector) {
    if(!
is_user_connected(id)) {
        return;
    }
    
    if(
zp_get_user_first_zombie(id)) {
        if(
zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) {
            if(
get_pcvar_num(cvar_Mode) <= 0) {
                if(
get_pcvar_num(cvar_Amount) < 0) {
                    
set_pcvar_num(cvar_Amount0);
                }
                if(
get_pcvar_num(cvar_Amount) > 100) {
                    
set_pcvar_num(cvar_Amount100);
                }            
                
                
// thnx Excalibur.007
                
set_user_rendering(idkRenderFxNone000kRenderTransAlphaget_pcvar_num(cvar_Amount));
                
                
set_hudmessage(2552550, -1.00.311.05.01.01.0, -1);
                
ShowSyncHudMsg(idg_HudSync"%L"id"TRANSLUCENT"get_pcvar_num(cvar_Amount));
            }
            if(
get_pcvar_num(cvar_Mode) >= 1) {
                
Timer[id] = get_pcvar_num(cvar_Duration);
                
                
invisibility(id);
            }
            
            
warn_humans();
        }
    }
    else {
        
set_user_rendering(idkRenderFxNone0,0,0kRenderNormal255);
    }
}    

public 
invisibility(id) {
    if(!
is_user_connected(id) || zp_is_survivor_round() || zp_is_swarm_round()) {
        return;
    }
    
    if(
is_user_alive(id) && !zp_get_user_nemesis(id)) {    
        if(
Timer[id] <= 0) {
            
set_user_rendering(idkRenderFxNone0,0,0kRenderNormal255);
        
            
set_hudmessage(25500, -1.00.312.02.01.01.0, -1);
            
ShowSyncHudMsg(idg_HudSync"%L"id"INVISIBILITY_OFF");
        
            return;
        }
        
        
// thnx Excalibur.007
        
set_user_rendering(idkRenderFxNone000kRenderTransAlpha0);
        
        
Timer[id]--;
        
        
set_hudmessage(2552550, -1.00.310.993.00.050.05, -1);
        
ShowSyncHudMsg(idg_HudSync"%L"id"INVISIBILITY_REMAINING"Timer[id]);
        
        
set_task(1.0"invisibility"id);
    }
}

public 
warn_humans() {
    
    
// thnx Weltgericht 
    
new maxplayers get_maxplayers();

    for(new 
0<= maxplayersi++) { 
        if(
is_user_alive(i) && !zp_get_user_zombie(i) && get_pcvar_num(cvar_WarnHumans) >= 1) {            
            
set_hudmessage(2552550, -1.00.311.05.01.01.0, -1);
            if(
get_pcvar_num(cvar_Mode) <= 0) {
                
ShowSyncHudMsg(ig_HudSync"%L"i"WARN_TRANSLUCENT"get_pcvar_num(cvar_Amount));
            }
            else {
                
ShowSyncHudMsg(ig_HudSync"%L"i"WARN_INVISIBILITY"get_pcvar_num(cvar_Duration));
            }
        } 
    } 


public 
zp_user_humanized_post(id) {
    
set_user_rendering(idkRenderFxNone0,0,0kRenderNormal255);    



Slavut1chh 12-20-2015 12:16

Re: [ZP] Addon: First Zombie Translucent/Invisible || v0.4
 
Thx but it doesn't work.
And no,there are no errors in logs.


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

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