Raised This Month: $51 Target: $400
 12% 

Subplugin Submission [ZP] Class : Thermal Zombie


Post New Thread Reply   
 
Thread Tools Display Modes
CHyCMyMpNk
Senior Member
Join Date: Jun 2008
Location: PTZ
Old 11-08-2008 , 13:48   Re: [ZP] Class : Thermal Zombie
Reply With Quote #11

Quote:
Originally Posted by ifx View Post
BUG:
hey, why zombies highlights too?
I did not have such ...
CHyCMyMpNk is offline
Send a message via ICQ to CHyCMyMpNk
shadowski
Senior Member
Join Date: Feb 2007
Old 11-08-2008 , 15:47   Re: [ZP] Class : Thermal Zombie
Reply With Quote #12

in my server zombie highlights too
shadowski is offline
Old 11-09-2008, 15:44
CHyCMyMpNk
This message has been deleted by CHyCMyMpNk.
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 11-10-2008 , 02:25   Re: [ZP] Class : Thermal Zombie
Reply With Quote #13

all .amxx files need to be okayed with an administrator as to the rules. It may seem burdensome but its a rule.

-Good job by the way
__________________
bmann_420 is offline
seerax
Member
Join Date: Apr 2009
Old 07-12-2009 , 11:23   Re: [ZP] Class : Thermal Zombie
Reply With Quote #14

cay you fix this plugin:
thermal zombie can see only people
?
__________________
seerax is offline
HoRRoR [CSM]
Member
Join Date: May 2009
Old 07-12-2009 , 11:49   Re: [ZP] Class : Thermal Zombie
Reply With Quote #15

may be work. I'm not tested this.
Code:
#include <amxmodx>
#include <engine>
#include <xs>
#include <zombieplague>

new Float:g_fDelay[33]
new g_ThermalOn[33]
new sprite_playerheat

new cvar_enable
new cvar_maxdistance
new cvar_updatedelay

new g_zclass_thermal

// Thermal Zombie Atributes
new const zclass_name[] = { "Thermal" } // name
new const zclass_info[] = { "Looks through walls" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 1800 // health
const zclass_speed = 240 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.5 // knockback

static const PLUGIN_NAME[] 	= "Thermal Zombie"
static const PLUGIN_AUTHOR[] 	= "Cheap_Suit"
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)
	
	cvar_enable	 = register_cvar("amx_tig_enable", 	"1")
	cvar_maxdistance = register_cvar("amx_tig_distance", 	"600")
	cvar_updatedelay = register_cvar("amx_tig_updatedelay", "0.2")
	
	register_event("NVGToggle", "Event_NVGToggle", "be")
}

public plugin_precache()
{
	sprite_playerheat = precache_model("sprites/poison.spr")
	g_zclass_thermal = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public Event_NVGToggle(id)
	g_ThermalOn[id] = read_data(1)

public client_PostThink(id)
{
	if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
	if(zp_get_user_zombie_class(id) != g_zclass_thermal) 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] && !(zp_get_user_zombie(i) || zp_get_user_nemesis(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
}
HoRRoR [CSM] is offline
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 09-12-2009 , 06:48   Re: [ZP] Class : Thermal Zombie
Reply With Quote #16

Quote:
Originally Posted by HoRRoR [CSM] View Post
may be work. I'm not tested this.
Code:
#include <amxmodx>
#include <engine>
#include <xs>
#include <zombieplague>

new Float:g_fDelay[33]
new g_ThermalOn[33]
new sprite_playerheat

new cvar_enable
new cvar_maxdistance
new cvar_updatedelay

new g_zclass_thermal

// Thermal Zombie Atributes
new const zclass_name[] = { "Thermal" } // name
new const zclass_info[] = { "Looks through walls" } // description
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" } // claw model
const zclass_health = 1800 // health
const zclass_speed = 240 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.5 // knockback

static const PLUGIN_NAME[] 	= "Thermal Zombie"
static const PLUGIN_AUTHOR[] 	= "Cheap_Suit"
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)
	
	cvar_enable	 = register_cvar("amx_tig_enable", 	"1")
	cvar_maxdistance = register_cvar("amx_tig_distance", 	"600")
	cvar_updatedelay = register_cvar("amx_tig_updatedelay", "0.2")
	
	register_event("NVGToggle", "Event_NVGToggle", "be")
}

public plugin_precache()
{
	sprite_playerheat = precache_model("sprites/poison.spr")
	g_zclass_thermal = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}

public Event_NVGToggle(id)
	g_ThermalOn[id] = read_data(1)

