Raised This Month: $12 Target: $400
 3% 

Precache 512 Smart Solutions (?)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-13-2022 , 16:45   Precache 512 Smart Solutions (?)
Reply With Quote #1

Hello dear community, I come through this topic to ask those who are aware of the famous error 512 limit precache that is the most annoying thing for those who develop a server (especially zombie servers). I already made a topic asking about the 512 but directed to the point of:

Why does it happen?

How to solve?

And things that anyone who encounters this error for the first time will ask.

I wanted to ask people in the community who are experienced what are the smart solutions to at least reduce the amount of precache used.

Important note, of course many zombie server owners use precache_control.amxx to disable CZ/HL files, but this is still not enough in my view. Even because I added 1 map and it gave error 512 again.

There are zombie servers that work a lot with models and about 150 maps. The question is, how to add 150 maps without causing error 512? since 150 maps use many models, many indeed. Out generated sounds. Is there a smart solution for this?

I used a precache review by McConnorLeod that showed the 512 prechaces on the console (I don't know if these files are 100% true) and approximately 80% of them were .wad files, and I heard that it is possible to save space in the precache using " precache_generic" instead of "precache_sounds" or models, but I don't understand even seeing about 25 threads on the subject. How to use precache_generic? how to use the same precache_generic for models? and the question of maps?

Is it possible to use precache_generic for this plugin?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta> 
#include <fun>
#include <zombieplague> 
#include <hamsandwich>
#include <engine> 
                                                                                          
#define PLUGIN  "Bn_zp_knife"                                                                                                     
#define VERSION "2.5"                                     
#define AUTHOR  "NEO"         
                                                                            
#define TASK_FBURN     100
#define TASK_INFO      333
#define ID_FBURN      ( taskid - TASK_FBURN )            
#define MAX_CLIENTS               32
new bool:g_fRoundEnd                                       
new g_flameSprg_smokeSprg_burning_durationMAX_CLIENTS ]         
                                                                                     
#define PREFIKS "!t[!gZP!t]"   
#define SOZDATEL_FLAG   ADMIN_RCON                                                                                             
#define ADMIN_FLAG      ADMIN_BAN                                            
#define VIP_FLAG        ADMIN_LEVEL_H                               
                                                                  
new key0 MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
                                                                                                                  
