Raised This Month: $ Target: $400
 0% 

About zombie icon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-31-2011 , 15:51   Re: About zombie icon
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <xs>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#define SUPPORT_BOT_TO_USE
new const zclass_name[] = { "Zombie Class: Healer" }
new const 
zclass_info[] = { "=Press 'R' to heal=" }
new const 
zclass_model[] = { "zombie_healer" }
new const 
zclass_clawmodel[] = { "v_knife_healer.mdl" }
const 
zclass_health 5000
const zclass_speed 240
const Float:zclass_gravity 1.0
const Float:zclass_knockback 1.0
new const HealSound[] = { "zombie_plague/td_debuff.wav" }
new 
g_zclass_kuca
new kuca_skill_cooldownkuca_skill_rangekuca_skill_heal_point
new Float:eyes_skill[33]
new 
heal_spr
public plugin_init()
{
 
register_plugin("[ZP] Class: Healer""1.0""I don't know")
 
 
kuca_skill_cooldown register_cvar("zp_kuca_cooldown""20.0")
 
kuca_skill_range register_cvar("zp_kuca_heal_range""300")
 
kuca_skill_heal_point register_cvar("zp_kuca_heal_hp_percentage""10")
 
 
register_forward(FM_CmdStart"fw_CmdStart")
 
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
 
 
register_event("ResetHUD","NewRound","be")
 
register_event("DeathMsg""Death""a")
}
public 
plugin_precache()
{
 
precache_sound(HealSound)
 
heal_spr precache_model("sprites/zombie_plague/zombie_healer.spr")
 
g_zclass_kuca zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}
stock ChatColor(const id, const input[], any:...)
{
 new 
count 1players[32]
 static 
msg[191]
 
vformat(msg190input3)
 
 
replace_all(msg190"!g""^4"// Green Color
 
replace_all(msg190"!y""^1"// Default Color
 
replace_all(msg190"!team""^3"// Team Color
 
replace_all(msg190"!team2""^0"// Team2 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();
  }
 }
}
}
public 
zp_user_infected_post(idinfector)
{
 if (
zp_get_user_zombie_class(id) == g_zclass_kuca)
 {
 
set_hud_spr(id,1)
        
ChatColor(id"!g[Zombie Healer]!yPress 'R' to heal yourself and teamates!Healing Range: %.1f,Restore HP: %d%,Cooldowng Time: %.1f."get_pcvar_float(kuca_skill_range), get_pcvar_num(kuca_skill_heal_point), get_pcvar_float(kuca_skill_cooldown))
 }
}
set_hud_spr(id,status)
{
 
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("StatusIcon"),{0,0,0},id);
 
write_byte(status); // status (0=hide, 1=show, 2=flash)
        
write_string("dmg_bio"); // sprite name
 
write_byte(0); // red
 
write_byte(255); // green
 
write_byte(0); // blue
 
message_end();
}
public 
zp_user_humanized_post(id)
{
 
clear(id)
}
public 
Death()
{
 new 
id read_data(2)
 
clear(id)
}
public 
NewRound(id)
{
 
clear(id)
}
public 
client_connect(id)
{
 
clear(id)
}
public 
client_disconnect(id)
{
 
clear(id)
}
public 
clear(id)
{
 
eyes_skill[id] = 0.0
 set_hud_spr
(id,10)
}
public 
fw_CmdStart(iduc_handleseed)
{
 if (!
is_user_alive(id))
  return 
FMRES_IGNORED;
 
 if (!
zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_kuca)
  return 
FMRES_IGNORED;
 
 if (
zp_get_user_nemesis(id))
  return 
FMRES_IGNORED;
 
 static 
buttonoldbuttoni
 button 
get_uc(uc_handleUC_Buttons)
 
oldbutton pev(idpev_oldbuttons)
 
 if ((
button IN_RELOAD) && !(oldbutton IN_RELOAD))
 {
  if (
get_gametime() - eyes_skill[id] < get_pcvar_float(kuca_skill_cooldown))
  {
   
ChatColor(id"!g[Zpmbie Healer]!yDuring the cooldown...")
   return 
FMRES_IGNORED;
  }
 
  for(
1<= get_playersnum(); i++)
   if(
id != && is_user_alive(i) && zp_get_user_zombie(i) && !zp_get_user_nemesis(i))
    if (
is_in_view(idi) && get_range(idi) <= get_pcvar_float(kuca_skill_range))
     
heal_zombie(i)
  
heal_zombie(id)
  
eyes_skill[id] = get_gametime()
 }
 
 
#if defined SUPPORT_BOT_TO_USE
 
if (is_user_bot(id))
 {
  if (
get_gametime() - eyes_skill[id] < get_pcvar_float(kuca_skill_cooldown))
   return 
FMRES_IGNORED;
 
  static 
bool:need_heal_in_view[33]
  for(
1<= get_playersnum(); i++)
  if(
id != && is_user_alive(i) && zp_get_user_zombie(i) && !zp_get_user_nemesis(i)) 
                if (
pev(ipev_health) <= float(zp_get_zombie_maxhealth(i))*(100-get_pcvar_float(kuca_skill_heal_point))/100)
  if (
is_in_view(idi) && get_range(idi) <= get_pcvar_float(kuca_skill_range))
  
need_heal_in_view[id] = true
 
  
if (need_heal_in_view[id] || pev(idpev_health) <= float(zp_get_zombie_maxhealth(id))*(100-get_pcvar_float(kuca_skill_heal_point))/100)
  {
   for(
1<= get_playersnum(); i++)
    if(
id != && is_user_alive(i) && zp_get_user_zombie(i) && !zp_get_user_nemesis(i))
     if (
is_in_view(idi) && get_range(idi) <= get_pcvar_float(kuca_skill_range))
      
heal_zombie(i)
   
heal_zombie(id)
   
need_heal_in_view[id] = false
   eyes_skill
[id] = get_gametime()
  }
 }
 
#endif
 
 
return FMRES_HANDLED;
}
public 
heal_zombie(id)
{
 
show_spr(id)
 
engfunc(EngFunc_EmitSoundidCHAN_AUTOHealSound1.0ATTN_NORM0PITCH_NORM)
 if (
pev(idpev_health) < float(zp_get_zombie_maxhealth(id)))
  
set_pev(idpev_healthfloatmin(pev(idpev_health) + float(zp_get_zombie_maxhealth(id))*get_pcvar_float(kuca_skill_heal_point)/100float(zp_get_zombie_maxhealth(id))))
}
public 
fw_PlayerPreThink(id)
{
 if (!
is_user_alive(id)) return FMRES_IGNORED;
 
 if (
zp_get_user_nemesis(id)) return FMRES_IGNORED;
 
 if (!
zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_kuca) return FMRES_IGNORED;
 
 if (
get_gametime() - eyes_skill[id] >= get_pcvar_float(kuca_skill_cooldown) && get_gametime() - eyes_skill[id] < get_pcvar_float(kuca_skill_cooldown)+0.1)
  
ChatColor(id"!g[Zombie Healer]!yNow you can use your skill again!")
 
 return 
FMRES_IGNORED;
}
stock Float:get_range(indextarget)
{
 static 
Float:origin1[3], Float:origin2[3]
 
pev(indexpev_originorigin1)
 
pev(targetpev_originorigin2)
 
 return 
get_distance_f(origin1,origin2)
}
stock show_spr(id)
{
 static 
Float:origin[3]
 
pev(idpev_originorigin)
 
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0)
 