public client_PostThink(id)
{
	if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
	if(zp_get_user_zombie_class(id) != g_zclass_thermal) 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] && !(zp_get_user_zombie(i) || zp_get_user_nemesis(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
}
Tryed by myself, ant used you code. Both worked, but it was buggy, sometime humans were shown, sometimes not. Ant sometimes shown zombies. Strange. MAybe problems with indexing players, then whey become zombies from humans.
aaarnas is offline
KingBling
Junior Member
Join Date: Mar 2010
Old 03-15-2010 , 09:15   Re: [ZP] Class : Thermal Zombie
Reply With Quote #17

How and where do i put thing so thermal zombie works?
KingBling is offline
killer2100
Member
Join Date: Apr 2010
Location: Ireland (Not Irish)
Old 07-14-2010 , 11:14   Re: [ZP] Class : Thermal Zombie
Reply With Quote #18

Quote:
Originally Posted by ifx View Post
haha, very sexy, will test it

thanks!
wtf
__________________
Im New To Cs Zombie Mode, Making My Own Server, Always Accept Help
killer2100 is offline
Send a message via Skype™ to killer2100
c3ko
Member
Join Date: Jul 2010
Old 08-03-2010 , 09:47   Re: [ZP] Class : Thermal Zombie
Reply With Quote #19

Can you guys make the thermal zombie to see with red color not blue ?
If you not understant what im talking about , say and i will put pictures.
c3ko is offline
zhulo
Senior Member
Join Date: Jun 2010
Location: Slovakia
Old 12-16-2010 , 10:05   Re: [ZP] Class : Thermal Zombie
Reply With Quote #20

All corrected here. Now you can only see the humans traces.

PHP Code:
#include <amxmodx>
#include <engine>
#include <xs>
#include <zombieplague>

new Float:g_fDelay[33]
new 
g_ThermalOn[33]
new 
sprite_playerheat

new cvar_enable
new cvar_maxdistance
new cvar_updatedelay

new g_zclass_thermal

// Thermal Zombie Atributes
new const zclass_name[] = { "Thermal" // name
new const zclass_info[] = { "Looks through walls" // description
new const zclass_model[] = { "zombie_source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model
const zclass_health 1800 // health
const zclass_speed 240 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.5 // knockback

static const PLUGIN_NAME[]     = "Thermal Zombie"
static const PLUGIN_AUTHOR[]     = "Cheap_Suit"
static const PLUGIN_VERSION[]    = "1.0"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER)
    
    
cvar_enable     register_cvar("amx_tig_enable",     "1")
    
cvar_maxdistance register_cvar("amx_tig_distance",     "600")
    
cvar_updatedelay register_cvar("amx_tig_updatedelay""0.2")
    
    
register_event("NVGToggle""Event_NVGToggle""be")
}

public 
plugin_precache()
{
    
sprite_playerheat precache_model("sprites/poison.spr")
    
g_zclass_thermal zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)
}

public 
Event_NVGToggle(id)
    
g_ThermalOn[id] = read_data(1)

public 
client_PostThink(id)
{
    if(!
is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
    
if(zp_get_user_zombie_class(id) != g_zclass_thermal) 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(idEV_VEC_originfMyOrigin)
    
    static 
Players[32], iNum
    get_players
(PlayersiNum"a")
    for(new 
0iNum; ++i) if(id != Players[i])
    {
        new 
target Players[i]
        
        if (!
zp_get_user_zombie(target))
        {
        new 
Float:fTargetOrigin[3]
        
entity_get_vector(targetEV_VEC_originfTargetOrigin)
        
        if((
get_distance_f(fMyOriginfTargetOrigin) > get_pcvar_num(cvar_maxdistance)) 
        || !
is_in_viewcone(idfTargetOrigin))
            continue

        new 
Float:fMiddle[3], Float:fHitPoint[3]
        
xs_vec_sub(fTargetOriginfMyOriginfMiddle)
        
trace_line(-1fMyOriginfTargetOriginfHitPoint)
                                
        new 
Float:fWallOffset[3], Float:fDistanceToWall
        fDistanceToWall 
vector_distance(fMyOriginfHitPoint) - 10.0
        normalize
(fMiddlefWallOffsetfDistanceToWall)
        
        new 
Float:fSpriteOffset[3]
        
xs_vec_add(fWallOffsetfMyOriginfSpriteOffset)
        new 
Float:fScaleFloat:fDistanceToTarget vector_distance(fMyOriginfTargetOrigin)
        if(
fDistanceToWall 100.0)
            
fScale 8.0 * (fDistanceToWall fDistanceToTarget)
        else
            
fScale 2.0
    
        te_sprite
(idfSpriteOffsetsprite_playerheatfloatround(fScale), 125)
        }
    }
    return 
PLUGIN_CONTINUE
}

stock te_sprite(idFloat:origin[3], spritescalebrightness)
{
    
message_begin(MSG_ONESVC_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(fInfOut)
    
    
fOut[0] /= fLenfOut[1] /= fLenfOut[2] /= fLen
    fOut
[0] *= fMulfOut[1] *= fMulfOut[2] *= fMul

zhulo is offline
Send a message via ICQ to zhulo Send a message via Skype™ to zhulo
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 06:47.


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