new g_knife0[33], g_knife1[33],g_knife2[33],g_knife3[33],g_knife4[33],g_knife5[33],g_knife6[33]
new 
s_knife0[33],s_knife1[33],s_knife2[33],s_knife3[33],s_knife4[33],s_knife5[33],s_knife6[33
new 
g_block[33]                                   

new 
Knife_v_0[]    = "models/7erva4ok/zmmod/knife/v_knifered.mdl"                                               
new Knife_v_1[]    = "models/7erva4ok/zmmod/knife/Knife_v_1.mdl"                                                                                                                                                
new Knife_v_2[]    = "models/7erva4ok/zmmod/knife/Knife_v_2.mdl"                                                                                      
new Knife_v_3[]    = "models/7erva4ok/zmmod/knife/Knife_v_3.mdl"                                                                                                                                                                             
new Knife_v_4[]    = "models/7erva4ok/zmmod/knife/Knife_v_4.mdl"                                                                                
new Knife_v_5[]    = "models/7erva4ok/zmmod/knife/Knife_v_5.mdl"                                                                                                                                                                             
new Knife_v_6[]    = "models/7erva4ok/zmmod/knife/Knife_v_6.mdl"          
                                                                                     
new Knife_p_0[]    = "models/7erva4ok/zmmod/knife/p_knifered.mdl"                                                                                  
new Knife_p_1[]    = "models/7erva4ok/zmmod/knife/Knife_p_1.mdl"                                                                                                                                                
new Knife_p_2[]    = "models/7erva4ok/zmmod/knife/Knife_p_2.mdl"                                                                                      
new Knife_p_3[]    = "models/7erva4ok/zmmod/knife/Knife_p_3.mdl"                                                                                                                                                                             
new Knife_p_4[]    = "models/7erva4ok/zmmod/knife/Knife_p_4.mdl"                                                                                
new Knife_p_5[]    = "models/7erva4ok/zmmod/knife/Knife_p_5.mdl"                                                                                                                                                                             
new Knife_p_6[]    = "models/7erva4ok/zmmod/knife/Knife_p_6.mdl"

new Buy_Sound[]    = "items/gunpickup2.wav" 

new const Knife0_sound[][] =
{
    
"7erva4ok/zmmod/knife/knife_deploy1.wav",
    
"7erva4ok/zmmod/knife/knife_hit1.wav",
    
"7erva4ok/zmmod/knife/knife_hitwall1.wav",
    
"7erva4ok/zmmod/knife/knife_slash1.wav",
    
"7erva4ok/zmmod/knife/knife_stab.wav",
    
"7erva4ok/zmmod/knife/knife_hit2.wav"
}
                                                                                                    
new const 
Knife1_sound[][] =                                                        
{                                                                                 
    
"7erva4ok/zmmod/knife/Knife_1_draw.wav",
    
"7erva4ok/zmmod/knife/Knife_1_hit.wav",
    
"7erva4ok/zmmod/knife/Knife_1_hitwall.wav",                          
    
"7erva4ok/zmmod/knife/Knife_1_slash.wav",                                                       
    
"7erva4ok/zmmod/knife/Knife_1_stab.wav"
}
                                                                                  
new const 
Knife2_sound[][] =                                                                                              
{                                                                                 
    
"7erva4ok/zmmod/knife/Knife_2_draw.wav",
    
"7erva4ok/zmmod/knife/Knife_2_hit.wav",
    
"7erva4ok/zmmod/knife/Knife_2_hitwall.wav",                    
    
"7erva4ok/zmmod/knife/Knife_2_slash.wav",                                                       
    
"7erva4ok/zmmod/knife/Knife_2_stab.wav"
}

new const 
Knife3_sound[][] =
{                          
    
"7erva4ok/zmmod/knife/Knife_3_deploy.wav",                                                  
    
"7erva4ok/zmmod/knife/Knife_3_hit.wav",
    
"7erva4ok/zmmod/knife/Knife_3_hitwall.wav",                    
    
"7erva4ok/zmmod/knife/Knife_3_slash.wav",                                                       
    
"7erva4ok/zmmod/knife/Knife_3_stab.wav"
}

new const 
Knife4_sound[][] =
{        
    
"7erva4ok/zmmod/knife/Knife_4_deploy.wav",                                                                         
    
"7erva4ok/zmmod/knife/Knife_4_hit.wav",
    
"7erva4ok/zmmod/knife/Knife_4_hitwall.wav",                    
    
"7erva4ok/zmmod/knife/Knife_4_slash.wav",                                                       
    
"7erva4ok/zmmod/knife/Knife_4_stab.wav"
}
                                                               
new const 
Knife5_sound[][] =
{                                                                                 
    
"7erva4ok/zmmod/knife/Knife_5_draw.wav",
    
"7erva4ok/zmmod/knife/Knife_5_hit.wav",
    
"7erva4ok/zmmod/knife/Knife_5_hitwall.wav",                    
    
"7erva4ok/zmmod/knife/Knife_5_slash.wav",                                                       
    
"7erva4ok/zmmod/knife/Knife_5_stab.wav"


new const 
Knife6_sound[][] =
{                                                                                 
    
"7erva4ok/zmmod/knife/Knife_6_draw.wav",
    
"7erva4ok/zmmod/knife/Knife_6_hit.wav",
    
"7erva4ok/zmmod/knife/Knife_6_hitwall.wav",                    
    
"7erva4ok/zmmod/knife/Knife_6_slash.wav",                                                       
    
"7erva4ok/zmmod/knife/Knife_6_stab.wav"
}
                                                                                                     
new 
speed_knife1,speed_knife2,speed_knife3,speed_knife4,speed_knife5,speed_knife6 
new grav_knife1,grav_knife2,grav_knife3,grav_knife4,grav_knife5,grav_knife6
new g_line_sozdatel_R,g_line_sozdatel_G,g_line_sozdatel_B,g_line_admin_R,g_line_admin_G,g_line_admin_B,g_line_vip_R,g_line_vip_G,g_line_vip_B
new gump_vip,gump_admin,gump_sozdatel
new dmg_knife1,dmg_knife2,dmg_knife3,dmg_knife4,dmg_knife5,dmg_knife6
new g_off_line_sozdatel,g_off_line_admin,g_off_line_vip
new g_fire_time,g_fire_damage
new g_freeze_wait[33],g_frozen[33]
new 
g_time_freeze,g_time_freeze_wait
                                                    
new jumpnum[33] = 0                                                       
new bool:dojump[33] = false                                                     
new g_jump[33]                                                                    
new 
BeaconSprite
new g_SpriteGlass
new g_sp[33]
                                                                                                 
public 
plugin_init()                                                                         
{                                                                                                                           
    
register_plugin(PLUGIN,VERSION,AUTHOR)                                                  
    
register_menu("Menu_0"key0"Key_0")                                                           
                                                                                      
    
register_event("CurWeapon""weapon_charge""be","1=1")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")                             
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage"
    
register_forward(FM_EmitSound"CEntity__EmitSound")
                                                                                            
    
register_clcmd("drop","next_sp")                                                                  
    
register_clcmd("say /knife","start_menu")
    
register_clcmd("knife","start_menu")
    
    
set_cvar_string("bn_knife",VERSION)
    
// Скорости ножей                                                                           
    
speed_knife1 register_cvar("zp_knife1_speed""300,0")                                                         
    
speed_knife2 register_cvar("zp_knife2_speed""250,0")                                                                    
    
speed_knife3 register_cvar("zp_knife3_speed""250,0")                                                       
    
speed_knife4 register_cvar("zp_knife4_speed""310,0")                                                         
    
speed_knife5 register_cvar("zp_knife5_speed""325,0")                                                         
    
speed_knife6 register_cvar("zp_knife6_speed""350,0")                                                             
    
// Гравитации ножей                                                                                                        
    
grav_knife1 register_cvar("zp_knife1_grav""300")                                                         
    
grav_knife2 register_cvar("zp_knife2_grav""350")                                                                  
    
grav_knife3 register_cvar("zp_knife3_grav""300")                                                      
    
grav_knife4 register_cvar("zp_knife4_grav""355")
    
grav_knife5 register_cvar("zp_knife5_grav""360")                                               
    
grav_knife6 register_cvar("zp_knife6_grav""370")                            
    
// Урон ножей                                                                                   
    
dmg_knife1 register_cvar("zp_knife1_dmg""2.0")                  
    
dmg_knife2 register_cvar("zp_knife2_dmg""2.0")                                              
    
dmg_knife3 register_cvar("zp_knife3_dmg""2.5")                                  
    
dmg_knife4 register_cvar("zp_knife4_dmg""3.0"
    
dmg_knife5 register_cvar("zp_knife5_dmg""4.0")              
    
dmg_knife6 register_cvar("zp_knife6_dmg""5.0"
    
// Цвет круга при прижке (Создатель)                                                                                             
    
g_line_sozdatel_R register_cvar("zp_color_sozdatel_R","255")                                    
    
g_line_sozdatel_G register_cvar("zp_color_sozdatel_G","0")                                                                    
    
g_line_sozdatel_B register_cvar("zp_color_sozdatel_B","0")                                         
    
// Цвет круга при прижке (Админ)                                                                                                
    
g_line_admin_R register_cvar("zp_color_admin_R","255")                                        
    
g_line_admin_G register_cvar("zp_color_admin_G","255")                                   
    
g_line_admin_B register_cvar("zp_color_admin_B","0")                                                 
    
// Цвет круга при прижке (Вип)                                                                                                       
    
g_line_vip_R register_cvar("zp_color_vip_R","0")                                                        
    
g_line_vip_G register_cvar("zp_color_vip_G","255")                                                                       
    
g_line_vip_B register_cvar("zp_color_vip_B","0")                                     
    
// Отключение кругов                                                                               
    
g_off_line_sozdatel register_cvar("zp_color_on_sozdatel","1")                                          
    
g_off_line_admin register_cvar("zp_color_on_admin","1")                                             
    
g_off_line_vip register_cvar("zp_color_on_vip","1")                                                                  
    
// Прыжки                                                                                 
    
gump_sozdatel register_cvar("zp_maxjumps_sozdatel","5")                                                                                                      
    
gump_admin register_cvar("zp_maxjumps_admin","3")                                            
    
gump_vip register_cvar("zp_maxjumps_vip","2")                                                            
    
// Способности ножей                                                              
    
g_fire_time register_cvar("zp_burn_time","5")                                                     
    
g_fire_damage register_cvar("zp_burn_damage","15")
    
    
g_time_freeze register_cvar("zp_freeze_time","3.0"
    
g_time_freeze_wait register_cvar("zp_freeze_wait","10.0")
}

public 
plugin_cfg()                                                                             
{                                                                               
    new 
szCfgDir[64], szFile[192];                                                             
    
get_configsdir(szCfgDircharsmax(szCfgDir));
    
formatex(szFile,charsmax(szFile),"%s/bn_plague/bn_knife.cfg",szCfgDir); 
    if(
file_exists(szFile))                 
    
server_cmd("exec %s"szFile);                                                              
}
                                                                                                                
public 
plugin_precache()                                                                            
{   
    
precache_model(Knife_v_0)                                   
    
precache_model(Knife_v_1)                                                                                                              
    
precache_model(Knife_v_2)                                                                                                                     
    
precache_model(Knife_v_3)                                                                                       
    
precache_model(Knife_v_4)                                                                                                   
    
precache_model(Knife_v_5)                                                                                       
    
precache_model(Knife_v_6)                                                         

    
precache_model(Knife_p_0)                                                           
    
precache_model(Knife_p_1)                                                                                                              
    
precache_model(Knife_p_2)                                                                                                                     
    
precache_model(Knife_p_3)                                                                                       
    
precache_model(Knife_p_4)                                                                                                   
    
precache_model(Knife_p_5)                                                                                       
    
precache_model(Knife_p_6)
    
    for(new 
0sizeof Knife0_soundi++)
        
precache_sound(Knife0_sound[i])
    
    for(new 
0sizeof Knife1_soundi++)
        
precache_sound(Knife1_sound[i])
                                                           
    for(new 
0sizeof Knife2_soundi++)
        
precache_sound(Knife2_sound[i])                                                               

    for(new 
0sizeof Knife3_soundi++)                                          
        
precache_sound(Knife3_sound[i])

    for(new 
0sizeof Knife4_soundi++)
        
precache_sound(Knife4_sound[i])              
                
    for(new 
0sizeof Knife5_soundi++)
        
precache_sound(Knife5_sound[i])
        
    for(new 
0sizeof Knife6_soundi++)
        
precache_sound(Knife6_sound[i])
    
    
BeaconSprite precache_model("sprites/shockwave.spr")
    
g_flameSpr precache_model"sprites/flamered.spr" )
    
g_smokeSpr precache_model"sprites/black_smoke3.spr" )                             
    
g_SpriteGlass precache_model("models/glassgibs.mdl")
}                                           

public 
client_putinserver(id)            
{
    
jumpnum[id] = 0                           
    dojump
[id] = false
    g_sp
[id] = true
    
    g_knife0
[id] = true
    g_knife1
[id] = false                                                 
    g_knife2
[id] = false                            
    g_knife3
[id] = false                        
    g_knife4
[id] = false                          
    g_knife5
[id] = false
    g_knife6
[id] = false
                                                        
    s_knife0
[id] = true
    s_knife1
[id] = false     
    s_knife2
[id] = false             
    s_knife3
[id] = false                                               
    s_knife4
[id] = false                 
    s_knife5
[id] = false                              
    s_knife6
[id] = false
}
                                   
public 
client_disconnect(id)
{
    
jumpnum[id] = 0
    dojump
[id] = false 
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
if(!
is_user_connected(attacker)) return HAM_IGNORED                                 
if(zp_get_user_zombie(attacker)) return HAM_IGNORED                              
new weapon get_user_weapon(attacker)
if(
weapon == CSW_KNIFE && g_knife6[attacker])                                                                 
{                                                                 
SetHamParamFloat(4damage get_pcvar_float(dmg_knife6))                                  
if(
g_sp[attacker])
{
if( !
task_existsvictim TASK_FBURN ) )                                                            
{                                                                                                             
g_burning_duration[victim] += get_pcvar_num(g_fire_time) * 5                                          
set_task
(0.1"CTask__BurningFlame"victim TASK_FBURN__"b" )
}                                                                                                         
}                                                                                                        
else
{                                                                                                               
if(!
g_freeze_wait[attacker] && !zp_get_user_nemesis(victim))                                                 
{                                                           
set_pev(victimpev_flagspev(victimpev_flags) | FL_FROZEN)                               
set_user_rendering(victimkRenderFxGlowShell0206209kRenderNormal25)                   
g_frozen[victim] = true 
set_task
(get_pcvar_float(g_time_freeze), "end"victim)                                                 
g_freeze_wait[attacker] = true                                                                                    
set_task
(get_pcvar_float(g_time_freeze_wait), "Freeze_Wait"attacker 1233123)
}
}                                                                      
}                                                                                                    
if(
weapon == CSW_KNIFE && g_knife5[attacker])                                              
{                                                                                               
SetHamParamFloat(4damage get_pcvar_float(dmg_knife5))
}                                                                                                          
if(
weapon == CSW_KNIFE && g_knife4[attacker])
{    
SetHamParamFloat(4damage get_pcvar_float(dmg_knife4))
}
if(
weapon == CSW_KNIFE && g_knife3[attacker])
{                                                                                       
SetHamParamFloat(4damage get_pcvar_float(dmg_knife3))
}                                                
if(
weapon == CSW_KNIFE && g_knife2[attacker])
{     
SetHamParamFloat(4damage get_pcvar_float(dmg_knife2))                              
}                                                                                                       
if(
weapon == CSW_KNIFE && g_knife1[attacker])                                    
{     
SetHamParamFloat(4damage get_pcvar_float(dmg_knife1))
}                                                          
return 
HAM_IGNORED                                                                 
}

public 
fw_PlayerPreThink(id)                                                                           
{                                                                                                  
new 
weapon get_user_weapon(id)        
if(
weapon == CSW_KNIFE)                                                    

if(
g_knife1[id])                                                   

g_jump[id] = 
set_user_maxspeed
(idget_pcvar_float(speed_knife1)) 
if ((
pev(idpev_button) & IN_JUMP) && !(pev(idpev_oldbuttons) & IN_JUMP))           
{
new 
flags pev(idpev_flags)
new 
waterlvl pev(idpev_waterlevel)                                                                                          
if (!(
flags FL_ONGROUND))     
return 
FMRES_IGNORED               
if (flags FL_WATERJUMP)                                                
return 
FMRES_IGNORED                                                           
if (waterlvl 1)                                     
return 
FMRES_IGNORED                                                            
new Float:fVelocity[3]
pev(idpev_velocityfVelocity)                             
fVelocity[2] = get_pcvar_float(grav_knife1)                        
set_pev(idpev_velocityfVelocity)
set_pev(idpev_gaitsequence6
}
}                                                                                                
if(
g_knife2[id])                                                     
{
g_jump[id] = 
set_user_maxspeed
(idget_pcvar_float(speed_knife2))
if ((
pev(idpev_button) & IN_JUMP) && !(pev(idpev_oldbuttons) & IN_JUMP))
{
new 
flags pev(idpev_flags)
new 
waterlvl pev(idpev_waterlevel)
if (!(
flags FL_ONGROUND))     
return 
FMRES_IGNORED               
if (flags FL_WATERJUMP)                                                
return 
FMRES_IGNORED
if (waterlvl 1)
return 
FMRES_IGNORED                    
new Float:fVelocity[3
pev(idpev_velocityfVelocity)
fVelocity[2] = get_pcvar_float(grav_knife2)                        
set_pev(idpev_velocityfVelocity)
set_pev(idpev_gaitsequence6
}
}
if(
g_knife3[id])
{
g_jump[id] = 
set_user_maxspeed
(idget_pcvar_float(speed_knife3))
if ((
pev(idpev_button) & IN_JUMP) && !(pev(idpev_oldbuttons) & IN_JUMP))
{
new 
flags pev(idpev_flags)
new 
waterlvl pev(idpev_waterlevel)
if (!(
flags FL_ONGROUND))     
return 
FMRES_IGNORED               
if (flags FL_WATERJUMP)                                                
return 
FMRES_IGNORED
if (waterlvl 1)
return 
FMRES_IGNORED                    
new Float:fVelocity[3
pev(idpev_velocityfVelocity)
fVelocity[2] = get_pcvar_float(grav_knife3)                        
set_pev(idpev_velocityfVelocity)
set_pev(idpev_gaitsequence6
}
}
if(
g_knife4[id])
{                                               
g_jump[id] = get_pcvar_num(gump_vip)                   
set_user_maxspeed(idget_pcvar_float(speed_knife4))
if ((
pev(idpev_button) & IN_JUMP) && !(pev(idpev_oldbuttons) & IN_JUMP))
{
new 
flags pev(idpev_flags)                                                            
new 
waterlvl pev(idpev_waterlevel)
if (!(
flags FL_ONGROUND))     
return 
FMRES_IGNORED               
if (flags FL_WATERJUMP)                                                
return 
FMRES_IGNORED
if (waterlvl 1)
return 
FMRES_IGNORED                    
new Float:fVelocity[3]  
pev(idpev_velocityfVelocity)
fVelocity[2] = get_pcvar_float(grav_knife4)                        
set_pev(idpev_velocityfVelocity)
set_pev(idpev_gaitsequence6
}
}
if(
g_knife5[id])
{
g_jump[id] = get_pcvar_num(gump_admin)
set_user_maxspeed(idget_pcvar_float(speed_knife5))
if ((
pev(idpev_button) & IN_JUMP) && !(pev(idpev_oldbuttons) & IN_JUMP))                             
{
new 
flags pev(idpev_flags)
new 
waterlvl pev(idpev_waterlevel)                                                          
if (!(
flags FL_ONGROUND))     
return 
FMRES_IGNORED               
if (flags FL_WATERJUMP)                                                                
return 
FMRES_IGNORED                                                                         
if (waterlvl 1)
return 
FMRES_IGNORED                    
new Float:fVelocity[3
pev(idpev_velocityfVelocity)                                                                
fVelocity[2] = get_pcvar_float(grav_knife5)                        
set_pev(idpev_velocityfVelocity)
set_pev(idpev_gaitsequence6)                   
}                                                                                                           
}                                                                                  
if(
g_knife6[id])                                                                                                    
{                                                                                      
set_task(0.5"Ability"id TASK_INFO)
g_jump[id] = get_pcvar_num(gump_sozdatel)                                                                 
set_user_maxspeed(idget_pcvar_float(speed_knife6))                                                              
if ((
pev(idpev_button) & IN_JUMP) && !(pev(idpev_oldbuttons) & IN_JUMP))                   
{                                                                             
new 
flags pev(idpev_flags)
new 
waterlvl pev(idpev_waterlevel)
if (!(
flags FL_ONGROUND))                                                                       
return 
FMRES_IGNORED                                                     
if (flags FL_WATERJUMP)                                                                     
return 
FMRES_IGNORED
if (waterlvl 1)                                                                           
return 
FMRES_IGNORED                                      
new Float:fVelocity[3]                                    
pev(idpev_velocityfVelocity)
fVelocity[2] = get_pcvar_float(grav_knife6)                        
set_pev(idpev_velocityfVelocity)               
set_pev(idpev_gaitsequence6
}
}
}
else                                                     
{
g_jump[id] = 0
}
return 
FMRES_IGNORED
}                                                                
                                                                               
public 
zp_user_infected_post(id)                              
{
g_knife1[id] = false                                                 
g_knife2
[id] = false
g_knife3
[id] = false
g_knife4
[id] = false                          
g_knife5
[id] = false
g_knife6
[id] = false
                                                        
s_knife0
[id] = true
s_knife1
[id] = false     
s_knife2
[id] = false                               
s_knife3
[id] = false                                               
s_knife4
[id] = false                 
s_knife5
[id] = false                              
s_knife6
[id] = false
}
    
public 
weapon_charge(id)                                      
{                                                                    
new 
weaponid 
weaponid 
read_data(2)
                                                  
if(!
zp_get_user_zombie(id))                                    
{                                              
if(
weaponid == CSW_KNIFE)                                                               
{
if(
g_knife1[id])                                                                        
{
set_pev(idpev_viewmodel2Knife_v_1)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_1)               
}
if(
g_knife2[id])                                                                    
{                                                                                      
set_pev(idpev_viewmodel2Knife_v_2)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_2
}
if(
g_knife3[id])
{
set_pev(idpev_viewmodel2Knife_v_3)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_3)
}
if(
g_knife4[id])                                                                                  
{
set_pev(idpev_viewmodel2Knife_v_4)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_4)
}                                                                         
if(
g_knife5[id])
{
set_pev(idpev_viewmodel2Knife_v_5)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_5)
}
if(
g_knife6[id])
{
set_pev(idpev_viewmodel2Knife_v_6)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_6)
}
}                                                                      
}
}

public 
CEntity__EmitSound(idchannel, const sample[], Float:volumeFloat:attnflagspitch)
{
if (!
is_user_connected(id)) 
    return 
HAM_IGNORED                                                                              
                                                                              
if (sample[8] == 'k' && sample[9] == 'n' && sample[10] == 'i')
{    
if (
sample[14] == 'd')                                                                                                   
{    
if(
g_knife0 [id])   
emit_sound(idchannelKnife0_sound[0], volumeattnflagspitch)                                                           
if(
g_knife1[id])
emit_sound(idchannelKnife1_sound[0], volumeattnflagspitch)
if(
g_knife2[id])                                                                      
emit_sound(idchannelKnife2_sound[0], volumeattnflagspitch)                     
if(
g_knife3[id])                                                                                   
emit_sound(idchannelKnife3_sound[0], volumeattnflagspitch)                                    
if(
g_knife4[id])
emit_sound(idchannelKnife4_sound[0], volumeattnflagspitch)                                    
if(
g_knife5[id])
emit_sound(idchannelKnife5_sound[0], volumeattnflagspitch)
if(
g_knife6[id])
emit_sound(idchannelKnife6_sound[0], volumeattnflagspitch)
}                                                                                      
else if (
sample[14] == 'h')                                                                               
{
if (
sample[17] == 'w'
{
if(
g_knife0[id])                                                                                        
emit_sound(idchannelKnife0_sound[2], volumeattnflagspitch)
if(
g_knife1[id])                                                                                        
emit_sound(idchannelKnife1_sound[2], volumeattnflagspitch)
if(
g_knife2[id])
emit_sound(idchannelKnife2_sound[2], volumeattnflagspitch)
if(
g_knife3[id])
emit_sound(idchannelKnife3_sound[2], volumeattnflagspitch)            
if(
g_knife4[id])                                                                                
emit_sound(idchannelKnife4_sound[2], volumeattnflagspitch)
if(
g_knife5[id])
emit_sound(idchannelKnife5_sound[2], volumeattnflagspitch)
if(
g_knife6[id])
emit_sound(idchannelKnife6_sound[2], volumeattnflagspitch)
}
else
{        
if(
g_knife0[id])                                                                                        
emit_sound(idchannelKnife0_sound[1], volumeattnflagspitch)                                                                                                                  
if(
g_knife1[id])                                                                                               
emit_sound(idchannelKnife1_sound[1], volumeattnflagspitch)                          
if(
g_knife2[id])
emit_sound(idchannelKnife2_sound[1], volumeattnflagspitch)
if(
g_knife3[id])                                                                                                
emit_sound(idchannelKnife3_sound[1], volumeattnflagspitch)
if(
g_knife4[id])                                                                
emit_sound(idchannelKnife4_sound[1], volumeattnflagspitch)                        
if(
g_knife5[id])
emit_sound(idchannelKnife5_sound[1], volumeattnflagspitch)
if(
g_knife6[id])
emit_sound(idchannelKnife6_sound[1], volumeattnflagspitch)
}
}
else
{
if (
sample[15] == 'l'
{       
if(
g_knife0[id])
emit_sound(idchannelKnife0_sound[3], volumeattnflagspitch)                                                                                   
if(
g_knife1[id])
emit_sound(idchannelKnife1_sound[3], volumeattnflagspitch)
if(
g_knife2[id])
emit_sound(idchannelKnife2_sound[3], volumeattnflagspitch)
if(
g_knife3[id])
emit_sound(idchannelKnife3_sound[3], volumeattnflagspitch)
if(
g_knife4[id])
emit_sound(idchannelKnife4_sound[3], volumeattnflagspitch)
if(
g_knife5[id])                                                                           
emit_sound(idchannelKnife5_sound[3], volumeattnflagspitch
if(
g_knife6[id])
emit_sound(idchannelKnife6_sound[3], volumeattnflagspitch)
}                                                                                          
else 
{     
if(
g_knife0[id])
emit_sound(idchannelKnife0_sound[4], volumeattnflagspitch)                                                                               
if(
g_knife1[id])
emit_sound(idchannelKnife1_sound[4], volumeattnflagspitch)
if(
g_knife2[id])
emit_sound(idchannelKnife2_sound[4], volumeattnflagspitch)                                                                                 
if(
g_knife5[id])
emit_sound(idchannelKnife5_sound[4], volumeattnflagspitch)
if(
g_knife6[id])
emit_sound(idchannelKnife6_sound[4], volumeattnflagspitch)
}
}
return 
HAM_SUPERCEDE
}
return 
HAM_IGNORED
}

public 
start_menu(id)                                                                                     
{                                                               
if(!
zp_get_user_zombie(id))
{                                                                                                                       
static 
menu[555], iLen            
iLen 
0                                                                                         
iLen 
formatex(menu[iLen], charsmax(menu) - iLen"\r[ZE] \yZombie Escape 2.0^n\wSpecial \rKnife Menu^n^n")          

if(
s_knife0[id])
{                                                                                                              
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r1. \yBasic \wKnife \r|\dNo Effect\r| \r--> Selected^n")                            
key0 &= ~MENU_KEY_1                                                                                                   
}
else                                                                                                      
{                                                                                                                  
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r1. \yBasic \wKnife \r|\dNo Effect\r|^n")                                     
key0 |= MENU_KEY_1 
}

if(
s_knife1[id])
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r2. \yAxe \wKnife \r|\dX2 DMG\r| \r--> Selected^n")                            
key0 &= ~MENU_KEY_2
}                                                                                                                
else                                                                                                                    
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r2. \yAxe \wKnife \r|\dX2 DMG\r|^n")                                        
key0 |= MENU_KEY_2
}                                                                                                                

if(
s_knife2[id])
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r3. \yDark \wSword \r|\dX2.5 DMG\r| \r--> Selected^n^n")                            
key0 &= ~MENU_KEY_3
}                                                                                                              
else
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r3. \yDark \wSword \r|\dX2.5 DMG\r|^n^n")                              
key0 |= MENU_KEY_3 
}                                                                                                                 

if(
s_knife3[id])                                                                                   
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r4. \yDagger \wKnife \r|\dWhite Flames\r| \r--> Selected^n")                            
key0 &= ~MENU_KEY_4
}                                                                                                                 
else
{                                                                                                               
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r4. \yDagger \wKnife \r|\dWhite Flames\r|^n")                                  
key0 |= MENU_KEY_4                                                                                               
}
                                                                                                                      
if(
get_user_flags(id) & VIP_FLAG)                                                                                
{                                                                                       
if(
s_knife4[id])
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r5. \yThanatos \wWarHammer \r|\dPoison Flames\r| \r --> Selected^n")                            
key0 &= ~MENU_KEY_5                                                                                      
}                                                                                                                 
else                                                                                                                 
{                                                                                                                        
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r5. \yThanatos \wWarHammer \r|\dPoison Flames\r|^n")                                     
key0 |= MENU_KEY_5                                                                                                 
}                                                                                                                   
}                                                                                                             
else                                                                                                             
{                                                                                         
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\d5. Thanatos WarHammer |Poison Flames| \r[VIP Only]^n")                            
key0 &= ~MENU_KEY_5                                                                                          
}                                                                                                              
                                                                       
if(
get_user_flags(id) & ADMIN_FLAG)

if(
s_knife5[id])
{                                                                                                                  
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r6. \yFire \wWarHammer \r|\dRed Flames\r| \r--> Selected^n^n")                            
key0 &= ~MENU_KEY_6
}                                                                                                                 
else                                                                                                                 
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r6. \yFire \wWarHammer \r|\dRed Flames\r|^n^n")                            
key0 |= MENU_KEY_6                                                                                            
}                                                                                                                       
}                                                                                                                     
else
{                                                                          
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\d6. Fire WarHammer |Red Flames| \r[Admin Only]^n^n")                               
key0 &= ~MENU_KEY_6
}
                                                                                             
