Raised This Month: $ Target: $400
 0% 

[ayuda] delayed infection para ZA


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chrisss
Junior Member
Join Date: Apr 2012
Old 05-09-2014 , 22:28   [ayuda] delayed infection para ZA
Reply With Quote #1

Hello friends someone could help make me support this plugin sub-za zp 4.3 to 4.6 already miss aviation achieves q but only the glow is blue, but I want to be green q if anyone can help it much agradeseria

PHP Code:
#include &lt;amxmodx&gt;<br>#include &lt;chatcolor&gt;<br>#include &lt;zombieplague&gt;<br><br>// Native from hamsandwich.inc<br>// ---------------------------<br>native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0);<br>enum Ham { Ham_Spawn = 0 }<br><br>// Native from fakemeta.inc<br>// ------------------------<br>native set_pev(_index,_value,any:...);<br><br>new g_extra_antidote, cvar_toggle, cvar_delay,<br>cvar_hits, cvar_antidote, cvar_effects<br>new g_timer[33], g_hits[33]<br>#define TASK_INFECT 5757<br>#define ID_INFECT (taskid - TASK_INFECT)<br><br>public plugin_init()<br>{<br>&nbsp;&nbsp;&nbsp; register_plugin("[ZPNM] Delayed Infection", "1.1", "9 3 () |2 9 ! /&lt;")<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; cvar_toggle = register_cvar("zpnm_delayed_infection", "1")<br>&nbsp;&nbsp;&nbsp; cvar_delay = register_cvar("zpnm_delayed_infection_time", "1.5")<br>&nbsp;&nbsp;&nbsp; cvar_hits = register_cvar("zpnm_delayed_infection_hits", "4")<br>&nbsp;&nbsp;&nbsp; cvar_antidote = register_cvar("zpnm_delayed_infection_antidote", "0")<br>&nbsp;&nbsp;&nbsp; cvar_effects = register_cvar("zpnm_delayed_infection_effects", "1")<br>}<br><br>public plugin_precache()<br>&nbsp;&nbsp;&nbsp; g_extra_antidote = za_register_extra_item("Contamination Antidote", 11, ZP_TEAM_HUMAN)<br><br>public fw_PlayerSpawn_Post(id)<br>{<br>&nbsp;&nbsp;&nbsp; g_hits[id] = 0<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (task_exists(id+TASK_INFECT))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; remove_task(id+TASK_INFECT)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fm_set_rendering(id)<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>public zp_user_infect_attempt(id, infector)<br>{<br>&nbsp;&nbsp;&nbsp; if (!get_pcvar_num(cvar_toggle) || !infector)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return PLUGIN_CONTINUE;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; g_hits[id]++<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (g_hits[id] &gt;= get_pcvar_num(cvar_hits))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return PLUGIN_CONTINUE;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!task_exists(id+TASK_INFECT))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g_timer[id] = get_pcvar_num(cvar_delay)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; set_task(1.0, "zpnm_infect_user", id+TASK_INFECT, _, _, "b")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (get_pcvar_num(cvar_effects))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fm_set_rendering(id, kRenderFxGlowShell, get_cvar_num("zp_nvg_color_R"), get_cvar_num("zp_nvg_color_G"), get_cvar_num("zp_nvg_color_B"), kRenderNormal, 0)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; static reward<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; reward = get_cvar_num("zp_zombie_infect_reward")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; zp_set_user_ammo_packs(infector, zp_get_user_ammo_packs(infector) + reward)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client_print_color(infector, Blue, "^4[ZPNM]^3 You received %d ammo pack%s for contamining a human.", reward, reward &gt; 1 ? "s" : "")<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return ZP_PLUGIN_HANDLED;<br>}<br><br>public zp_user_infected_post(id, infector)<br>{<br>&nbsp;&nbsp;&nbsp; if (!infector || !task_exists(id+TASK_INFECT))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; remove_task(id+TASK_INFECT)<br>&nbsp;&nbsp;&nbsp; g_hits[id] = 0<br>}<br><br>public zp_extra_item_selected(id, itemid)<br>{<br>&nbsp;&nbsp;&nbsp; if (itemid != g_extra_antidote)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return PLUGIN_CONTINUE;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!get_pcvar_num(cvar_toggle) &amp;&amp; !task_exists(id+TASK_INFECT))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client_print_color(id, Red, "^4[ZPNM]^3 Delayed infection is off. You can't use this.")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return ZP_PLUGIN_HANDLED;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!get_pcvar_num(cvar_antidote))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client_print_color(id, Red, "^4[ZPNM]^3 Contamination antidote is unaccesable.")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return ZP_PLUGIN_HANDLED;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!task_exists(id+TASK_INFECT))<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client_print_color(id, Grey, "^4[ZPNM]^3 You are not contamined with the virus!")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return ZP_PLUGIN_HANDLED;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; remove_task(id+TASK_INFECT)<br>&nbsp;&nbsp;&nbsp; g_hits[id] = 0<br>&nbsp;&nbsp;&nbsp; fm_set_rendering(id)<br>&nbsp;&nbsp;&nbsp; client_print_color(id, Blue, "^4[ZPNM]^3 Antidote taken and contamination neutralized!")<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return PLUGIN_CONTINUE;<br>}<br><br>public zpnm_infect_user(taskid)<br>{<br>&nbsp;&nbsp;&nbsp; if (g_timer[ID_INFECT] &gt; 0)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (get_pcvar_num(cvar_antidote))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client_print(ID_INFECT, print_center, "You are contamined! You have %d second%s to take an antidote before you get infected!", g_timer[ID_INFECT], g_timer[ID_INFECT] &gt; 1 ? "s" : "")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; client_print(ID_INFECT, print_center, "You are contamined! You have %d second%s before you get infected!", g_timer[ID_INFECT], g_timer[ID_INFECT] &gt; 1 ? "s" : "")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g_timer[ID_INFECT]--<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; zp_infect_user(ID_INFECT)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; remove_task(taskid)<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>// Set entity's rendering type (from fakemeta_util)<br>stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 0)<br>{<br>&nbsp;&nbsp;&nbsp; static Float:color[3]<br>&nbsp;&nbsp;&nbsp; color[0] = float(r)<br>&nbsp;&nbsp;&nbsp; color[1] = float(g)<br>&nbsp;&nbsp;&nbsp; color[2] = float(b)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; set_pev(entity, 78, fx)<br>&nbsp;&nbsp;&nbsp; set_pev(entity, 134, color)<br>&nbsp;&nbsp;&nbsp; set_pev(entity, 77, render)<br>&nbsp;&nbsp;&nbsp; set_pev(entity, 40, float(amount))<br>}<br> 
not how to make the code look in the box is the link to the plugin for faster
https://forums.alliedmods.net/showth...58895?t=158895

Last edited by chrisss; 05-15-2014 at 09:03.
chrisss is offline
Egan
BANNED
Join Date: May 2013
Location: GB
Old 05-09-2014 , 23:27   Re: [ayuda] delayed infection para ZA
Reply With Quote #2

https://forums.alliedmods.net/forumdisplay.php?f=135
Egan is offline
Send a message via ICQ to Egan Send a message via AIM to Egan Send a message via Yahoo to Egan Send a message via Skype™ to Egan
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 05-12-2014 , 13:34   Re: [ayuda] delayed infection para ZA
Reply With Quote #3

English Only.
WildCard65 is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 05-12-2014 , 18:08   Re: [ayuda] delayed infection para ZA
Reply With Quote #4

En: Post in english..

Sp: Postea en ingles, si no sabes ingles postealo aqui http://amxmodx-es.com/

Last edited by wicho; 05-12-2014 at 18:09.
wicho is offline
Reply



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 19:47.


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