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

ZP 5.0 Nemesis Round FreezeTime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hn.S Xmix
Member
Join Date: May 2021
Old 01-25-2023 , 06:53   ZP 5.0 Nemesis Round FreezeTime
Reply With Quote #1

Hello!

I have request if anyone wants to help or provide me a favor.

1) so basically i still learn how codes works as you can see i tried to make nemesis freeze for 10 second before he attack, but the problem is humans can shoot him while he still frozen and this is can effect him and lose so much hp.
2) Also before gamemode start.. at countdown, player can be nemesis in anywhere, like in water or ladders or even hide places.

Request : i wanna make nemesis can't take any damage/shoots while he's still frozen and teleport in spawn places when user get nemesis

is this possible?



HTML Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <dhudmessage>
#include <zp50_class_nemesis>
#include <zombieplague>

new float: g_fPlayer[33]
new g_fTime


public plugin_init() 
{ 
	register_plugin("Freeze First Nemesis", "1.0", "Hn.S") 
	g_fTime = register_cvar("zp_nemesis_freezetime", "10.0")
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 1)
} 
// Freeze Nemesis
public zp_fw_core_infect_post(id) 
{     
	if(is_user_alive(id) && zp_get_user_nemesis(id))
	{
		g_fPlayer[id] = get_user_maxspeed(id)
		set_user_maxspeed(id, 1.0)
		set_task(get_pcvar_float(g_fTime), "UnFreeze", id) 
	}    
}      
// Unfreeze user
public UnFreeze(id) 
{
	set_user_maxspeed(id, g_fPlayer[id])
	set_dhudmessage(255, 0, 0, -1.0, 0.4)
	show_dhudmessage(0, "The Nemesis is released!^nRun for your lives!")
} 
Attached Files
File Type: sma Get Plugin or Get Source (zp50_addons_freeze_nemesis.sma - 76 views - 926 Bytes)

Last edited by Hn.S Xmix; 01-25-2023 at 08:11. Reason: Misspellings
Hn.S Xmix is offline
ShaunCraft
Junior Member
Join Date: Sep 2021
Location: Alger, Algeria
Old 01-27-2023 , 12:08   Re: ZP 5.0 Nemesis Round FreezeTime
Reply With Quote #2

Good Starting Bro Just Do This

First Don't Start Floated Variable Like This

Quote:
new float:g_Variable (example)
Always if u want to start a floated variable use this

Quote:
new Float:g_Variable
Try it And Tell me

Quote:
#include <amxmodx>
#include <hamsandwich>
#include <cs_maxspeed_api>
#include <zp50_class_nemesis>
#include <zp50_colorchat>

#define PLAYER_CLASSNAME "player"

new g_fTime, g_fIsFreezed

public plugin_init()
{
register_plugin("Freeze First Nemesis", "1.0", "Hn.S")
g_fTime = register_cvar("zp_nemesis_freezetime", "10.0")
RegisterHam(Ham_TakeDamage, PLAYER_CLASSNAME, "Ham_PlayerTakeDamage_Post")
RegisterHam(Ham_TraceAttack, PLAYER_CLASSNAME, "Ham_PlayerTraceAttack_Post")
}
// Freeze Nemesis
public zp_fw_core_infect_post(id)
{
if(is_user_alive(id) && zp_class_nemesis_get(id))
{
g_fIsFreezed = true
cs_set_player_maxspeed(id, 1.0)
set_task(get_pcvar_float(g_fTime), "UnFreeze", id)
}
}

public Ham_PlayerTakeDamage_Post(victim, inflictor, attacker, Float:damage, damage_type)
{
if(g_fIsFreezed)
{
return HAM_SUPERCEDE;
}

return PLUGIN_CONTINUE;
}

public Ham_PlayerTraceAttack_Post(victim, attacker)
{
if(g_fIsFreezed)
{
return HAM_SUPERCEDE;
}

return PLUGIN_CONTINUE;
}

// Unfreeze user
public UnFreeze(id)
{
g_fIsFreezed = false
cs_reset_player_maxspeed(id)
zp_colored_print(0, "The Nemesis is released!^nRun for your lives!")
}

Last edited by ShaunCraft; 01-27-2023 at 12:09.
ShaunCraft is offline
Hn.S Xmix
Member
Join Date: May 2021
Old 01-28-2023 , 10:17   Re: ZP 5.0 Nemesis Round FreezeTime
Reply With Quote #3

I didn't know that. this will be really useful in my others plugins thank you so much for tips this one really help me

Last edited by Hn.S Xmix; 01-28-2023 at 10:18.
Hn.S Xmix is offline
Reply


Thread Tools
Display Modes

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 18:38.


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