if(
get_user_flags(id) & SOZDATEL_FLAG)                                                                           
{
if(
s_knife6[id])
{
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r7. \yGreen \wWarHammer \r|\dGreen Explosion\r| \r --> Selected^n^n")                            
key0 &= ~MENU_KEY_7
}                                                                                                                 
else                                                                                                                 
{                                                                             
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r7. \yGreen \wWarHammer \r|\dGreen Explosion\r|^n^n")                                  
key0 |= MENU_KEY_7                                                                                                     
}
}
else
{                                                                                                                
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\d7. Green WarHammer |Explosive Impact| \r[Staff Only]^n^n")
key0 &= ~MENU_KEY_7                                                                                      
}                                                                                                
                                                                                                    
iLen += formatex(menu[iLen], charsmax(menu) - iLen"\r0. \yExit")                                          
key0 |= MENU_KEY_0                                                                    
                                                                                   
show_menu
(idkey0menu, -1"Menu_0")                                                                            
}                                                                                         
else                                                          
{
color_print(id"%s !gДоступ !tтолько !gчеловеку",PREFIKS)
}
}                                                                

public 
Key_0(idkey)                                       
{                                                                                               
new 
weaponid                                  
weaponid 
get_user_weapon(id)                                     
switch(
key)                                                          
{                                                     
case 
0:                                                     
{
g_knife0[id] = true
g_knife1
[id] = false
g_knife2
[id] = false
g_knife3
[id] = false                                    
g_knife4
[id] = false                 
g_knife5
[id] = false                                     
g_knife6
[id] = false
                            
s_knife0
[id] = true
s_knife1
[id] = false
s_knife2
[id] = false
s_knife3
[id] = false                                               
s_knife4
[id] = false                 
s_knife5
[id] = false                              
s_knife6
[id] = false                                             

g_block
[id] = true                                       
start_menu
(id)
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gСтандартный!t]",PREFIKS
color_print(id"%s !gСпособности!t: [!gНету!t]",PREFIKS)

if(
is_user_alive(id))                             
{
if(
weaponid == CSW_KNIFE)                                                       
{             
set_pev(idpev_viewmodel2Knife_v_0)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_0)
}
}                                                                      
}                                                                                     
case 
1:                                                         
{                                                                                               
g_knife1[id] = true          
g_knife2
[id] = false
g_knife3
[id] = false
g_knife4
[id] = false                                                     
g_knife5
[id] = false
g_knife6
[id] = false

s_knife0
[id] = false
s_knife1
[id] = true
s_knife2
[id] = false
s_knife3
[id] = false
s_knife4
[id] = false                 
s_knife5
[id] = false                              
s_knife6
[id] = false

g_block
[id] = true
start_menu
(id)                                                               
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gПротон!t]",PREFIKS)
color_print(id"%s !gСпособности!t: [!gУвеличение Скорости!t]",PREFIKS)
                                       
if(
is_user_alive(id))                             
{
if(
weaponid == CSW_KNIFE)                                                       
{             
set_pev(idpev_viewmodel2Knife_v_1)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_1)
}
}
}                                                                      
case 
2:                                                   
{
g_knife1[id] = false
g_knife2
[id] = true
g_knife3
[id] = false
g_knife4
[id] = false
g_knife5
[id] = false
g_knife6
[id] = false

s_knife0
[id] = false
s_knife1
[id] = false
s_knife2
[id] = true
s_knife3
[id] = false
s_knife4
[id] = false                 
s_knife5
[id] = false                              
s_knife6
[id] = false

g_block
[id] = true
start_menu
(id
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gТемная ночь!t]",PREFIKS)
color_print(id"%s !gСпособности!t: [!gУменьшение Гравитации!t]",PREFIKS)

if(
is_user_alive(id))
{
if(
weaponid == CSW_KNIFE
{             
set_pev(idpev_viewmodel2Knife_v_2)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_2)
}
}
}                                                               
case 
3:                                                   
{                                                        
g_knife1[id] = false
g_knife2
[id] = false
g_knife3
[id] = true
g_knife4
[id] = false
g_knife5
[id] = false
g_knife6
[id] = false 

s_knife0
[id] = false
s_knife1
[id] = false
s_knife2
[id] = false
s_knife3
[id] = true
s_knife4
[id] = false                 
s_knife5
[id] = false                              
s_knife6
[id] = false

g_block
[id] = true
start_menu
(id)
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gЯрость Солнца!t]",PREFIKS)
color_print(id"%s !gСпособности!t: [!gУдвоение Урона!t]",PREFIKS)

