Nemesis mod question & problem

General Discussion
Post Reply
empLea
Member
Member
Posts: 4
Joined: 2 Months Ago
Has thanked: 0
Been thanked: 0
Contact:

Nemesis mod question & problem

#1

Post by empLea » 1 Month Ago

I tested the latest version of Zombie escape 1.6.I'd say it's much better than other modes, but there's a problem.I want to use Nemesis mod, and unfortunately none of the plugins that pass as nemesis mod on the forum are what I want.The problem is that nemesis is chosen, but instead of killing nemesis, as in the classic zombie infection, it makes it a virus.Can someone tell me how to fix it, or can nemesis mode be used in this mode? Likewise, the nemesis leap doesn't work. :/

User avatar
Night Fury
Mod Developer
Mod Developer
Egypt
Posts: 677
Joined: 4 Years Ago
Location: Egypt
Has thanked: 39 times
Been thanked: 56 times
Age: 21
Contact:

#2

Post by Night Fury » 1 Month Ago

What code do you use?
There has been several nemesis codes on the forum here
Want your own mod edition? PM me.
Accepting private projects.
ImageImage

empLea
Member
Member
Posts: 4
Joined: 2 Months Ago
Has thanked: 0
Been thanked: 0
Contact:

#3

Post by empLea » 1 Month Ago

I tried both plugins.But nemesis was spreading as an infection, and it haven't a leap. :/

viewtopic.php?f=15&t=3877 -- viewtopic.php?f=21&t=3642

User avatar
Night Fury
Mod Developer
Mod Developer
Egypt
Posts: 677
Joined: 4 Years Ago
Location: Egypt
Has thanked: 39 times
Been thanked: 56 times
Age: 21
Contact:

#4

Post by Night Fury » 1 Month Ago

Try this code:

Code: Select all

/*
	If you need help visit : www.escapers-zone.net
	Compatible with: 1.6 Only 

	# Chane Logs: 
	- v1.0
		- Release
	- v1.1
		- Fix bugs
		- Use API ZE v1.6 
		- Added 2 cvars block freeze and burning !
*/

#include <zombie_escape>

// Defines 
#define MODEL_MAX_LENGTH 	64

// Enum 
enum _:TOTAL_COLORS { RED = 0, GREEN, BLUE }
enum _:TOTAL_NADES { FROST = 0, FIRE }

// File Setting 
new const ZE_SETTING_RESOURCE[] = "zombie_escape.ini"

// Default Models 
new const szNemesisModel[][MODEL_MAX_LENGTH] = { "ze_nemesis" }
new const szNemesisKnife[][MODEL_MAX_LENGTH] = { "models/zombie_escape/v_knife_nemesis.mdl" }

// Variablies
new g_bIsNemesis[MAX_PLAYERS + 1]
new g_pCvarHealth, g_pCvarSpeed, g_pCvarGravity, g_pCvarGlow, g_pCvarGlowColor[TOTAL_COLORS], g_pCvarKnockBack, g_pCvarDamage, g_pCvarNades[TOTAL_NADES]
new Array:g_szNemesisModel, Array:g_szNemesisKnife

public plugin_init()
{
	// Load plugin 
	register_plugin("[ZE] Class: Nemesis", "1.1", AUTHORS)

	// Cvars 
	g_pCvarHealth = register_cvar("ze_nemesis_health", "20000")
	g_pCvarSpeed = register_cvar("ze_nemesis_speed", "310")
	g_pCvarGravity = register_cvar("ze_nemesis_gravity", "500")
	g_pCvarGlow = register_cvar("ze_nemesis_glow", "1")
	g_pCvarGlowColor[RED] = register_cvar("ze_nemesis_glow_r", "255")
	g_pCvarGlowColor[GREEN] = register_cvar("ze_nemesis_glow_g", "0")
	g_pCvarGlowColor[BLUE] = register_cvar("ze_nemesis_glow_b", "0")
	g_pCvarNades[FROST] = register_cvar("ze_nemesis_freeze", "1")
	g_pCvarNades[FIRE] = register_cvar("ze_nemesis_fire", "1")
	g_pCvarKnockBack = register_cvar("ze_nemesis_knockback", "250")
	g_pCvarDamage = register_cvar("ze_nemesis_damage", "4")
}

