Ludzie swieca sie na bialy kolor
Zombie swieca sie na niebieski kolor
Niewidzialne zombie swieci sie na czerwony kolor
SMA Niewidzialnego Zombie
/*
[ZP] Class : Ghost Zombie
( Another Zombie )
by Fry!
Description :
This is another zombie class only this zombie will be invisible like ghost with [b]Fall resist[/b].
Zombie can be noticed by his orange glow, of course You can change glow.
Cvars :
zp_ghost_invisibility "5" - How invisible ghost will be, note that you can only set 0 (max invisible) - 255 ( max visible ) .
zp_ghost_glow_red "150" - This is red color.
zp_ghost_glow_green "150" - This is green color.
zp_ghost_glow_blue "150" - This is blue color.
Credits :
Random1 - For his small tutorial! <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/biggrin.gif' class='bbc_emoticon' alt=':D' /> > http://forums.alliedmods.net/showpost.php?p=766473&postcount=6
Changelog :
10/11/2008 - v1.0 - First test
11/11/2008 - v1.1 - added zombie can't be visible if it will be frozen.
23/12/2008 - v1.2.2 - added 2 more cvars for red and green color, changed zombie stats was so weak, now ghost zombie will be fall restist.
24/02/2009 - v1.2.9 - removed none working function if you were frozen, added silent footsteps, added cvar for invisibility, corrected some spelling mistakes, fixed if this zombie class was Nemesis, fixed invisibility, optimized code.
25/02/2009 - v1.3.1 - removed useless call functions (connected, disconnected, died), optimized code by adding AddToFullPack since I've never called public ghost zombie.
*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <hlsdk_const>
#include <zombieplague>
#define PLUGIN "[ZP] Class : Ghost Zombie"
#define VERSION "1.3.2"
#define AUTHOR "Fry!"
new g_zclass_ghost, g_glow_red, g_glow_green, g_glow_blue, g_invisible_amount
new const zclass_name[] = { "Niewidzialne Zombie" }
new const zclass_info[] = { "Niewidzialnosc" }
new const zclass_model[] = { "niewidzialne" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 2000
const zclass_speed = 260
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.35
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_zclass_ghost_zombie",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_invisible_amount = register_cvar("zp_ghost_invisibility", "5")
g_glow_red = register_cvar("zp_ghost_glow_red", "150")
g_glow_green = register_cvar("zp_ghost_glow_green", "150")
g_glow_blue = register_cvar("zp_ghost_glow_blue", "150")
register_forward(FM_AddToFullPack,"fw_addtofullpack",1)
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
}
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)
}
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 fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet)
{
if(!is_user_alive(ent) || !is_user_alive(host))
return FMRES_IGNORED
if(zp_get_user_zombie(ent) && !zp_get_user_nemesis(ent) && zp_get_user_zombie_class(ent) == g_zclass_ghost)
{
static color[3];
color[0] = get_pcvar_num(g_glow_red);
color[1] = get_pcvar_num(g_glow_green);
color[2] = get_pcvar_num(g_glow_blue);
set_es(es_handle, ES_RenderMode, kRenderTransAlpha)
set_es(es_handle, ES_RenderAmt, get_pcvar_num(g_invisible_amount))
set_es(es_handle, ES_RenderFx, kRenderFxGlowShell)
set_es(es_handle, ES_RenderColor, color)
}
return FMRES_IGNORED
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Victim is not taking damage from a fall
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
}
SMA Predator Google
#include <amxmodx>
#include <engine>
#include <xs>
#include <zombieplague>
#include <fakemeta>
new const g_item_name[] = { "Predator Google" };
const g_item_cost = 10;
new const g_sound_buygoggles[] = { "items/nvg_on.wav" }
new Float:g_fDelay[33]
new g_itemid_goggles;
new g_ThermalOn[33]
new sprite_playerheat
new cvar_maxdistance
new cvar_updatedelay
static const PLUGIN_NAME[] = "Thermal Goggles"
static const PLUGIN_AUTHOR[] = "ROADRAGE"
static const PLUGIN_VERSION[] = "1.0"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_cvar(PLUGIN_NAME, PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER)
g_itemid_goggles = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN);
cvar_maxdistance = register_cvar("amx_tig_distance", "700")
cvar_updatedelay = register_cvar("amx_tig_updatedelay", "0.2")
register_event("HLTV", "EVENT_round_start", "a", "1=0", "2=0")
register_forward(FM_PlayerPreThink,"FW_PlayerPreThink");
}
public plugin_precache()
{
sprite_playerheat = precache_model("sprites/poison.spr")
precache_sound(g_sound_buygoggles)
}
public FW_PlayerPreThink(id) // THANKS TO CHEAPSUIT FOR THERMAL CODE
{
if(!is_user_alive(id) ||zp_get_user_zombie(id)||!g_ThermalOn[id])
return PLUGIN_CONTINUE
if((g_fDelay[id] + get_pcvar_float(cvar_updatedelay)) > get_gametime())
return PLUGIN_CONTINUE
g_fDelay[id] = get_gametime()
new Float:fMyOrigin[3]
entity_get_vector(id, EV_VEC_origin, fMyOrigin)
static Players[32], iNum
get_players(Players, iNum, "a")
for(new i = 0; i < iNum; ++i) if(id != Players[i])
{
new target = Players[i]
new Float:fTargetOrigin[3]
entity_get_vector(target, EV_VEC_origin, fTargetOrigin)
if((get_distance_f(fMyOrigin, fTargetOrigin) > get_pcvar_num(cvar_maxdistance))
|| !is_in_viewcone(id, fTargetOrigin))
continue
new Float:fMiddle[3], Float:fHitPoint[3]
xs_vec_sub(fTargetOrigin, fMyOrigin, fMiddle)
trace_line(-1, fMyOrigin, fTargetOrigin, fHitPoint)
new Float:fWallOffset[3], Float:fDistanceToWall
fDistanceToWall = vector_distance(fMyOrigin, fHitPoint) - 10.0
normalize(fMiddle, fWallOffset, fDistanceToWall)
new Float:fSpriteOffset[3]
xs_vec_add(fWallOffset, fMyOrigin, fSpriteOffset)
new Float:fScale, Float:fDistanceToTarget = vector_distance(fMyOrigin, fTargetOrigin)
if(fDistanceToWall > 100.0)
fScale = 8.0 * (fDistanceToWall / fDistanceToTarget)
else
fScale = 2.0
te_sprite(id, fSpriteOffset, sprite_playerheat, floatround(fScale), 125)
}
return PLUGIN_CONTINUE
}
stock te_sprite(id, Float:origin[3], sprite, scale, brightness)
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_short(sprite)
write_byte(scale)
write_byte(brightness)
message_end()
}
stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul)
{
new Float:fLen = xs_vec_len(fIn)
xs_vec_copy(fIn, fOut)
fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}
public zp_extra_item_selected(player, itemid)
{
if ( g_ThermalOn[player] )
{
client_print(player, print_chat, "[ZP] You already bought this.")
return PLUGIN_HANDLED
}
if (itemid == g_itemid_goggles)
{
FW_PlayerPreThink(player)
g_ThermalOn[player] = true
engfunc(EngFunc_EmitSound, player, CHAN_BODY, g_sound_buygoggles, 1.0, ATTN_NORM, 0, PITCH_NORM)
client_print(player, print_chat, "[ZP] You've bought thermal goggles")
}
return PLUGIN_CONTINUE
}
// Reset goggles for all players on newround
public EVENT_round_start()
{
for (new id; id <= 32; id++) g_ThermalOn[id] = false;
}


Dodatki SourceMod



Temat jest zamknięty