if(
is_user_alive(id))
{
if(
weaponid == CSW_KNIFE
{             
set_pev(idpev_viewmodel2Knife_v_3)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_3)
}
}
}                                
case 
4:                                                   
{
g_knife1[id] = false
g_knife2
[id] = false
g_knife3
[id] = false
g_knife4
[id] = true
g_knife5
[id] = false 
g_knife6
[id] = false

s_knife0
[id] = false
s_knife1
[id] = false
s_knife2
[id] = false
s_knife3
[id] = false
s_knife4
[id] = true                 
s_knife5
[id] = false                                                                            
s_knife6
[id] = false

g_block
[id] = true                                                                                                   
start_menu
(id)
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gСудный день!t]",PREFIKS)
color_print(id"%s !gСпособности!t: [!gВсе способности + %d Прыжка!t]",PREFIKS,get_pcvar_num(gump_vip))

if(
is_user_alive(id))
{
if(
weaponid == CSW_KNIFE
{                                                                                                                      
set_pev(idpev_viewmodel2Knife_v_4)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_4)
}
}
}
case 
5:                                                   
{
g_knife1[id] = false
g_knife2
[id] = false
g_knife3
[id] = false
g_knife4
[id] = false
g_knife5
[id] = true
g_knife6
[id] = false

s_knife0
[id] = false
s_knife1
[id] = false
s_knife2
[id] = false
s_knife3
[id] = false
s_knife4
[id] = false                 
s_knife5
[id] = true                              
s_knife6
[id] = false

g_block
[id] = true
start_menu
(id)
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gХамер Силы!t]",PREFIKS)
color_print(id"%s !gСпособности!t: [!gВсе способности + %d Прыжка!t]",PREFIKS,get_pcvar_num(gump_admin))

if(
is_user_alive(id))
{
if(
weaponid == CSW_KNIFE
{             
set_pev(idpev_viewmodel2Knife_v_5)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_5)
}
}
}
case 
6:                                                   
{                             
g_knife1[id] = false
g_knife2
[id] = false
g_knife3
[id] = false
g_knife4
[id] = false
g_knife5
[id] = false
g_knife6
[id] = true

s_knife0
[id] = false
s_knife1
[id] = false
s_knife2
[id] = false
s_knife3
[id] = false
s_knife4
[id] = false                 
s_knife5
[id] = false                                                                                                    
s_knife6
[id] = true 
                                                                                                                          
g_block
[id] = true
start_menu
(id)
buy_sound(id)
color_print(id"%s !gВы !tвыбрали !gнож!t: [!gХамер Власти!t]",PREFIKS)
color_print(id"%s !gСпособности!t: [!gВсе способности + %d Прыжка!t]",PREFIKS,get_pcvar_num(gump_sozdatel))

if(
is_user_alive(id))                                                  
{
if(
weaponid == CSW_KNIFE)                                                           
{                                                                                             
set_pev(idpev_viewmodel2Knife_v_6)                                                                                 
set_pev(idpev_weaponmodel2Knife_p_6)
}                                                                                  
}
}
}
return 
PLUGIN_HANDLED                                                                                         
}

public 
buy_sound(id)
{                                                                                                       
emit_sound(idCHAN_BODYBuy_Sound1.0ATTN_NORM0PITCH_NORM)                                
}                           
                                                                                                     