public plugin_precache()
{
	// Initialise Arrays 
	g_szNemesisModel = ArrayCreate(MODEL_MAX_LENGTH, 1)
	g_szNemesisKnife = ArrayCreate(MODEL_MAX_LENGTH, 1)

	// Load from external file 
	amx_load_setting_string_arr(ZE_SETTING_RESOURCE, "Player Models", "NEMESIS", g_szNemesisModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCE, "Weapon Models", "V_KNIFE NEMESIS", g_szNemesisKnife)

	new i
	if (ArraySize(g_szNemesisModel) == 0)
	{
		for (i = 0; i < sizeof(szNemesisModel); i++)
			ArrayPushString(g_szNemesisModel, szNemesisModel[i])

		// Save from external file 
		amx_save_setting_string_arr(ZE_SETTING_RESOURCE, "Player Models", "NEMESIS", g_szNemesisModel)
	}

	if (ArraySize(g_szNemesisKnife) == 0)
	{
		for (i = 0; i < sizeof(szNemesisKnife); i++)
			ArrayPushString(g_szNemesisKnife, szNemesisKnife[i])

		// Save from external file 
		amx_save_setting_string_arr(ZE_SETTING_RESOURCE, "Weapon Models", "V_KNIFE NEMESIS", g_szNemesisKnife)
	}

	// Precache Models 
	new szPlayerModel[MODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH], szPathModel[MODEL_MAX_LENGTH * 2]
	for (i = 0; i < ArraySize(g_szNemesisModel); i++)
	{
		ArrayGetString(g_szNemesisModel, i, szPlayerModel, charsmax(szPlayerModel))
		formatex(szPathModel, charsmax(szPathModel), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
		precache_model(szPathModel)
	}

	for (i = 0; i < ArraySize(g_szNemesisKnife); i++)
	{
		ArrayGetString(g_szNemesisKnife, i, szModel, charsmax(szModel))
		precache_model(szModel)
	}
}

public plugin_natives()
{
	register_native("ze_set_user_nemesis", "native_ze_set_user_nemesis", 1)
	register_native("ze_is_user_nemesis", "native_ze_is_user_nemesis", 1)
}

public ze_frost_pre(iIndex)
{
	// Check from player is a nemesis 
	if (g_bIsNemesis[iIndex] && get_pcvar_num(g_pCvarNades[FROST]))
		return ZE_STOP
	return ZE_CONTINUE
}

public ze_fire_pre(iIndex)
{
	// Check from player is a nemesis 
	if (g_bIsNemesis[iIndex] && get_pcvar_num(g_pCvarNades[FIRE]))
		return ZE_STOP
	return ZE_CONTINUE
}

public ze_user_infected_pre(iVictim, iInfector, iDamage)
{
	if (iInfector != 0)
	{
		if (g_bIsNemesis[iInfector])
		{
			iDamage *= get_pcvar_num(g_pCvarDamage)

			// Damage human 
			new iHealth = rg_get_user_health(iVictim)

			if (iHealth > 0)
			{
				// Damage human 
				if ((iHealth - iDamage) > 0)
				{
					rg_set_user_health(iVictim, iHealth - iDamage)
				}
				else 
				{
					// Kill human 
					ExecuteHam(Ham_Killed, iVictim, iInfector, false)
				}
			}

			// Block infection.
			return ZE_STOP
		}
	}

	return ZE_CONTINUE
}

public Set_User_Nemesis(iIndex)
{
	// Set player nemesis 
	if (!g_bIsNemesis[iIndex])
		g_bIsNemesis[iIndex] = true 

	// Set player zombie if not 
	if (!ze_is_user_zombie(iIndex))
		ze_set_user_zombie(iIndex)

	// Set nemesis attributes
	rg_set_user_health(iIndex, get_pcvar_num(g_pCvarHealth))
	ze_set_zombie_speed(iIndex, get_pcvar_num(g_pCvarSpeed)) 
	ze_set_user_gravity(iIndex, get_pcvar_num(g_pCvarGravity))
	if (get_pcvar_num(g_pCvarGlow) != 0)
		Set_Rendering(iIndex, kRenderFxGlowShell, get_pcvar_num(g_pCvarGlowColor[RED]), get_pcvar_num(g_pCvarGlowColor[GREEN]), get_pcvar_num(g_pCvarGlowColor[BLUE]), kRenderNormal, 16)
	ze_set_user_knockback(iIndex, get_pcvar_float(g_pCvarKnockBack))

	// Set nemesis model (i use set_task because ze_resource is problem)
	set_task(1.0, "Set_Nemesis_Model", iIndex)
}

public Set_Nemesis_Model(iIndex)
{
	new szPlayerModel[MODEL_MAX_LENGTH]
	ArrayGetString(g_szNemesisModel, random_num(0, ArraySize(g_szNemesisModel) - 1), szPlayerModel, charsmax(szPlayerModel))
	rg_set_user_model(iIndex, szPlayerModel)	// Set nemesis model 

	new szModel[MODEL_MAX_LENGTH]
	ArrayGetString(g_szNemesisKnife, random_num(0, ArraySize(g_szNemesisKnife) - 1), szModel, charsmax(szModel))
	cs_set_player_view_model(iIndex, CSW_KNIFE, szModel)	// Set nemesis v_ knife 
	cs_set_player_weap_model(iIndex, CSW_KNIFE, "")			// Set nemesis p_ knife 
}

public Remove_User_Nemesis(iIndex)
{
	// Remove player nemesis 
	if (g_bIsNemesis[iIndex])
		g_bIsNemesis[iIndex] = false 

	// Remove nemesis attributes 
	ze_reset_zombie_speed(iIndex)
	ze_reset_user_knockback(iIndex)
	ze_reset_user_gravity(iIndex)
	Set_Rendering(iIndex)
}

// Functions Natives
public native_ze_set_user_nemesis(iIndex, bool:bSet)
{
	// Player is not a connected 
	if (!is_user_connected(iIndex))
	{
		log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", iIndex)
		return false 
	}

	if ( bSet )
	{
		if (!g_bIsNemesis[iIndex]) 
			Set_User_Nemesis(iIndex)
	}
	else 
	{
		if (g_bIsNemesis[iIndex]) 
			Remove_User_Nemesis(iIndex)
	}

	return true 
}

public native_ze_is_user_nemesis(iIndex)
{
	// Player is not a connected 
	if (!is_user_connected(iIndex))
	{
		log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", iIndex)
		return -1 
	}

	return g_bIsNemesis[iIndex] = true 
}

/// Stocks ///
stock rg_set_user_health(const index, amout)
{
	set_entvar(index, var_health, float(amout))
}

stock rg_get_user_health(const index)
{
	return floatround(get_entvar(index, var_health))
}
This leap code was separated but I forget where it was
But try the one in this: viewtopic.php?f=21&t=3642
Otherwise, post the code you're using
Want your own mod edition? PM me.
Accepting private projects.
ImageImage

empLea
Member
Member
Posts: 4
Joined: 2 Months Ago
Has thanked: 0
Been thanked: 0
Contact:

#5

Post by empLea » 1 Month Ago

Thank u, solved! <3

ngamerz
Member
Member
Philippines
Posts: 37
Joined: 8 Months Ago
Location: Philippines From South Korea
Has thanked: 1 time
Been thanked: 5 times
Contact:

#6

Post by ngamerz » 1 Month Ago

empLea wrote:
1 Month Ago
I tried both plugins.But nemesis was spreading as an infection, and it haven't a leap. :/

viewtopic.php?f=15&t=3877 -- viewtopic.php?f=21&t=3642
Actually you can make one via zp50 natives, you can port it. ZP50 API and ZE API are pretty much same.
My Steam:
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest