Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[CERERE] Modificare Plugin Zombie Class CSO
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
828
darkboss12345
[Mentally Stable]
Status: Offline
(since 08-03-2019 01:16)
Joined: 25 Mar 2018
Posts: 2
,
Topics: 1
Location:
Targoviste
Reputation:
3.1
Posted: 25-03-2018, 03:08:42
| Translate post to:
... (
Click for more languages
)
Buna ziua, as dori sa ma ajutati sa modific resursele cateorva clase de zombie din CSO
Problema: Am incercat sa le compilez cum am putut, dar nu am reusit
SMA:
Spoiler:
#include <amxmodx>
#include <fun>
#include <fakemeta_util>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <engine>
#include <dhudmessage>
#define PLUGIN "[CSO:Ghost Zombie]"
#define VERSION "1.4"
#define AUTHOR "HoRRoR, Fry!,tERoR Edit/"
new g_zclass_ghost
new const zclass_name[] = "Ghost" // name
new const zclass_info[] = "\y[ \wInvizible \y[\rG\y] ]" // description
new const zclass_model[] = "cso_ghost" // model
new const zclass_clawmodel[] = "v_cso_ghostik.mdl" // claw model
new KNOCKBOMB_GHOST[] = "models/tx/bombjump/v_bomb_invis.mdl"
const zclass_health = 2000 // health
const zclass_speed = 240 // speed
const Float:zclass_gravity = 0.75 // gravity
const Float:zclass_knockback = 0.8// knockback
new i_stealth_time_hud[33]
new g_cooldown[33]
new g_infections[33]
new Float:g_stealth_time[33]
new i_cooldown_time[33]
new g_maxplayers
new Float:g_stealth_time_standart = 7.0 //first stealth time
new Float:g_stealth_cooldown_standart = 30.0 //cooldown time
new const sound_ghost_stealth[] = "tox_cso/zm_skills/invisup.wav" //stealth sound
new const sound_ghost_stealth_end[] = "tox_cso/zm_skills/invisdown.wav" //end stealth sound
new const infect_ghost_sound[] = "zombie_plague/ghost/infect_01.wav"
new const pain_ghost_sound[] = "zombie_plague/ghost/pain_01.wav"
new const pain_ghost_sound2[] = "zombie_plague/ghost/pain_02.wav"
new const death_ghost_sound[] = "zombie_plague/ghost/die_02.wav"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_ghost_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
register_clcmd("drop", "use_ability_one")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_event("CurWeapon","handle_gun","be","1=1")
RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage");
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_forward(FM_EmitSound, "fw_EmitSound")
register_logevent("roundStart", 2, "1=Round_Start")
g_maxplayers = get_maxplayers()
}
public plugin_precache()
{
g_zclass_ghost = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(sound_ghost_stealth)
precache_sound(sound_ghost_stealth_end)
precache_sound(pain_ghost_sound[0])
precache_sound(pain_ghost_sound2[0])
precache_sound(infect_ghost_sound[0])
precache_sound(death_ghost_sound[0])
precache_model(KNOCKBOMB_GHOST)
}
public zp_user_infected_post(id, infector)
{
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_ghost && !zp_get_user_nemesis(id))
{
new text[100]
new note_cooldown = floatround(g_stealth_cooldown_standart)
new note_stealthtime = floatround(g_stealth_time_standart)
format(text,99,"^x04[Ghost]^x01 Ability ^x04[Invisible]^x01. | Timp:^x04 %d ^x01sec.",note_cooldown,note_stealthtime)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
i_cooldown_time[id] = floatround(g_stealth_cooldown_standart)
remove_task(id)
g_stealth_time[id] = g_stealth_time_standart
g_cooldown[id] = 0
g_infections[id] = 0
emit_sound(id, CHAN_WEAPON, infect_ghost_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
if((zp_get_user_zombie_class(infector) == g_zclass_ghost) && !zp_get_user_nemesis(infector))
{
g_stealth_time[infector] = g_stealth_time[infector] + 1;
infections_hud(infector)
}
}
public zp_user_humanized_post(id)
{
remove_task(id)
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255)
}
public zp_user_unfrozen(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
fm_set_user_rendering(id)
}
}
public roundStart()
{
for (new i = 1; i <= g_maxplayers; i++)
{
i_cooldown_time[i] = floatround(g_stealth_cooldown_standart)
g_cooldown[i] = 0
remove_task(i)
}
}
public use_ability_one(id)
{
if(is_valid_ent(id) && is_user_alive(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
if(g_cooldown[id] == 0)
{
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
emit_sound(id, CHAN_STREAM, sound_ghost_stealth, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(g_stealth_time[id],"ghost_make_visible",id)
set_task(g_stealth_cooldown_standart,"reset_cooldown",id)
g_cooldown[id] = 1
i_cooldown_time[id] = floatround(g_stealth_cooldown_standart)
i_stealth_time_hud[id] = floatround(g_stealth_time[id])
set_task(1.0, "ShowHUD", id, _, _, "a",i_cooldown_time[id])
set_task(1.0, "ShowHUDstealthes", id, _, _, "a",i_stealth_time_hud[id])
}
}
}
public ShowHUD(id)
{
if(is_valid_ent(id) && is_user_alive(id))
{
i_cooldown_time[id] = i_cooldown_time[id] - 1;
set_dhudmessage(200, 100, 0, 0.80, 0.87, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_dhudmessage(id, "Next Ability in : %d sec.]",i_cooldown_time[id], LANG_PLAYER, "STEALTH_USE")
}else{
remove_task(id)
}
}
public ShowHUDstealthes(id)
{
if(is_valid_ent(id) && is_user_alive(id))
{
i_stealth_time_hud[id] = i_stealth_time_hud[id] - 1;
set_dhudmessage(100, 100, 100, -1.0, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_dhudmessage(id, "Time Ability : %d",i_stealth_time_hud[id])
}else{
remove_task(id)
}
}
public ghost_make_visible(id)
{
if(is_valid_ent(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
fm_set_user_rendering(id)
emit_sound(id, CHAN_STREAM, sound_ghost_stealth_end, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
public reset_cooldown(id)
{
if(is_valid_ent(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
g_cooldown[id] = 0
new text[100]
format(text,99,"^x04[Ghost]^x01 Ability ^x04[Invisible]^x01 ready.")
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public infections_hud(id)
{
if(is_valid_ent(id) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie_class(id) == g_zclass_ghost)
{
new i_stealth_time = floatround(g_stealth_time[id])
new text[100]
format(text,99,"^x04[Ghost]^x01 The Time of invisibility has come to an end. Passed ^x04[ %d ]^x01sec.",i_stealth_time)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if (!(damage_type & DMG_FALL) || !zp_get_user_zombie(victim) || zp_get_user_zombie_class(victim) != g_zclass_ghost)
return HAM_IGNORED
SetHamParamFloat(4, 0.0)
return HAM_HANDLED
}
public fw_PlayerPreThink(player)
{
if(!is_user_alive(player))
return FMRES_IGNORED
if(zp_get_user_zombie(player) && zp_get_user_zombie_class(player) == g_zclass_ghost)
set_pev(player, pev_flTimeStepSound, 999)
return FMRES_IGNORED
}
public CPlayer__TakeDamage(id, iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamage)
{
if (zp_get_user_zombie_class(id) == g_zclass_ghost && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && !zp_get_user_survivor(id))
{
new rand = random_num(1,2)
switch(rand)
{
case 1: emit_sound(id, CHAN_WEAPON, pain_ghost_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
case 2: emit_sound(id, CHAN_WEAPON, pain_ghost_sound2[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
}
public handle_gun(id)
{
new weap = get_user_weapon(id)
if(weap == CSW_FLASHBANG && zp_get_user_zombie_class(id) == g_zclass_ghost && zp_get_user_zombie(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_GHOST)
}
else if(weap == CSW_SMOKEGRENADE && zp_get_user_zombie_class(id) == g_zclass_ghost && zp_get_user_zombie(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_GHOST)
}
return PLUGIN_HANDLED
}
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
if(!is_user_connected(id))
return FMRES_HANDLED;
if (sample[0] == 'h' && sample[1] == 'o' && sample[2] == 's' && sample[3] == 't' && sample[4] == 'a' && sample[5] == 'g' && sample[6] == 'e')
return FMRES_SUPERCEDE;
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_ghost && !zp_get_user_nemesis(id))
{
if (sample[7] == 'd' && ((sample[8] == 'i' && sample[9] == 'e') || (sample[8] == 'e' && sample[9] == 'a')))
{
emit_sound(id, CHAN_WEAPON, death_ghost_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
return FMRES_IGNORED;
}
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <xs>
#include <hamsandwich>
#include <zombieplague>
#include <dhudmessage>
#define PLUGIN_NAME "[CSO:Heavy Zombie]"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_AUTHOR "Jim/4e/|"
#define SUPPORT_BOT_TO_USE
#define TASK_SET_TRAP 1234
#define TASK_REMOVE_TRAP 4321
// Zombie Attributes
new const zclass_name[] = { "Big Zombie" }
new const zclass_info[] = { "\y[ \wTraps \y[\rR\y] ]" }
new const zclass_model[] = { "heavy_zombi" }
new const zclass_clawmodel[] = { "v_cso_tank2.mdl" }
new KNOCKBOMB_HEAVY[] = "models/tx/bombjump/bomb_heavycso.mdl"
const zclass_health = 8000
const zclass_speed = 240
const Float:zclass_gravity = 0.8
const Float:zclass_knockback = 0.8
new g_chance[33]
new g_msgScreenFade
const FFADE_IN = 0x0000
const FFADE_STAYOUT = 0x0004
const UNIT_SECOND = (1<<12)
new is_cooldown_time[33] = 0
new is_cooldown[33] = 0
// Models
new const Trap_Model[] = { "models/tx/zombie_trap.mdl" }
// Sounds
new const TrapTrigger_Sound[] = { "common/bodysplat.wav" }
new const PlayerCatched_Sound[] = { "tox_cso/zombi_trapped.wav" }
new const CantPlantTrap_Sound[] = { "common/wpn_denyselect.wav" }
new const g_infect_sound[] = "zombie_plague/big/infect_021.wav"
new const pain_heavy_sound[] = "zombie_plague/big/pain_011.wav"
new const pain_heavy_sound2[] = "zombie_plague/big/pain_021.wav"
new const death_heavy_sound[] = "zombie_plague/big/die_021.wav"
// Settings
const Max_Traps = 10
// Weapons Offsets (win32)
const OFFSET_flNextPrimaryAttack = 46
const OFFSET_flNextSecondaryAttack = 47
const OFFSET_flTimeWeaponIdle = 48
// Linux diff's
const OFFSET_LINUX_WEAPONS = 4
// Zombie id
new g_zclass_heavy
new Float:g_revenge_cooldown = 30.0
new g_chance_to_cast = 20
new const sound_sleep[] = "tox_cso/zm_skills/sleepinpact.wav" //cast sound
// Vars
new cvar_TrapSetTime, cvar_TrapAffectTime
new g_TrapPromptSpr, g_PlayerCatchedSpr
new g_msgScreenShake, g_msgBarTime
new g_maxplayers
new user_has_traps[33]
new user_traps_ent[33][Max_Traps]
new bool:user_set_trap[33], set_trap_ent[33], Float:set_trap_origin[33][3]
new bool:user_be_catched[33], catched_trap_ent[33]
#if defined SUPPORT_BOT_TO_USE
new Float:bot_next_check_time[33]
#endif
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
cvar_TrapSetTime = register_cvar("zp_heavy_trap_settime", "3.0")
cvar_TrapAffectTime = register_cvar("zp_heavy_trap_affecttime", "6.0")
g_msgScreenFade = get_user_msgid("ScreenFade")
g_maxplayers = get_maxplayers()
register_logevent("roundStart", 2, "1=Round_Start")
register_forward(FM_CmdStart, "fw_CmdStart")
register_forward(FM_StartFrame, "fw_StartFrame")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_forward(FM_Touch, "fw_Touch")
register_forward(FM_Think, "fw_Think")
register_event("ResetHUD", "event_NewSpawn", "be")
register_forward(FM_EmitSound, "fw_EmitSound")
RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage");
register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
#if defined SUPPORT_BOT_TO_USE
register_event("Damage", "event_Damage", "be", "2>0")
#endif
g_msgScreenShake = get_user_msgid("ScreenShake")
g_msgBarTime = get_user_msgid("BarTime")
g_maxplayers = get_maxplayers()
register_event("CurWeapon", "Event_CurrentWeapon", "be", "1=1")
}
public plugin_precache()
{
precache_model(KNOCKBOMB_HEAVY)
precache_sound(sound_sleep)
precache_model(Trap_Model)
precache_sound(TrapTrigger_Sound)
precache_sound(PlayerCatched_Sound)
precache_sound(CantPlantTrap_Sound)
precache_sound(g_infect_sound[0])
precache_sound(pain_heavy_sound[0])
precache_sound(pain_heavy_sound2[0])
precache_sound(death_heavy_sound[0])
g_TrapPromptSpr = precache_model("sprites/tx/trap.spr")
g_PlayerCatchedSpr = precache_model("sprites/tx/trap_prompt.spr")
g_zclass_heavy = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public client_damage(attacker,victim)
{
if ((zp_get_user_zombie_class(victim) == g_zclass_heavy) && zp_get_user_zombie(victim) && !zp_get_user_nemesis(victim) && (is_cooldown[victim] == 0))
{
g_chance[victim] = random_num(0,999)
if (g_chance[victim] < g_chance_to_cast)
{
message_begin(MSG_ONE, g_msgScreenFade, _, attacker)
write_short(4) // duration
write_short(4) // hold time
write_short(FFADE_STAYOUT) // fade type
write_byte(0) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(255) // alpha
message_end()
set_user_health(victim, get_user_health(victim) + ( get_user_health(victim) / 10 ) )
set_task(4.0,"wake_up",attacker)
set_task(1.0, "ShowHUD", victim, _, _, "a",is_cooldown_time[victim])
set_task(g_revenge_cooldown,"reset_cooldown",victim)
emit_sound(attacker, CHAN_STREAM, sound_sleep, 1.0, ATTN_NORM, 0, PITCH_NORM);
is_cooldown[victim] = 1
}
}
}
public reset_cooldown(id)
{
if ((zp_get_user_zombie_class(id) == g_zclass_heavy) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
is_cooldown[id] = 0
is_cooldown_time[id] = floatround(g_revenge_cooldown)
new text[100]
format(text,99,"^x04[Heavy] «Ability ^x04[Make traps]^x01 Ready.")
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public ShowHUD(id)
{
if(is_user_alive(id))
{
is_cooldown_time[id] = is_cooldown_time[id] - 1;
set_dhudmessage(200, 100, 0, 0.80, 0.87, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_dhudmessage(id, "[Next Ability: %d sec.]",is_cooldown_time[id])
}else{
remove_task(id)
}
}
public wake_up(id)
{
message_begin(MSG_ONE, g_msgScreenFade, _, id)
write_short(UNIT_SECOND) // duration
write_short(0) // hold time
write_short(FFADE_IN) // fade type
write_byte(0) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(255) // alpha
message_end()
}
public zp_user_infected_post(id, infector, player)
{
if (user_be_catched[id])
{
clear_user_sprite(id)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
}
reset_vars(id)
if (zp_get_user_zombie_class(id) == g_zclass_heavy && !zp_get_user_nemesis(id))
{
new text[100]
is_cooldown[id] = 0
is_cooldown_time[id] = floatround(g_revenge_cooldown)
emit_sound(id, CHAN_WEAPON, g_infect_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
new note_cooldown = floatround(g_revenge_cooldown)
format(text,99,"^x04[Heavy] Traps^x04[{Press R]^x01. :^x04 10 Traps.",note_cooldown)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
user_has_traps[id] = Max_Traps
format(text,99,"^x04[Heavy] Traps ^x04[Press R]", Max_Traps)
}
remove_task(id)
is_cooldown[id] = 0
}
public fw_CmdStart(id, uc_handle, seed)
{
if (!is_user_alive(id))
return FMRES_IGNORED;
if (!zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_heavy || zp_get_user_nemesis(id))
return FMRES_IGNORED;
#if defined SUPPORT_BOT_TO_USE
if (is_user_bot(id))
{
bot_use_traps(id)
return FMRES_IGNORED;
}
#endif
static button, oldbutton
button = get_uc(uc_handle, UC_Buttons)
oldbutton = pev(id, pev_oldbuttons)
if (!user_set_trap[id])
{
if ((button & IN_RELOAD) && !(oldbutton & IN_RELOAD))
{
do_set_trap(id)
}
}
else
{
static user_flags, Float:user_origin[3], Float:fdistance
user_flags = pev(id, pev_flags)
pev(id, pev_origin, user_origin)
user_origin[2] -= (user_flags & FL_DUCKING) ? 18.0 : 36.0
fdistance = get_distance_f(user_origin, set_trap_origin[id])
if (!(button & IN_RELOAD) || fdistance > 18.0)
{
stop_set_trap(id)
}
}
return FMRES_HANDLED;
}
public fw_StartFrame()
{
static Float:time, Float:next_check_time, id, i, classname[32], Float:origin1[3], Float:origin2[3]
time = get_gametime()
if (time >= next_check_time)
{
for (id = 1; id <= g_maxplayers; id++)
{
if (!is_user_connected(id) || !is_user_alive(id))
continue;
if (!zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_heavy || zp_get_user_nemesis(id))
continue;
for (i = 0; i < Max_Traps; i++)
{
if (user_traps_ent[id][i] <= 0)
continue;
if (!pev_valid(user_traps_ent[id][i]))
{
user_traps_ent[id][i] = 0
continue;
}
pev(user_traps_ent[id][i], pev_classname, classname, charsmax(classname))
if (!equal(classname, "ZOMBIE_TRAP_ENT"))
{
user_traps_ent[id][i] = 0
continue;
}
if (pev(user_traps_ent[id][i], pev_iuser3) == 1)
continue;
pev(user_traps_ent[id][i], pev_origin, origin1)
xs_vec_copy(origin1, origin2)
origin2[2] += 30.0
if (fm_is_point_visible(id, origin1, 1) || fm_is_point_visible(id, origin2, 1))
{
origin1[2] += 30.0
create_user_sprite(id, origin1, g_TrapPromptSpr, 7)
}
}
}
next_check_time = time + 0.1
}
return FMRES_IGNORED;
}
public fw_PlayerPreThink(id)
{
if (!is_user_alive(id))
return FMRES_IGNORED;
if (zp_get_user_zombie(id))
{
if (zp_get_user_zombie_class(id) != g_zclass_heavy || zp_get_user_nemesis(id))
return FMRES_IGNORED;
if (user_set_trap[id])
{
freeze_user_attack(id)
}
}
else
{
if (user_be_catched[id] && pev_valid(catched_trap_ent[id]))
{
static classname[32]
pev(catched_trap_ent[id], pev_classname, classname, charsmax(classname))
if (!equal(classname, "ZOMBIE_TRAP_ENT"))
return FMRES_IGNORED;
set_pev(id, pev_velocity, Float:{ 0.0, 0.0, -200.0 })
set_pev(id, pev_maxspeed, 1.0)
static Float:user_origin[3], Float:ent_origin[3], Float:temp_origin[3]
pev(id, pev_origin, user_origin)
pev(catched_trap_ent[id], pev_origin, ent_origin)
xs_vec_copy(ent_origin, temp_origin)
temp_origin[2] += 18.0
if (get_distance_f(user_origin, temp_origin) > 18.0)
{
temp_origin[2] += ((pev(id, pev_flags) & FL_DUCKING) ? 0.0 : 18.0)
set_pev(id, pev_origin, temp_origin)
}
}
}
return FMRES_IGNORED;
}
public fw_Touch(ptr, ptd)
{
if (!pev_valid(ptr) || !pev_valid(ptd))
return FMRES_IGNORED;
static classname[32]
pev(ptr, pev_classname, classname, charsmax(classname))
if (!equal(classname, "ZOMBIE_TRAP_ENT"))
return FMRES_IGNORED;
if (!(1 <= ptd <= g_maxplayers) || !is_user_alive(ptd) || zp_get_user_zombie(ptd))
return FMRES_IGNORED;
if (pev(ptr, pev_iuser2) == 0)
return FMRES_IGNORED;
if (pev(ptr, pev_iuser3) == 0 && !user_be_catched[ptd])
{
PlaySound(ptd, TrapTrigger_Sound)
engfunc(EngFunc_EmitSound, ptd, CHAN_VOICE, PlayerCatched_Sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
user_screen_shake(ptd, 4, 2, 5)
show_user_sprite(ptd, g_PlayerCatchedSpr)
static Float:origin[3]
pev(ptr, pev_origin, origin)
origin[2] += ((pev(ptd, pev_flags) & FL_DUCKING) ? 18.0 : 36.0)
set_pev(ptd, pev_origin, origin)
set_pev(ptd, pev_velocity, Float:{ 0.0, 0.0, 0.0 })
client_print(ptd, print_center, "You are captive!")
set_pev(ptr, pev_iuser3, 1)
set_pev(ptr, pev_iuser4, ptd)
user_be_catched[ptd] = true
catched_trap_ent[ptd] = ptr
fm_set_rendering(ptr, kRenderFxNone, 0,0,0, kRenderNormal, 255)
set_pev(ptr, pev_nextthink, get_gametime() + 0.05)
static owner
owner = pev(ptr, pev_iuser1)
if (1 <= owner <= g_maxplayers)
client_print(owner, print_center, "Somebody fell into the trap!")
static Float:trap_affect_time
trap_affect_time = get_pcvar_float(cvar_TrapAffectTime)
if (trap_affect_time > 0.0)
{
static args[1]
args[0] = ptr
set_task(trap_affect_time, "remove_trap", TASK_REMOVE_TRAP, args, 1)
}
}
return FMRES_IGNORED;
}
public fw_Think(ent)
{
if (pev_valid(ent))
{
static classname[32]
pev(ent, pev_classname, classname, charsmax(classname))
if (equal(classname, "ZOMBIE_TRAP_ENT"))
{
if (pev(ent, pev_sequence) != 1)
{
set_pev(ent, pev_sequence, 1)
set_pev(ent, pev_frame, 0.0)
}
else
{
if (pev(ent, pev_frame) > 241.0)
set_pev(ent, pev_frame, 20.0)
else
set_pev(ent, pev_frame, pev(ent, pev_frame) + 1.0)
}
static catched_player
catched_player = pev(ent, pev_iuser4)
if (!user_be_catched[catched_player] || catched_trap_ent[catched_player] != ent)
{
engfunc(EngFunc_RemoveEntity, ent)
return FMRES_IGNORED;
}
set_pev(ent, pev_nextthink, get_gametime() + 0.05)
}
}
return FMRES_IGNORED;
}
freeze_user_attack(id)
{
new weapon, weapon_name[32], weapon_ent
weapon = get_user_weapon(id)
get_weaponname(weapon, weapon_name, charsmax(weapon_name))
weapon_ent = fm_find_ent_by_owner(-1, weapon_name, id)
if (get_weapon_next_pri_attack(weapon_ent) <= 0.1)
set_weapon_next_pri_attack(weapon_ent, 0.5)
if (get_weapon_next_sec_attack(weapon_ent) <= 0.1)
set_weapon_next_sec_attack(weapon_ent, 0.5)
if (weapon == CSW_XM1014 || weapon == CSW_M3)
{
if (get_weapon_idle_time(weapon_ent) <= 0.1)
set_weapon_idle_time(weapon_ent, 0.5)
}
}
do_set_trap(id)
{
if (!user_set_trap[id])
{
if (set_a_trap(id, set_trap_ent[id], set_trap_origin[id]) == 1)
{
user_set_trap[id] = true
new Float:velocity[3]
pev(id, pev_velocity, velocity)
velocity[0] = velocity[1] = 0.0
set_pev(id, pev_velocity, velocity)
new Float:set_trap_time, task_time
set_trap_time = get_pcvar_float(cvar_TrapSetTime)
task_time = floatround(set_trap_time, floatround_floor) + (floatfract(set_trap_time) >= 0.5 ? 1 : 0)
set_task(set_trap_time, "trap_complete", (id + TASK_SET_TRAP))
show_user_taskbar(id, task_time)
client_print(id, print_center, "The trap is activated...")
return 1;
}
}
return 0;
}
stop_set_trap(id)
{
if (user_set_trap[id])
{
client_print(id, print_center, "")
if (pev_valid(set_trap_ent[id]))
engfunc(EngFunc_RemoveEntity, set_trap_ent[id])
user_set_trap[id] = false
set_trap_ent[id] = 0
remove_task(id + TASK_SET_TRAP)
show_user_taskbar(id, 0)
}
}
set_a_trap(id, &trap_entity, Float:trap_origin[3])
{
if (user_has_traps[id] <= 0)
{
engfunc(EngFunc_EmitSound, id, CHAN_ITEM, CantPlantTrap_Sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_center, "You have reached the maximum limit of traps")
return 0;
}
new user_flags = pev(id, pev_flags)
if (!(user_flags & FL_ONGROUND))
{
engfunc(EngFunc_EmitSound, id, CHAN_ITEM, CantPlantTrap_Sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_center, "Can not set a trap")
return 0;
}
new Float:origin[3]
pev(id, pev_origin, origin)
origin[2] -= (user_flags & FL_DUCKING) ? 18.0 : 36.0
if (get_too_close_traps(origin))
{
engfunc(EngFunc_EmitSound, id, CHAN_ITEM, CantPlantTrap_Sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_center, "Traps are close!")
return 0;
}
client_print(id, print_center, "")
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if (!ent) return -1;
// Set trap data
set_pev(ent, pev_classname, "ZOMBIE_TRAP_ENT")
set_pev(ent, pev_solid, SOLID_TRIGGER)
set_pev(ent, pev_movetype, MOVETYPE_FLY)
set_pev(ent, pev_sequence, 0)
set_pev(ent, pev_frame, 0.0)
set_pev(ent, pev_iuser1, id)
set_pev(ent, pev_iuser2, 0)
set_pev(ent, pev_iuser3, 0)
set_pev(ent, pev_iuser4, 0)
// Set trap size
new Float:mins[3] = { -20.0, -20.0, 0.0 }
new Float:maxs[3] = { 20.0, 20.0, 30.0 }
engfunc(EngFunc_SetSize, ent, mins, maxs)
// Set trap model
engfunc(EngFunc_SetModel, ent, Trap_Model)
// Make trap invisible
fm_set_rendering(ent, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 0)
// Set trap position
set_pev(ent, pev_origin, origin)
// Return trap entity id
trap_entity = ent
// Return trap position
xs_vec_copy(origin, trap_origin)
return 1;
}
public trap_complete(taskid)
{
new id = taskid - TASK_SET_TRAP
show_user_taskbar(id, 0)
if (pev_valid(set_trap_ent[id]))
{
set_pev(set_trap_ent[id], pev_iuser2, 1)
user_has_traps[id]--
set_user_traps_data(id, set_trap_ent[id])
client_print(id, print_center, "The trap is set!")
}
#if defined SUPPORT_BOT_TO_USE
if (is_user_bot(id))
{
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
bot_next_check_time[id] = get_gametime() + 10.0
}
#endif
user_set_trap[id] = false
set_trap_ent[id] = 0
}
public remove_trap(args[1])
{
new ent = args[0]
if (pev_valid(ent))
{
new classname[32]
pev(ent, pev_classname, classname, charsmax(classname))
if (!equal(classname, "ZOMBIE_TRAP_ENT"))
return;
new catched_player = pev(ent, pev_iuser4)
if (user_be_catched[catched_player] && catched_trap_ent[catched_player] == ent)
{
clear_user_sprite(catched_player)
set_pev(catched_player, pev_flags, (pev(catched_player, pev_flags) & ~FL_FROZEN))
user_be_catched[catched_player] = false
catched_trap_ent[catched_player] = 0
}
engfunc(EngFunc_RemoveEntity, ent)
}
}
public zp_user_humanized_post(id)
{
if (user_set_trap[id])
{
stop_set_trap(id)
#if defined SUPPORT_BOT_TO_USE
if (pev(id, pev_flags) & FL_FROZEN)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
#endif
}
reset_traps_owner(id)
reset_vars(id)
}
public client_connect(id)
{
reset_vars(id)
}
public client_disconnect(id)
{
if (user_set_trap[id])
{
stop_set_trap(id)
#if defined SUPPORT_BOT_TO_USE
if (pev(id, pev_flags) & FL_FROZEN)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
#endif
}
if (user_be_catched[id])
{
clear_user_sprite(id)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
}
reset_vars(id)
}
public event_NewSpawn(id)
{
if (user_set_trap[id])
{
stop_set_trap(id)
#if defined SUPPORT_BOT_TO_USE
if (pev(id, pev_flags) & FL_FROZEN)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
#endif
}
if (user_be_catched[id])
{
clear_user_sprite(id)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
}
reset_vars(id)
}
public event_Death()
{
new id = read_data(2)
if (!(1 <= id <= g_maxplayers))
return;
if (user_set_trap[id])
{
stop_set_trap(id)
#if defined SUPPORT_BOT_TO_USE
if (pev(id, pev_flags) & FL_FROZEN)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
#endif
}
if (user_be_catched[id])
{
clear_user_sprite(id)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
}
reset_traps_owner(id)
reset_vars(id)
}
public event_RoundStart()
{
remove_task(TASK_REMOVE_TRAP)
remove_all_traps()
}
get_too_close_traps(const Float:origin[3])
{
new bool:find, ent, Float:ent_origin[3]
find = false
ent = -1
while ((ent = fm_find_ent_by_class(ent, "ZOMBIE_TRAP_ENT")))
{
if (pev(ent, pev_iuser2) == 1)
{
pev(ent, pev_origin, ent_origin)
if (get_distance_f(origin, ent_origin) <= 50.0)
find = true
}
}
if (!find) return 0;
return 1;
}
set_user_traps_data(id, trap_ent)
{
new bool:find = false
for (new i = 0; i < Max_Traps; i++)
{
if (user_traps_ent[id][i] == 0)
{
user_traps_ent[id][i] = trap_ent
find = true
break;
}
}
if (!find) return 0;
return 1;
}
reset_traps_owner(id)
{
new classname[32], owner
for (new i = 0; i < Max_Traps; i++)
{
if (user_traps_ent[id][i] > 0 && pev_valid(user_traps_ent[id][i]))
{
pev(user_traps_ent[id][i], pev_classname, classname, charsmax(classname))
owner = pev(user_traps_ent[id][i], pev_iuser1)
if (equal(classname, "ZOMBIE_TRAP_ENT") && owner == id)
set_pev(user_traps_ent[id][i], pev_iuser1, 0)
}
}
}
remove_all_traps()
{
new ent = -1
while ((ent = fm_find_ent_by_class(ent, "ZOMBIE_TRAP_ENT")))
{
engfunc(EngFunc_RemoveEntity, ent)
}
}
reset_vars(id)
{
user_has_traps[id] = 0
user_set_trap[id] = false
set_trap_ent[id] = 0
user_be_catched[id] = false
catched_trap_ent[id] = 0
for (new i = 0; i < Max_Traps; i++)
user_traps_ent[id][i] = 0
}
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
new Float:RenderColor[3];
RenderColor[0] = float(r);
RenderColor[1] = float(g);
RenderColor[2] = float(b);
set_pev(entity, pev_renderfx, fx);
set_pev(entity, pev_rendercolor, RenderColor);
set_pev(entity, pev_rendermode, render);
set_pev(entity, pev_renderamt, float(amount));
return 1;
}
stock fm_find_ent_by_class(index, const classname[])
{
return engfunc(EngFunc_FindEntityByString, index, "classname", classname)
}
stock PlaySound(id, const sound[])
{
if (equal(sound[strlen(sound)-4], ".mp3"))
client_cmd(id, "mp3 play ^"sound/%s^"", sound)
else
client_cmd(id, "spk ^"%s^"", sound)
}
stock user_screen_shake(id, amplitude = 4, duration = 2, frequency = 10)
{
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenShake, _, id)
write_short((1<<12)*amplitude)
write_short((1<<12)*duration)
write_short((1<<12)*frequency)
message_end()
}
stock show_user_taskbar(id, time)
{
message_begin(MSG_ONE_UNRELIABLE, g_msgBarTime, _, id)
write_short(time) // time (second) [0=clear]
message_end()
}
stock show_user_sprite(id, const sprite_index)
{
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_PLAYERATTACHMENT) // TE_PLAYERATTACHMENT (124)
write_byte(id) // player id
write_coord(45) // vertical offset (attachment origin.z = player origin.z + vertical offset)
write_short(sprite_index) // sprite entity index
write_short(32767) // life (scale in 0.1's)
message_end()
}
stock clear_user_sprite(id)
{
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_KILLPLAYERATTACHMENTS) // TE_KILLPLAYERATTACHMENTS (125)
write_byte(id) // player id
message_end()
}
stock bool:fm_is_point_visible(index, const Float:point[3], ignoremonsters = 1)
{
new Float:start[3], Float:dest[3];
pev(index, pev_origin, start);
pev(index, pev_view_ofs, dest);
xs_vec_add(start, dest, start);
engfunc(EngFunc_TraceLine, start, point, ignoremonsters, index, 0);
new Float:fraction;
get_tr2(0, TR_flFraction, fraction);
if (fraction == 1.0)
return true;
get_tr2(0, TR_vecEndPos, dest);
if ((dest[0] == point[0]) && (dest[1] == point[1]) && (dest[2] == point[2]))
return true;
return false;
}
stock create_user_sprite(id, const Float:originF[3], sprite_index, scale)
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE) // TE id (Additive sprite, plays 1 cycle)
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
write_short(sprite_index) // sprite index
write_byte(scale) // scale in 0.1's
write_byte(200) // brightness
message_end()
}
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && (pev(entity, pev_owner) != owner)) {}
return entity;
}
stock Float:get_weapon_next_pri_attack(entity)
{
return get_pdata_float(entity, OFFSET_flNextPrimaryAttack, OFFSET_LINUX_WEAPONS)
}
stock set_weapon_next_pri_attack(entity, Float:time)
{
set_pdata_float(entity, OFFSET_flNextPrimaryAttack, time, OFFSET_LINUX_WEAPONS)
}
stock Float:get_weapon_next_sec_attack(entity)
{
return get_pdata_float(entity, OFFSET_flNextSecondaryAttack, OFFSET_LINUX_WEAPONS)
}
stock set_weapon_next_sec_attack(entity, Float:time)
{
set_pdata_float(entity, OFFSET_flNextSecondaryAttack, time, OFFSET_LINUX_WEAPONS)
}
stock Float:get_weapon_idle_time(entity)
{
return get_pdata_float(entity, OFFSET_flTimeWeaponIdle, OFFSET_LINUX_WEAPONS)
}
stock set_weapon_idle_time(entity, Float:time)
{
set_pdata_float(entity, OFFSET_flTimeWeaponIdle, time, OFFSET_LINUX_WEAPONS)
}
#if defined SUPPORT_BOT_TO_USE
public bot_use_traps(id)
{
//if (!is_user_alive(id))
// return;
//if (!zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zclass_Brutalheavy || zp_get_user_nemesis(id))
// return;
static target, hitzone, distance
target = get_valid_aim_target(id, hitzone, distance)
if (!user_set_trap[id])
{
static Float:time
time = get_gametime()
if (target > 0 && (500 <= distance <= 1000) && time >= bot_next_check_time[id])
{
if (random_num(1, 100) > 85)
{
if (do_set_trap(id))
set_pev(id, pev_flags, (pev(id, pev_flags) | FL_FROZEN))
}
bot_next_check_time[id] = time + 1.0
}
}
else
{
static Float:user_origin[3], Float:fdistance
pev(id, pev_origin, user_origin)
user_origin[2] = set_trap_origin[id][2]
fdistance = get_distance_f(user_origin, set_trap_origin[id])
if ((target > 0 && distance <= 200) || fdistance > 18.0)
{
stop_set_trap(id)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
}
}
}
public event_Damage(id)
{
new attacker, weapon, hitzone
attacker = get_user_attacker(id, weapon, hitzone)
if (!(1 <= attacker <= g_maxplayers) || !is_user_connected(attacker) || !is_user_alive(attacker)
|| attacker == id)
return;
new damage = read_data(2)
if (is_user_bot(id) && damage > 0)
{
new Float:origin1[3], Float:origin2[3], distance
pev(id, pev_origin, origin1)
pev(attacker, pev_origin, origin2)
distance = floatround(get_distance_f(origin1, origin2))
if (distance < 500 || damage > 100)
{
if (user_set_trap[id])
{
stop_set_trap(id)
set_pev(id, pev_flags, (pev(id, pev_flags) & ~FL_FROZEN))
}
}
}
}
get_valid_aim_target(id, &hitzone, &distance)
{
new target, aim_hitzone
get_user_aiming(id, target, aim_hitzone)
if (!(1 <= target <= g_maxplayers) || !is_user_alive(target) || zp_get_user_zombie(target))
return 0;
hitzone = aim_hitzone
new Float:origin1[3], Float:origin2[3]
pev(id, pev_origin, origin1)
pev(target, pev_origin, origin2)
distance = floatround(get_distance_f(origin1, origin2), floatround_round)
return target;
}
#endif
public roundStart()
{
for (new i = 1; i <= g_maxplayers; i++)
{
is_cooldown[i] = 0
is_cooldown_time[i] = floatround(g_revenge_cooldown)
remove_task(i)
}
}
public CPlayer__TakeDamage(id, iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamage)
{
if (zp_get_user_zombie_class(id) == g_zclass_heavy && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && !zp_get_user_survivor(id))
{
new rand = random_num(1,2)
switch(rand)
{
case 1: emit_sound(id, CHAN_WEAPON, pain_heavy_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
case 2: emit_sound(id, CHAN_WEAPON, pain_heavy_sound2[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
}
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
if(!is_user_connected(id))
return FMRES_HANDLED;
if (sample[0] == 'h' && sample[1] == 'o' && sample[2] == 's' && sample[3] == 't' && sample[4] == 'a' && sample[5] == 'g' && sample[6] == 'e')
return FMRES_SUPERCEDE;
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_heavy && !zp_get_user_nemesis(id))
{
if (sample[7] == 'd' && ((sample[8] == 'i' && sample[9] == 'e') || (sample[8] == 'e' && sample[9] == 'a')))
{
emit_sound(id, CHAN_WEAPON, death_heavy_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
return FMRES_IGNORED;
}
public Event_CurrentWeapon(id)
{
new weaponID = read_data(2)
if (weaponID == CSW_SMOKEGRENADE)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_heavy && !zp_get_user_nemesis(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_HEAVY)
}
if (weaponID == CSW_FLASHBANG)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_heavy&& !zp_get_user_nemesis(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_HEAVY)
}
}
#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <hamsandwich>
#include <zombieplague>
#include <fun>
#include <dhudmessage>
#define PLUGIN "[CSO:Hunter Zombie]"
#define VERSION "1.2"
#define AUTHOR "HoRRoR/tERoR edit"
// Zombie Attributes
new const zclass_name[] = "Faster"
new const zclass_info[] = "\y[ \wFast Run \y[\rG] ]"
new const zclass_model[] = "toxhunter" // model
new const zclass_clawmodel[] = "v_begyH.mdl" // claw model
new KNOCKBOMB_HUNTER[] = "models/tx/bombjump/v_bomb_begyH.mdl" //zbomb model
const zclass_health = 2500 // health
const zclass_speed = 245 // speed
const Float:zclass_gravity = 0.8 // gravity
const Float:zclass_knockback = 0.8 // knockback
// --- config ------------------------ //
#define TRAIL_LIFE 2
#define TRAIL_WIDTH 10
#define TRAIL_RED 0
#define TRAIL_GREEN 0
#define TRAIL_BLUE 0
#define TRAIL_BRIGTHNESS 220
new Float:g_fastspeed = 1000.0 // sprint speed
new Float:g_normspeed = 245.0 // norm speed. must be as zclass_speed
new Float:g_abilonecooldown = 30.0 // cooldown time
new Float:g_abilonelenght = 1.2 // time of sprint
new const g_infect_sound[] = "zombie_plague/hunter/infect_01.wav"
new const pain_hunter_sound[] = "zombie_plague/hunter/pain_011.wav"
new const pain_hunter_sound2[] = "zombie_plague/hunter/pain_021.wav"
new const death_hunter_sound[] = "zombie_plague/hunter/die_02.wav" //death
new const sound_hunter_sprint[] = "tox_cso/hunters.wav" // sprint sound
new const sound_hunter_endspr[] = "tox_cso/sprintendhun.wav" // end sound
// ----------------------------------- //
new i_cooldown_time[33]
new g_zclass_hunter
new g_speeded[33] = 0
new g_abil_one_used[33] = 0
new gTrail
new g_maxplayers
public plugin_precache()
{
g_zclass_hunter = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(sound_hunter_sprint)
precache_sound(sound_hunter_endspr)
precache_model(KNOCKBOMB_HUNTER)
precache_sound(pain_hunter_sound[0])
precache_sound(pain_hunter_sound2[0])
precache_sound(g_infect_sound[0])
precache_sound(death_hunter_sound[0])
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("drop", "use_ability_one")
register_event("CurWeapon", "Event_CurrentWeapon", "be", "1=1")
register_forward( FM_PlayerPreThink, "client_prethink" )
register_logevent("roundStart", 2, "1=Round_Start")
RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage");
register_forward(FM_EmitSound, "fw_EmitSound")
g_maxplayers = get_maxplayers()
gTrail = engfunc(EngFunc_PrecacheModel,"sprites/cso_trailv2.spr")
}
public client_prethink(id)
{
if (zp_get_user_zombie_class(id) == g_zclass_hunter)
{
if(is_user_alive(id) && zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_hunter) && !zp_get_user_nemesis(id))
Action(id);
}
}
public Action(id)
{
if (g_speeded[id] == 1)
{
set_user_maxspeed(id , g_fastspeed);
}
else
{
set_user_maxspeed(id , g_normspeed);
}
return PLUGIN_HANDLED;
}
public roundStart()
{
for (new i = 1; i <= g_maxplayers; i++)
{
i_cooldown_time[i] = floatround(g_abilonecooldown)
g_abil_one_used[i] = 0
g_speeded[i] = 0
remove_task(i)
client_cmd(i,"cl_forwardspeed 300")
client_cmd(i,"cl_backspeed 300")
}
}
public ShowHUD(id)
{
if(is_user_alive(id))
{
i_cooldown_time[id] = i_cooldown_time[id] - 1;
set_dhudmessage(200, 100, 0, 0.80, 0.87, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_dhudmessage(id, [Next Ability in : %d sec.]",i_cooldown_time[id])
}else{
remove_task(id)
}
}
public use_ability_one(id)
{
if (is_user_alive(id) && (zp_get_user_zombie_class(id) == g_zclass_hunter) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
if(g_abil_one_used[id] == 0)
{
fm_set_rendering(id, kRenderFxGlowShell, 170, 0, 0, kRenderNormal, 0)
client_cmd(id,"cl_forwardspeed 1000")
client_cmd(id,"cl_backspeed 1000")
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (TE_BEAMFOLLOW)
write_short (id)
write_short (gTrail)
write_byte (TRAIL_LIFE)
write_byte (TRAIL_WIDTH)
write_byte (TRAIL_RED)
write_byte (TRAIL_GREEN)
write_byte (TRAIL_BLUE)
write_byte (TRAIL_BRIGTHNESS)
message_end()
red_screen(id)
g_speeded[id] = 1
emit_sound(id, CHAN_STREAM, sound_hunter_sprint, 1.0, ATTN_NORM, 0, PITCH_NORM)
g_abil_one_used[id] = 1
set_task(g_abilonelenght, "set_normal_speed", id)
i_cooldown_time[id] = floatround(g_abilonecooldown)
set_task(1.0, "ShowHUD", id, _, _, "a",i_cooldown_time[id])
// client_print(id,print_chat,"[dev] - use ability")
}
}
}
public set_normal_speed(id)
{
if ((zp_get_user_zombie_class(id) == g_zclass_hunter) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
fm_set_user_rendering(id)
emit_sound(id, CHAN_STREAM, sound_hunter_endspr, 1.0, ATTN_NORM, 0, PITCH_NORM)
g_speeded[id] = 0
client_cmd(id,"cl_forwardspeed 300")
client_cmd(id,"cl_backspeed 300")
set_task(g_abilonecooldown,"set_ability_one_cooldown",id)
}
}
red_screen(const id, const iFade = 1)
{
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),_,id)
write_short(8192 * iFade)
write_short(8192 * iFade)
write_short(0x0000)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(125)
message_end()
}
public set_ability_one_cooldown(id)
{
if ((zp_get_user_zombie_class(id) == g_zclass_hunter) && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))
{
g_abil_one_used[id] = 0
new text[100]
format(text,99,"^x04[Hunter] «Speed ability!!!")
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
}
}
public zp_user_infected_post(id, infector)
{
if ((zp_get_user_zombie_class(id) == g_zclass_hunter) && !zp_get_user_nemesis(id))
{
emit_sound(id, CHAN_WEAPON, g_infect_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
new text[100]
new note_cooldown = floatround(g_abilonecooldown)
format(text,99,"^x04[Hunter] «Ability^x04 [Speed]^x01 | Time:^x04 %d ^x01sec.",note_cooldown)
message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},id)
write_byte(id)
write_string(text)
message_end()
i_cooldown_time[id] = floatround(g_abilonecooldown)
remove_task(id)
g_speeded[id] = 0
g_abil_one_used[id] = 0
}
}
public zp_user_humanized_post(id)
{
remove_task(id)
client_cmd(id,"cl_forwardspeed 300")
client_cmd(id,"cl_backspeed 300")
}
public Event_CurrentWeapon(id)
{
new weaponID = read_data(2)
if (weaponID == CSW_SMOKEGRENADE)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_hunter && !zp_get_user_nemesis(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_HUNTER)
}
if (weaponID == CSW_FLASHBANG)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_hunter && !zp_get_user_nemesis(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_HUNTER)
}
}
public CPlayer__TakeDamage(id, iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamage)
{
if (zp_get_user_zombie_class(id) == g_zclass_hunter && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && !zp_get_user_survivor(id))
{
new rand = random_num(1,2)
switch(rand)
{
case 1: emit_sound(id, CHAN_WEAPON, pain_hunter_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
case 2: emit_sound(id, CHAN_WEAPON, pain_hunter_sound2[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
}
public fw_EmitSound(id, channel, const sample[], Float:volume, Float:attn, flags, pitch)
{
if(!is_user_connected(id))
return FMRES_HANDLED;
if (sample[0] == 'h' && sample[1] == 'o' && sample[2] == 's' && sample[3] == 't' && sample[4] == 'a' && sample[5] == 'g' && sample[6] == 'e')
return FMRES_SUPERCEDE;
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_hunter && !zp_get_user_nemesis(id))
{
if (sample[7] == 'd' && ((sample[8] == 'i' && sample[9] == 'e') || (sample[8] == 'e' && sample[9] == 'a')))
{
emit_sound(id, CHAN_WEAPON, death_hunter_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
return FMRES_IGNORED;
}
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <xs>
#include <hamsandwich>
#include <zombieplague>
// Zombie Attributes
new const zclass_name[] = "Shaman" // name
new const zclass_info[] = "\y[ \wAlarm \y[\rR]y] ]" // description
new const zclass_model[] = "Shaman" // model
new const zclass_clawmodel[] = "v_shaman.mdl" // claw model
new const zclass_ring_sprite[] = "sprites/tx/shockwave.spr" // ring sprite
new const zclass_screamsounds[][] = { "tox_cso/zm_skills/shaman-scream.wav" } // scream sound
new const g_infect_sound[] = "tox_cso/infectshaman.wav"
new const pain_shaman_sound[] = "zombie_plague/shaman/pain_021.wav"
new const pain_shaman_sound2[] = "zombie_plague/shaman/pain_031.wav"
new const death_shaman_sound[] = "zombie_plague/shaman/die_03.wav"
new KNOCKBOMB_SHAMAN[] = "models/tx/bombjump/bomb_shamancso.mdl"
// Scream ring color R G B
new zclass_ring_colors[3] = { 255, 10, 0 }
const zclass_health = 3000 // health
const zclass_speed = 235 // speed
const Float:zclass_gravity = 0.7 // gravity
const Float:zclass_knockback = 0.8 // knockback
/*================================================================================
Customization ends here! Yes, that's it. Editing anything beyond
here is not officially supported. Proceed at your own risk...
=================================================================================*/
// Variables
new g_ishamanZID, g_iMaxPlayers, g_msgSayText, g_msgScreenFade, g_msgScreenShake,
g_msgBarTime, g_sprRing
// Arrays
new g_iPlayerTaskTimes[33]
// Cvar pointers
new cvar_screammode, cvar_duration, cvar_screamdmg, cvar_startime, cvar_reloadtime,
cvar_radius, cvar_damagemode, cvar_slowdown
// Cached cvars
new g_iCvar_ScreamMode, g_iCvar_ScreamDuration, g_iCvar_ScreamDmg,
g_iCvar_ScreamStartTime, Float:g_flCvar_ReloadTime, Float:g_flCvar_Radius,
g_iCvar_DamageMode, Float:g_flCvar_ScreamSlowdown
// Bools
new bool:g_bIsConnected[33], bool:g_bIsAlive[33], bool:g_bInScreamProcess[33],
bool:g_bCanDoScreams[33], bool:g_bKilledByScream[33], bool:g_bRoundEnding
// Some constants
const FFADE_IN = 0x0000
const GIB_NEVER = 0
const UNIT_SECOND = (1<<12)
const TASK_SCREAM = 37729
const TASK_RELOAD = 55598
const TASK_SCREAMDMG = 48289
const NADE_TYPE_INFECTION = 1111
// Plug info.
#define PLUG_VERSION "0.1"
#define PLUG_AUTH "meTaLiCroSS"
// Macros
#define is_user_valid_alive(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsAlive[%1])
#define is_user_valid_connected(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])
#define zp_get_grenade_type(%1) (entity_get_int(%1, EV_INT_flTimeStepSound))
/*================================================================================
[Init, CFG and Precache]
=================================================================================*/
public plugin_init()
{
// Plugin Info
register_plugin("[CSO:Shaman Zombie]", PLUG_VERSION, PLUG_AUTH)
// Main events
register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
register_event("CurWeapon", "Event_CurrentWeapon", "be", "1=1")
// Main messages
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
register_event("DeathMsg","Death_Zombie","a")
RegisterHam(Ham_TakeDamage, "player", "CPlayer__TakeDamage");
// Fakemeta Forwards
register_forward(FM_CmdStart, "fw_CmdStart")
// Hamsandwich Forward
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
// Cvars
cvar_screammode = register_cvar("zp_shaman_mode", "0")
cvar_duration = register_cvar("zp_shaman_scream_duration", "3")
cvar_screamdmg = register_cvar("zp_shaman_scream_damage", "1.5")
cvar_startime = register_cvar("zp_shaman_scream_start_time", "1")
cvar_reloadtime = register_cvar("zp_shaman_scream_reload_time", "30.0")
cvar_radius = register_cvar("zp_shaman_scream_radius", "250.0")
cvar_damagemode = register_cvar("zp_shaman_damage_mode", "0")
cvar_slowdown = register_cvar("zp_shaman_damage_slowdown", "0.4")
static szCvar[30]
formatex(szCvar, charsmax(szCvar), "v%s by %s", PLUG_VERSION, PLUG_AUTH)
register_cvar("g_zclass_shaman", szCvar, FCVAR_SERVER|FCVAR_SPONLY)
// Vars
g_iMaxPlayers = get_maxplayers()
g_msgBarTime = get_user_msgid("BarTime")
g_msgSayText = get_user_msgid("SayText")
g_msgScreenFade = get_user_msgid("ScreenFade")
g_msgScreenShake = get_user_msgid("ScreenShake")
}
public plugin_cfg()
{
cache_cvars()
}
public plugin_precache()
{
g_ishamanZID = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_model(KNOCKBOMB_SHAMAN)
g_sprRing = precache_model(zclass_ring_sprite)
for(new i = 0; i < sizeof zclass_screamsounds; i++) precache_sound(zclass_screamsounds[i])
precache_sound(pain_shaman_sound[0])
precache_sound(pain_shaman_sound2[0])
precache_sound(g_infect_sound[0])
precache_sound(death_shaman_sound[0])
}
public event_RoundStart()
{
cache_cvars()
g_bRoundEnding = false
}
public message_DeathMsg(msg_id, msg_dest, id)
{
static iAttacker, iVictim
// Get attacker and victim
iAttacker = get_msg_arg_int(1)
iVictim = get_msg_arg_int(2)
// Non-player attacker or self kill
if(!is_user_connected(iAttacker) || iAttacker == iVictim)
return PLUGIN_CONTINUE
// Killed by shaman scream
if(g_bKilledByScream[iVictim])
set_msg_arg_string(4, "shaman scream")
return PLUGIN_CONTINUE
}
public client_putinserver(id)
{
g_bIsConnected[id] = true
}
public client_disconnect(id)
{
g_bIsAlive[id] = false
g_bIsConnected[id] = false
}
public fw_PlayerSpawn_Post(id)
{
if(!is_user_alive(id)) return HAM_IGNORED
g_bIsAlive[id] = true
stop_scream_task(id)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_ishamanZID)
g_bCanDoScreams[id] = true
else
g_bCanDoScreams[id] = false
g_iPlayerTaskTimes[id] = 0
remove_task(id+TASK_RELOAD)
remove_task(id+TASK_SCREAMDMG)
return HAM_IGNORED
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
// Player victim
if(is_user_valid_connected(victim))
{
// Victim is not alive
g_bIsAlive[victim] = false
// Reset player vars and tasks
stop_scream_task(victim)
g_bCanDoScreams[victim] = false
g_iPlayerTaskTimes[victim] = 0
remove_task(victim+TASK_RELOAD)
remove_task(victim+TASK_SCREAMDMG)
return HAM_HANDLED
}
return HAM_IGNORED
}
public fw_CmdStart(id, handle, random_seed)
{
// Not alive
if(!is_user_alive(id))
return FMRES_IGNORED;
// Isn't a zombie?
if(!zp_get_user_zombie(id) || zp_get_user_nemesis(id))
return FMRES_IGNORED;
// Invalid class id
if(zp_get_user_zombie_class(id) != g_ishamanZID)
return FMRES_IGNORED;
// Get user old and actual buttons
static iInUseButton, iInUseOldButton
iInUseButton = (get_uc(handle, UC_Buttons) & IN_RELOAD)
iInUseOldButton = (get_user_oldbutton(id) & IN_RELOAD)
// Pressing +use button
if(iInUseButton)
{
// Last used button isn't +use, i need to
// do this, because i call this "only" 1 time
if(!iInUseOldButton && g_bCanDoScreams[id] && !task_exists(id+TASK_SCREAMDMG) && !g_bRoundEnding)
{
// A bar appears in his screen
message_begin(MSG_ONE, g_msgBarTime, _, id)
write_byte(g_iCvar_ScreamStartTime) // time
write_byte(0) // unknown
message_end()
// Update bool
g_bInScreamProcess[id] = true
// Next scream time
set_task(g_iCvar_ScreamStartTime + 0.2, "task_do_scream", id+TASK_SCREAM)
return FMRES_HANDLED
}
}
else
{
// Last used button it's +use
if(iInUseOldButton && g_bInScreamProcess[id])
{
// Stop scream main task
stop_scream_task(id)
return FMRES_HANDLED
}
}
return FMRES_IGNORED
}
public task_do_scream(id)
{
// Normalize task
id -= TASK_SCREAM
// Do scream sound
emit_sound(id, CHAN_VOICE, zclass_screamsounds[random_num(0, sizeof zclass_screamsounds - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
// Block screams
g_bCanDoScreams[id] = false
// Reload task
set_task(g_flCvar_ReloadTime, "task_reload_scream", id+TASK_RELOAD)
// Scream damage task
set_task(0.1, "task_scream_process", id+TASK_SCREAMDMG, _, _, "b")
}
public task_reload_scream(id)
{
// Normalize taks
id -= TASK_RELOAD
// Can do screams again
g_bCanDoScreams[id] = true
// Message
client_printcolor(id, "/g[Shaman] /yAbility /g^"[Alarm]^"/y | Press /g[R]/y")
}
public task_scream_process(id)
{
// Normalize task
id -= TASK_SCREAMDMG
// Time exceed
if(g_iPlayerTaskTimes[id] >= (g_iCvar_ScreamDuration*10) || g_bRoundEnding)
{
// Remove player task
remove_task(id+TASK_SCREAMDMG)
// Reset task times count
g_iPlayerTaskTimes[id] = 0
return;
}
// Update player task time
g_iPlayerTaskTimes[id]++
// Get player origin
static Float:flOrigin[3]
entity_get_vector(id, EV_VEC_origin, flOrigin)
// Collisions
static iVictim
iVictim = -1
// Vector var
static Float:flVictimOrigin[3]
// A ring effect
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, flOrigin[0]) // x
engfunc(EngFunc_WriteCoord, flOrigin[1]) // y
engfunc(EngFunc_WriteCoord, flOrigin[2]) // z
engfunc(EngFunc_WriteCoord, flOrigin[0]) // x axis
engfunc(EngFunc_WriteCoord, flOrigin[1]) // y axis
engfunc(EngFunc_WriteCoord, flOrigin[2] + g_flCvar_Radius) // z axis
write_short(g_sprRing) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(10) // life
write_byte(25) // width
write_byte(0) // noise
write_byte(zclass_ring_colors[0]) // red
write_byte(zclass_ring_colors[1]) // green
write_byte(zclass_ring_colors[2]) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
// Screen effects for him self
screen_effects(id)
// Do scream effects
while((iVictim = find_ent_in_sphere(iVictim, flOrigin, g_flCvar_Radius)) != 0)
{
// Non-player entity
if(!is_user_valid_connected(iVictim))
{
// Validation check
if(is_valid_ent(iVictim))
{
// Get entity classname
static szClassname[33]
entity_get_string(iVictim, EV_SZ_classname, szClassname, charsmax(szClassname))
// It's a grenade, and isn't an Infection Bomb
if(equal(szClassname, "grenade") && zp_get_grenade_type(iVictim) != NADE_TYPE_INFECTION)
{
// Get grenade origin
entity_get_vector(iVictim, EV_VEC_origin, flVictimOrigin)
// Do a good effect
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flVictimOrigin, 0)
write_byte(TE_PARTICLEBURST) // TE id
engfunc(EngFunc_WriteCoord, flVictimOrigin[0]) // x
engfunc(EngFunc_WriteCoord, flVictimOrigin[1]) // y
engfunc(EngFunc_WriteCoord, flVictimOrigin[2]) // z
write_short(45) // radius
write_byte(108) // particle color
write_byte(10) // duration * 10 will be randomized a bit
message_end()
// Remove it
remove_entity(iVictim)
}
}
continue;
}
// Not alive, zombie or with Godmode
if(!g_bIsAlive[iVictim] || zp_get_user_zombie(iVictim) || get_user_godmode(iVictim))
continue;
// Screen effects for victims
screen_effects(iVictim)
// Get scream mode
switch(g_iCvar_ScreamMode)
{
// Do damage
case 0:
{
// Get human health
static iHealth
iHealth = get_user_health(iVictim)
// It's going to die and can be infected?
if((iHealth - g_iCvar_ScreamDmg) <= 0 && g_iCvar_DamageMode)
{
// Can be infected?
if(zp_infect_user(iVictim, id, 0, 1))
continue
}
// It's going to die
if(iHealth - g_iCvar_ScreamDmg <= 0)
{
// Be infected when it's going to die
if(g_iCvar_DamageMode /* == 1*/)
{
// Returns 1 on sucess...
if(zp_infect_user(iVictim, id, 0, 1))
continue
}
// Kill it
scream_kill(iVictim, id)
continue
}
// Do fake damage
set_user_health(iVictim, iHealth - g_iCvar_ScreamDmg)
// Scream slowdown, first should be enabled
if(g_flCvar_ScreamSlowdown > 0.0)
{
// Get his current velocity vector
static Float:flVelocity[3]
get_user_velocity(iVictim, flVelocity)
// Multiply his velocity by a number
xs_vec_mul_scalar(flVelocity, g_flCvar_ScreamSlowdown, flVelocity)
// Set his new velocity vector
set_user_velocity(iVictim, flVelocity)
}
}
// Instantly Infect
case 1:
{
// Can be infected?
if(!zp_infect_user(iVictim, id, 0, 1))
{
// Kill it
scream_kill(iVictim, id)
}
}
// Instantly Kill
case 2:
{
// Kill it
scream_kill(iVictim, id)
}
}
}
}
public zp_user_infected_post(id, infector)
{
// It's the selected zombie class
if(zp_get_user_zombie_class(id) == g_ishamanZID && !zp_get_user_nemesis(id))
{
// Array
g_bCanDoScreams[id] = true
// Message
client_printcolor(id, "/g[Shaman] /yAbility /g[Alarm]/y | Press /g^"[R]^"/y")
emit_sound(id, CHAN_WEAPON, g_infect_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
public zp_user_humanized_post(id)
{
// Reset player vars and tasks
stop_scream_task(id)
g_bCanDoScreams[id] = false
g_iPlayerTaskTimes[id] = 0
remove_task(id+TASK_RELOAD)
remove_task(id+TASK_SCREAMDMG)
}
public zp_round_ended(winteam)
{
// Update bool
g_bRoundEnding = true
// Make a loop
static id
for(id = 1; id <= g_iMaxPlayers; id++)
{
// Valid connected
if(is_user_valid_connected(id))
{
// Remove mainly tasks
stop_scream_task(id)
remove_task(id+TASK_RELOAD)
}
}
}
stop_scream_task(id)
{
// Remove the task
if(task_exists(id+TASK_SCREAM))
{
remove_task(id+TASK_SCREAM)
// Remove screen's bar
message_begin(MSG_ONE, g_msgBarTime, _, id)
write_byte(0) // time
write_byte(0) // unknown
message_end()
// Update bool
g_bInScreamProcess[id] = false
}
}
screen_effects(id)
{
// Screen Fade
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, id)
write_short(UNIT_SECOND*1) // duration
write_short(UNIT_SECOND*1) // hold time
write_short(FFADE_IN) // fade type
write_byte(200) // r
write_byte(0) // g
write_byte(0) // b
write_byte(125) // alpha
message_end()
// Screen Shake
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenShake, _, id)
write_short(UNIT_SECOND*5) // amplitude
write_short(UNIT_SECOND*1) // duration
write_short(UNIT_SECOND*5) // frequency
message_end()
}
cache_cvars()
{
g_iCvar_ScreamMode = get_pcvar_num(cvar_screammode)
g_iCvar_ScreamDuration = get_pcvar_num(cvar_duration)
g_iCvar_ScreamDmg = get_pcvar_num(cvar_screamdmg)
g_iCvar_ScreamStartTime = get_pcvar_num(cvar_startime)
g_iCvar_DamageMode = get_pcvar_num(cvar_damagemode)
g_flCvar_ReloadTime = floatmax(g_iCvar_ScreamDuration+0.0, get_pcvar_float(cvar_reloadtime))
g_flCvar_Radius = get_pcvar_float(cvar_radius)
g_flCvar_ScreamSlowdown = get_pcvar_float(cvar_slowdown)
}
scream_kill(victim, attacker)
{
// To use later in DeathMsg event
g_bKilledByScream[victim] = true
// Do kill
ExecuteHamB(Ham_Killed, victim, attacker, GIB_NEVER)
// We don't need this
g_bKilledByScream[victim] = false
}
stock client_printcolor(id, const input[], any:...)
{
static iPlayersNum[32], iCount; iCount = 1
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "/g", "^4") // green txt
replace_all(szMsg, 190, "/y", "^1") // orange txt
replace_all(szMsg, 190, "/ctr", "^3") // team txt
replace_all(szMsg, 190, "/w", "^0") // team txt
if(id) iPlayersNum[0] = id
else get_players(iPlayersNum, iCount, "ch")
for (new i = 0; i < iCount; i++)
{
if (g_bIsConnected[iPlayersNum[i]])
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayersNum[i])
write_byte(iPlayersNum[i])
write_string(szMsg)
message_end()
}
}
}
public CPlayer__TakeDamage(id, iVictim, iInflictor, iAttacker, Float:flDamage, bitsDamage)
{
if (zp_get_user_zombie_class(id) == g_ishamanZID && zp_get_user_zombie(id) && !zp_get_user_nemesis(id) && !zp_get_user_survivor(id))
{
new rand = random_num(1,2)
switch(rand)
{
case 1: emit_sound(id, CHAN_WEAPON, pain_shaman_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
case 2: emit_sound(id, CHAN_WEAPON, pain_shaman_sound2[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
}
public Death_Zombie(id)
{
new victim=read_data(2)
if(zp_get_user_zombie(victim) && zp_get_user_zombie_class(victim) == g_ishamanZID && !zp_get_user_nemesis(victim))
{
emit_sound(id, CHAN_WEAPON, death_shaman_sound[0], 1.0, ATTN_NORM, 0, PITCH_LOW)
}
}
public Event_CurrentWeapon(id)
{
new weaponID = read_data(2)
if (weaponID == CSW_SMOKEGRENADE)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_ishamanZID && !zp_get_user_nemesis(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_SHAMAN)
}
if (weaponID == CSW_FLASHBANG)
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_ishamanZID && !zp_get_user_nemesis(id))
{
entity_set_string(id, EV_SZ_viewmodel, KNOCKBOMB_SHAMAN)
}
}
[img]
https://imgur.com/a/FwOHh
[/img]
aceasta este imaginea cu erroarea pe care mi-a dat-o incercand sa deschid sv-ul
0
0
Back to top
darkboss12345
[Mentally Stable]
Status: Offline
(since 08-03-2019 01:16)
Joined: 25 Mar 2018
Posts: 2
,
Topics: 1
Location:
Targoviste
Reputation:
3.1
Posted: 26-03-2018, 14:14:22
| Translate post to:
... (
Click for more languages
)
up?
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 07-05-2024, 23:42:54
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details