public 
client_PreThink(id)
{
if(!
zp_get_user_zombie(id))                                                                               
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE                                                                        
    
new nbut get_user_button(id)
    new 
obut get_user_oldbutton(id)                                                                          
    if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))                          
    {                                                                                                       
        if(
jumpnum[id] < g_jump[id])                                                                          
        {                         
            
dojump[id] = true                                                  
            jumpnum
[id]++                                                                                        
            
jump_line(id)
            return 
PLUGIN_CONTINUE                                 
        
}                                                                   
    }                                                                             
    if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {                                                                        
        
jumpnum[id] = 0
        
return PLUGIN_CONTINUE
    

}
return 
PLUGIN_CONTINUE
}

public 
client_PostThink(id)
{
if(!
zp_get_user_zombie(id))                           
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE
    
if(dojump[id] == true)                                     
    {
        new 
Float:velocity[3]                                       
        
entity_get_vector(id,EV_VEC_velocity,velocity)                  
        
velocity[2] = random_float(265.0,285.0)                                  
        
entity_set_vector(id,EV_VEC_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE                         
    
}                                                                   
}
return 
PLUGIN_CONTINUE
}
                                     
public 
jump_line(id)   
{
new 
weaponid
weaponid 
get_user_weapon(id)
if(
weaponid == CSW_KNIFE)                       

if(
g_knife6[id])
{                                                                              
if(
get_pcvar_num(g_off_line_sozdatel))
{
        static 
origin[3]
        
get_user_origin(idorigin)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMCYLINDER)                   
        
write_coord(origin[0])
        
write_coord(origin[1])                                        
        
write_coord(origin[2]-20)    
        
write_coord(origin[0]) 
        
write_coord(origin[1])                 
        
write_coord(origin[2]+200)
        
write_short(BeaconSprite)
        
write_byte(0)
        
write_byte(1)                                          
        
write_byte(6)
        
write_byte(2
        
write_byte(1)                                                              
        
write_byte(get_pcvar_num(g_line_sozdatel_R))    
        
write_byte(get_pcvar_num(g_line_sozdatel_G))                                              
        
write_byte(get_pcvar_num(g_line_sozdatel_B))
        
write_byte(255)
        
write_byte(0)                            
        
message_end()
}
}                                                              
if(
g_knife5[id])
{
if(
get_pcvar_num(g_off_line_admin))
{
        static 
origin[3]
        
get_user_origin(idorigin)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMCYLINDER)
        
write_coord(origin[0])
        
write_coord(origin[1])                                             
        
write_coord(origin[2]-20)    
        
write_coord(origin[0]) 
        
write_coord(origin[1])
        
write_coord(origin[2]+200)
        
write_short(BeaconSprite)
        
write_byte(0)
        
write_byte(1)
        
write_byte(6)
        
write_byte(2
        
write_byte(1
        
write_byte(get_pcvar_num(g_line_admin_R)) 
        
write_byte(get_pcvar_num(g_line_admin_G))                                              
        
write_byte(get_pcvar_num(g_line_admin_B)) 
        
write_byte(255)
        
write_byte(0)
        
message_end()
}
}
if(
g_knife4[id])
{
if(
get_pcvar_num(g_off_line_vip))
{
        static 
origin[3]
        
get_user_origin(idorigin)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMCYLINDER)
        
write_coord(origin[0])
        
write_coord(origin[1])
        
write_coord(origin[2]-20)    
        
write_coord(origin[0]) 
        
write_coord(origin[1])
        
write_coord(origin[2]+200)                                    
        
write_short(BeaconSprite)                                                                          
        
write_byte(0)
        
write_byte(1)
        
write_byte(6)                                       
        
write_byte(2)                                                             
        
write_byte(1)                                         
        
write_byte(get_pcvar_num(g_line_vip_R)) 
        
write_byte(get_pcvar_num(g_line_vip_G))                                              
        
write_byte(get_pcvar_num(g_line_vip_B))
        
write_byte(255)
        
write_byte(0)                            
        
message_end()
}           
}
}
}

public 
next_sp(id)
{
if(
g_knife6[id])
{
if(
g_sp[id])
{
g_sp[id] = false
}                                                                 
else
{                                                       
g_sp[id] = true
}
}
}

public 
CTask__BurningFlame(taskid)
{                                                          
static 
origin[3], flags     
get_user_origin
(ID_FBURNorigin)
flags pev(ID_FBURNpev_flags)                   

if((
flags FL_INWATER) || g_burning_duration[ID_FBURN] < || g_fRoundEnd || !is_user_alive(ID_FBURN))
{
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
write_byte(TE_SMOKE// TE id  
write_coord(origin[0]) // x
write_coord(origin[1]) // y                                           
write_coord(origin[2]-50// z
write_short(g_smokeSpr// sprite
write_byte(random_num(1520)) // scale
write_byte(random_num(1020)) // framerate
message_end()                                   

remove_task(taskid)                                                         
return
}

static 
health                                                    
health 
pev(ID_FBURNpev_health)                                                                    
                                                                                                  
if (
health get_pcvar_num(g_fire_damage) > 0)                           
set_user_health(ID_FBURNhealth get_pcvar_num(g_fire_damage))          
                                                                                           
// Flame sprite
message_begin(MSG_PVSSVC_TEMPENTITYorigin)                             
write_byte(TE_SPRITE// TE id
write_coord(origin[0]+random_num(-55)) // x                                 
write_coord(origin[1]+random_num(-55)) // y
write_coord(origin[2]+random_num(-1010)) // z
write_short(g_flameSpr// sprite
write_byte(random_num(510)) // scale                
write_byte(200// brightness                                                 
message_end()

g_burning_duration[ID_FBURN]--
}

public 
end(victim)
{
    if(
g_frozen[victim])
    
g_frozen[victim] = false

    set_pev
(victimpev_flagspev(victimpev_flags) & ~FL_FROZEN)
    
set_user_rendering(victimkRenderFxGlowShell000kRenderNormal25)
    
CreateGlass(victim)                                                  

    
remove_task(victim)
}

public 
Ability(taskid)
{
new 
id taskid TASK_INFO        
if(g_knife6[id])                                                                     
{
if(
g_sp[id])
{                                                                                           
set_hudmessage(255000.020.3506.00.8)           
show_hudmessage(id"Способность ножа: [Поджег]")                                        
}
else
{                                                                        
set_hudmessage(002550.020.3506.00.8)
show_hudmessage(id"Способность ножа: [Заморозка]")  
}
}
else
{                                            
remove_task(id TASK_INFO)                                  
}
}

public 
Freeze_Wait(taskid)
{
    new 
attacker taskid 1233123
                                                                                                    
    
if(is_user_alive(attacker))
    {                                                                                                 
        
remove_task(attacker 1233123)
        
g_freeze_wait[attacker] = false
        color_print
(attacker"!t[!gZP!t] !gВаша !tспособность !gзамораживать !tготова")
    }
    else 
remove_task(attacker 1233123)
}

stock CreateGlass(id)                                                            
{                                                                           
    new 
szOrigin[3];
    
get_user_origin(idszOrigin);

    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
write_byte(TE_BREAKMODEL);
    
write_coordszOrigin[0] );
    
write_coordszOrigin[1] );
    
write_coordszOrigin[2] + 24 );
    
write_coord(16);
    
write_coord(16);
    
write_coord(16);
    
write_coordrandom_num(-5050) );
    
write_coordrandom_num(-5050) );
    
write_coord(25);
    
write_byte(10);
    
write_short(g_SpriteGlass);
    
write_byte(10);
    
write_byte(25);
    
write_byte(0x01);
    
message_end();
}
                                                                 
stock color_print(const id, const input[], any:...)                                           
{                                                         
        new 
count 1players[32];                                            
        static 
msg[191];                                                             
        
vformat(msg190input3);                          
                                                                                        
        
replace_all(msg190"!g""^x04"); // Green Color                           
        
replace_all(msg190"!n""^x01"); // Default Color                           
        
replace_all(msg190"!t""^x03"); // Team Color                           
                                                                                           
        
if (idplayers[0] = id; else get_players(playerscount"ch");
        {
            for (new 
0counti++)                                               
            {                                                
                if (
is_user_connected(players[i]))
                {                                           
                    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]) 
                    
write_byte(players[i]);    
                    
write_string(msg);                                           
                    
message_end();
                }
            }
        }
    } 
