Raised This Month: $32 Target: $400
 8% 

How to freeze zombies ZP? (Help)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 04-20-2022 , 15:54   How to freeze zombies ZP? (Help)
Reply With Quote #1

Hello, how can I make it so that always at the beginning of the match, when the zombies are randomly selected, they can be frozen so that humans have a chance to escape?
MeliMeli is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 04-22-2022 , 09:02   Re: How to freeze zombies ZP? (Help)
Reply With Quote #2

Paste this somewhere in the main zombie plague plugin.

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)
}
__________________








CrazY. is offline
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 04-22-2022 , 20:40   Re: How to freeze zombies ZP? (Help)
Reply With Quote #3

Obrigado, sua ajuda é muito importante e eu aprecio de verdade isso. E pelo que vejo é BR também, obrigado pela ajuda!
MeliMeli is offline
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 04-24-2022 , 20:33   Re: How to freeze zombies ZP? (Help)
Reply With Quote #4

Pode fazer um para 5.0?
MeliMeli is offline
apkmodme
New Member
Join Date: Jun 2022
Old 06-13-2022 , 04:42   Re: How to freeze zombies ZP? (Help)
Reply With Quote #5

hi
apkmodme 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 19:28.


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