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

Freeze


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Usama Ali
Member
Join Date: Apr 2020
Old 04-23-2022 , 14:05   Freeze
Reply With Quote #1

I need a plugin which freezes zombie after infection for specific time (5 SEC), or it just takes zombies to spawn.

IM USING ZP 4.3 Fix5a

Last edited by Usama Ali; 04-24-2022 at 20:53.
Usama Ali is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-24-2022 , 20:56   Re: Freeze
Reply With Quote #2

Alliedmodders have always been help-full, i have been looking for that plugin from days now
Usama Ali is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-25-2022 , 06:26   Re: Freeze
Reply With Quote #3

The more copy/paste threads you post, the less likely it is for you to get an answer.
I personally would have helped you, but now that I see you posted it multiple times, and all of them with incorrect (unhelpful) thread titles, I'm out.
__________________

Last edited by OciXCrom; 04-25-2022 at 06:26.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Usama Ali
Member
Join Date: Apr 2020
Old 04-25-2022 , 15:18   Re: Freeze
Reply With Quote #4

look dude i respect you alot, your experience and everything. but will you elaborate what am i doing wrong?
Usama Ali is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-25-2022 , 15:22   Re: Freeze
Reply With Quote #5

https://forums.alliedmods.net/showpo...43&postcount=2

Replace
Code:
public zp_round_started(gamemode, id)
{
	new players[32], count
	get_players(players, count, "ah")

	for (new i, player; i < count; i++)
	{
		player = players[i]

		if (g_zombie[player])
		{
			freeze_player(player)
		}
	}
}
with

Code:
public zp_user_infected_post(id, infector, nemesis)
{
	if (!nemesis)
	{
		freeze_player(id)
	}
}
__________________









Last edited by CrazY.; 04-25-2022 at 15:26.
CrazY. is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-25-2022 , 16:12   Re: Freeze
Reply With Quote #6

Quote:
Originally Posted by CrazY. View Post
https://forums.alliedmods.net/showpo...43&postcount=2

Replace
Code:
public zp_round_started(gamemode, id)
{
	new players[32], count
	get_players(players, count, "ah")

	for (new i, player; i < count; i++)
	{
		player = players[i]

		if (g_zombie[player])
		{
			freeze_player(player)
		}
	}
}
with

Code:
public zp_user_infected_post(id, infector, nemesis)
{
	if (!nemesis)
	{
		freeze_player(id)
	}
}
Shows Following error during compiling
Code:
error 017: undefined symbol "g_frozen"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
Thanks for the reply
Usama Ali is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-26-2022 , 08:24   Re: Freeze
Reply With Quote #7

I'm able to compile it just fine here.
Where did you paste the code I gave you? You should attach your zombie_plague40.sma
__________________








CrazY. is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-26-2022 , 14:24   Re: Freeze
Reply With Quote #8

Quote:
Originally Posted by CrazY. View Post
I'm able to compile it just fine here.
Where did you paste the code I gave you? You should attach your zombie_plague40.sma
Thank you so much this one works perfect.
Code:
public zp_round_started(gamemode, id)
{
	new players[32], count
	get_players(players, count, "ah")

	for (new i, player; i < count; i++)
	{
		player = players[i]

		if (g_zombie[player])
		{
			freeze_player(player)
		}
	}
}

freeze_player(victim)
{
	if (g_frozen[victim])
	{
		return
	}

	// Freeze icon?
	if (get_pcvar_num(cvar_hudicons))
	{
		message_begin(MSG_ONE_UNRELIABLE, g_msgDamage, _, victim)
		write_byte(0) // damage save
		write_byte(0) // damage take
		write_long(DMG_DROWN) // damage type - DMG_FREEZE
		write_coord(0) // x
		write_coord(0) // y
		write_coord(0) // z
		message_end()
	}
	
	// Light blue glow while frozen
	if (g_handle_models_on_separate_ent)
		fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)
	else
		fm_set_rendering(victim, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)
	
	new sound[64]
	// Freeze sound
	ArrayGetString(grenade_frost_player, random_num(0, ArraySize(grenade_frost_player) - 1), sound, charsmax(sound))
	emit_sound(victim, CHAN_BODY, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
	
	// Add a blue tint to their screen
	message_begin(MSG_ONE, g_msgScreenFade, _, victim)
	write_short(0) // duration
	write_short(0) // hold time
	write_short(FFADE_STAYOUT) // fade type
	write_byte(0) // red
	write_byte(50) // green
	write_byte(200) // blue
	write_byte(100) // alpha
	message_end()
	
	// Set the frozen flag
	g_frozen[victim] = true
	
	// Save player's old gravity (bugfix)
	pev(victim, pev_gravity, g_frozen_gravity[victim])
	
	// Prevent from jumping
	if (pev(victim, pev_flags) & FL_ONGROUND)
		set_pev(victim, pev_gravity, 999999.9) // set really high
	else
		set_pev(victim, pev_gravity, 0.000001) // no gravity
	
	// Prevent from moving
	ExecuteHamB(Ham_Player_ResetMaxSpeed, victim)
	
	// Set a task to remove the freeze
	set_task(5.0, "remove_freeze", victim)
}
But can you add a hud which shows the amount of time zombies will fe freeze.
Usama Ali 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 16:16.


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