MeliMeli is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-13-2022 , 18:28   Re: Precache 512 Smart Solutions (?)
Reply With Quote #2

You can use precache_generic for sounds: https://github.com/alliedmodders/amxmodx/pull/934

There is now way to increase 512 limit: https://github.com/ValveSoftware/halflife/issues/12

Also, a solution would be to use less .mdl files with submodel method.
lexzor is offline
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-13-2022 , 19:08   Re: Precache 512 Smart Solutions (?)
Reply With Quote #3

Could you give me an example of a submodel?

Another thing, I don't have the files mentioned in the link in .sma

I saw in topics that it is impossible to increase limit to 512...

Last edited by MeliMeli; 05-13-2022 at 19:16.
MeliMeli is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-13-2022 , 19:50   Re: Precache 512 Smart Solutions (?)
Reply With Quote #4

Theres only one solution, use less mdl thats all .
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-13-2022 , 21:04   Re: Precache 512 Smart Solutions (?)
Reply With Quote #5

I don't know why, but there is a difference from ZP 4.3 to ZP 5.0, I think ZP 5.0 uses a lot more models, I didn't add even half of what was added in zp 4.3 and the game of 512 precache, it's the worst thing that exists in cs 1.6

I don't even own that many models, zp 4.3 is so different from zp 5.0. It was just using zp 5.0 and adding simple things that started giving 512 precache

Last edited by MeliMeli; 05-13-2022 at 21:20.
MeliMeli is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 05-14-2022 , 03:51   Re: Precache 512 Smart Solutions (?)
Reply With Quote #6

You could use this to keep tracking of your precache control : https://github.com/ShadowsAdi/PrecacheList
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-14-2022 , 07:46   Re: Precache 512 Smart Solutions (?)
Reply With Quote #7

Quote:
There are zombie servers that work a lot with models and about 150 maps. The question is, how to add 150 maps without causing error 512? since 150 maps use many models, many indeed. Out generated sounds. Is there a smart solution for this?
I think you're misunderstanding this, or at least you didn't express yourself properly.
The number of maps has nothing to do here. You can have 100.000 maps if you really want to. It's the number of models on the CURRENT map that matters, not the amount of maps you have in your server.

Quote:
I heard that it is possible to save space in the precache using " precache_generic" instead of "precache_sounds" or models, but I don't understand even seeing about 25 threads on the subject. How to use precache_generic? how to use the same precache_generic for models?
precache_generic() can only be used on models/sounds that are used client-side and don't require the server to precache them. Basically, you're only using it to make people download the file.

Things that can be precached this way are sounds played via client_cmd() (sounds that are played via the player's console) and player models.

This does not include sounds played via emit_sound() or other methods, so regarding the plugin you posted - no, sounds emitted from the knife must be precached using precache_sound() and will count towards the 512 limit.

I'm assuming you have a lot of player models in your server and they are precached using precache_model(). This is something you can change immediately and free up space. I tested having 1000+ player models active in a server once to prove this can be done.

Also have in mind that AMXX itself made the mistake of precaching sounds with precache_sound() when it didn't need to. I personally committed this change in AMXX 1.10 (https://github.com/alliedmodders/amxmodx/pull/934), so upgrading your AMXX (or at least the base plugins) can also free up space.

Only thing you need to remember when changing precache_sound() to precache_generic() is that "sound/" must be included in the file path. Example:

Code:
precache_sound("myfolder/mysound.wav")

Should be:

Code:
precache_generic("sound/myfolder/mysound.wav")
__________________

Last edited by OciXCrom; 05-14-2022 at 07:49.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 05-14-2022 , 14:47   Re: Precache 512 Smart Solutions (?)
Reply With Quote #8

Damn OciXCrom, your explanations are so good. You are certainly one of the biggest contributors to this community. I understand many of your points, but should I change precache_model to precache_generic ? Should I keep any remarks in mind before doing this?

Yesterday I removed a specific map that was previously removed on a server, and I was told it was bug. I did the same yesterday and in its place I added a simpler one, and it worked correctly. To check if it was the amount of things the map asked for, I again put +1 map without removing the other one added. And it still worked OK, my precache limit is approaching 500 and I want to remove them. Currently using zp 5.0 and I don't use many models, because I don't like it

I'm using a precache counter plugin made by ConnorMcLeod, and my console shows a lot of .wav files is there any method to reduce them by precache_generic if possible?

I used this method you told me in a plugin that uses client_cmd and it reduced 1 precache better 1 than nothing (LOL) a progress

how can i apply the same to templates? I need to see if the plugin has what?
Attached Files
File Type: txt precaches_wav.txt (20.8 KB, 23 views)

Last edited by MeliMeli; 05-14-2022 at 17:45.
MeliMeli is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-14-2022 , 18:20   Re: Precache 512 Smart Solutions (?)
Reply With Quote #9

Like I said, if the sounds are played via client_cmd(), you can use precache_generic(). You will need to check the .sma files and see how the sounds are used.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-15-2022 , 08:26   Re: Precache 512 Smart Solutions (?)
Reply With Quote #10

If i dont remember wrongly, difference between precache generic/sound is that one is used to precache .wav files and the other one is used for .mp3 files


don't remember wich one for is for wich.

But both of them add to precache limit error .

You can use oci method to remains less precaches but i suppose you use so many precaches that wont affect the end result, my advice is to only give up on some plugins that use too many models,sounds,sprites etc . Probably you should have a few useless onethat you can dispose ..
__________________
Project: Among Us

Last edited by Craxor; 05-15-2022 at 08:26.
Craxor is offline
Send a message via ICQ to Craxor
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 18:58.


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