write_byte(TE_SPRITE)
 
engfunc(EngFunc_WriteCoord,origin[0])
 
engfunc(EngFunc_WriteCoord,origin[1])
 
engfunc(EngFunc_WriteCoord,origin[2]+16)
 
write_short(heal_spr)
 
write_byte(10)
 
write_byte(255)
 
message_end()
}
stock bool:is_in_view(indextargetignoremonsters 1)
{
 if (
index == target) return false;
 new 
Float:angles[3];
 
pev(indexpev_anglesangles);
 
engfunc(EngFunc_MakeVectorsangles);
 
global_get(glb_v_forwardangles);
 
angles[2] = 0.0;
 new 
Float:origin[3], Float:point[3], Float:diff[3], Float:norm[3], Float:view_ofs[3];
 
pev(indexpev_originorigin);
 
pev(targetpev_originpoint);
 
xs_vec_sub(pointorigindiff);
 
diff[2] = 0.0;
 
xs_vec_normalize(diffnorm);
 
pev(indexpev_view_ofsview_ofs);
 
xs_vec_add(originview_ofsorigin);
 
engfunc(EngFunc_TraceLineoriginpointignoremonstersindex0);
 new 
Float:dotFloat:fov;
 
dot xs_vec_dot(normangles);
 
pev(indexpev_fovfov);
 new 
Float:fraction;
 
get_tr2(0TR_flFractionfraction);
 if (
dot >= floatcos(fov M_PI 360) && fraction == 1.0)
  return 
true;
 return 
false;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 03:24.


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