Raised This Month: $32 Target: $400
 8% 

ZP zombie not glowing red after freeze grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 03-28-2021 , 13:52   ZP zombie not glowing red after freeze grenade
Reply With Quote #1

Hi, i added a plugin to my server which makes first zombie glow red, but after someone throws ice grenade at him and he unfreezes it no longer glows red. Can anyone help me fix this bug?
Heres the plugin to make first zm glow red :
PHP Code:
/*
[ZP] Addon: First Zombie Translucent/Invisible

Version: 0.4
Author: Arseny aka Without Soul (ICQ 2453579)

--- Credits ---
Weltgericht
Excalibur.007
*/

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

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

new Timer[33];
new 
cvar_Modecvar_Amountcvar_Durationcvar_WarnHumans;

public 
plugin_init() {
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);

cvar_Mode register_cvar("zp_fz_mode""0");
cvar_Amount register_cvar("zp_fz_amount""99");
cvar_Duration register_cvar("zp_fz_duration""999");
cvar_WarnHumans register_cvar("zp_fz_warn_humans""1");
}

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) > 255) {
set_pcvar_num(cvar_Amount255);
}

// thnx Excalibur.007

set_user_rendering(idkRenderFxGlowShell25500kRenderNormal25)

}
if(
get_pcvar_num(cvar_Mode) >= 1) {
Timer[id] = get_pcvar_num(cvar_Duration);

invisibility(id);
}

warn_humans();
}
}
else {
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha255)
}
}

public 
invisibility(id) {
if(!
is_user_connected(id)) {
return;
}

if(
is_user_alive(id) && !zp_get_user_nemesis(id)) {
if(
Timer[id] <= 0) {
set_user_rendering(idkRenderFxGlowShell25500kRenderNormal25)


return;
}

// thnx Excalibur.007
set_user_rendering(idkRenderFxGlowShell25500kRenderNormal25)

}
}

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) {
}
else {
}
}
}
}

public 
zp_user_humanized_post(id) {
set_user_rendering(idkRenderFxNone0,0,0kRenderNormal255);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1051\\ f0\\ fs16 \n\\ par }
*/ 
And heres the code when zombie unfreezes, (the code makes it glow red again but for some reason it doesnt work for me)
PHP Code:
// Nemesis glow / remove glow on player model entity, unless frozen
if (!g_frozen[id])
{
   if (
g_nemesis[id] && get_pcvar_num(cvar_nemglow))
      
fm_set_rendering(g_ent_playermodel[id], kRenderFxGlowShell25500kRenderNormal25)
   else if (
g_firstzombie[id])
      
fm_set_rendering(g_ent_playermodel[id], kRenderFxGlowShell25500kRenderNormal25)
   else
      
fm_set_rendering(g_ent_playermodel[id])

HowToRuski is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-28-2021 , 13:59   Re: ZP zombie not glowing red after freeze grenade
Reply With Quote #2

i think there is a forward for hooking once the player gets unfrozen...

in that forward function set the unfrozen zombie id glow back.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 03-28-2021 , 14:07   Re: ZP zombie not glowing red after freeze grenade
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
i think there is a forward for hooking once the player gets unfrozen...

in that forward function set the unfrozen zombie id glow back.
you mean the last code i gave? it already glows back... or my common sense is just broken
HowToRuski is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 03-29-2021 , 11:51   Re: ZP zombie not glowing red after freeze grenade
Reply With Quote #4

still looking to fix this issue...
EDIT : fixed

Last edited by HowToRuski; 03-29-2021 at 12:15.
HowToRuski 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 15:19.


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