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

DHUD ZP 5.0 info


Post New Thread Reply   
 
Thread Tools Display Modes
Zeky
Junior Member
Join Date: Jul 2019
Old 11-09-2019 , 14:42   Re: DHUD ZP 5.0 info
Reply With Quote #11

Quote:
Originally Posted by Noam View Post
Code:
/*================================================================================

----------------------------
-*- [ZP] HUD Information -*-
----------------------------

This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.

================================================================================*/

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <zp50_class_human>
#include <zp50_class_zombie>
#include <zp50_class_nemesis>
#include <zp50_class_dragon>
#include <zp50_class_nightcrawler>
#include <zp50_class_assassin>
#include <zp50_class_survivor>
#include <zp50_class_sniper>
#include <zp50_class_plasma>
#include <zp50_class_knifer>
#include <zp50_ammopacks>
#include <zp50_gamemodes>
#include <engine>
#include <dhudmessage>

const HUD_STATS_ZOMBIE_R = 200
const HUD_STATS_ZOMBIE_G = 250
const HUD_STATS_ZOMBIE_B = 0

const HUD_STATS_HUMAN_R = 0
const HUD_STATS_HUMAN_G = 200
const HUD_STATS_HUMAN_B = 250

const HUD_STATS_SPEC_R = 255
const HUD_STATS_SPEC_G = 255
const HUD_STATS_SPEC_B = 255

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
	
const PEV_SPEC_TARGET = pev_iuser2

public plugin_init()
{
	register_plugin("[ZP] Hud Information", ZP_VERSION_STRING, "ZP Dev Team")
}

public client_putinserver(id)
{
	if (!is_user_bot(id))
	{
		// Set the custom HUD display task
		set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
	}
}
// Show HUD Task
public ShowHUD(taskid)
{
	new player = ID_SHOWHUD
	
	// Player dead?
	if (!is_user_alive(player))
	{
		// Get spectating target
		player = pev(player, PEV_SPEC_TARGET)
		
		// Target not alive
		if (!is_user_alive(player))
			return;
	}
	
	// Format classname
	static class_name[32], transkey[64]
	new red, green, blue
	
	if (zp_core_is_zombie(player)) // zombies
	{
		red = HUD_STATS_ZOMBIE_R
		green = HUD_STATS_ZOMBIE_G
		blue = HUD_STATS_ZOMBIE_B
		
		// Nemesis Class loaded?
		if (zp_class_nemesis_get(player))
			formatex(class_name, charsmax(class_name), "Nemesis")
			
		// Assassin Class loaded?
		else if (zp_class_assassin_get(player))
			formatex(class_name, charsmax(class_name), "Assassin")
			
		else if (zp_class_dragon_get(player))
			formatex(class_name, charsmax(class_name), "Dragon")	
			
		else if (zp_class_nightcrawler_get(player))
			formatex(class_name, charsmax(class_name), "NightCrawler")
		else
		{
			zp_class_zombie_get_name(zp_class_zombie_get_current(player), class_name, charsmax(class_name))
			
			// ML support for class name
			formatex(transkey, charsmax(transkey), "ZOMBIENAME %s", class_name)
			if (GetLangTransKey(transkey) != TransKey_Bad) formatex(class_name, charsmax(class_name), "%L", ID_SHOWHUD, transkey)
		}
	}
	else // humans
	{
		red = HUD_STATS_HUMAN_R
		green = HUD_STATS_HUMAN_G
		blue = HUD_STATS_HUMAN_B
		
		// Survivor Class loaded?
		if (zp_class_survivor_get(player))
			formatex(class_name, charsmax(class_name), "Survivor")

		// Sniper Class loaded?
		else if (zp_class_sniper_get(player))
			formatex(class_name, charsmax(class_name), "Sniper")
			
		else if (zp_class_knifer_get(player))
			formatex(class_name, charsmax(class_name), "Knifer")
      
      		else if (zp_class_plasma_get(player))
			formatex(class_name, charsmax(class_name), "Plasma")
		
		else
		{
			zp_class_human_get_name(zp_class_human_get_current(player), class_name, charsmax(class_name))
			
			// ML support for class name
			formatex(transkey, charsmax(transkey), "HUMANNAME %s", class_name)
			if (GetLangTransKey(transkey) != TransKey_Bad) formatex(class_name, charsmax(class_name), "%L", ID_SHOWHUD, transkey)
		}
	}
	
	// Spectating someone else?
	if (player != ID_SHOWHUD)
	{
		new player_name[32]
		get_user_name(player,player_name,charsmax(player_name))
		new player_authid[32]
		get_user_authid(player,player_authid,charsmax(player_authid))
		new player_HP = get_user_health(player)
		new player_AP = get_user_armor(player)
		new player_AmmoPacks = zp_ammopacks_get(player)
		
		// Show name, health, class, and money
		set_hudmessage(red, green, blue, 0.02, 0.9, 0, 6.0, 1.1, 0.0, 0.0, -1)
		show_hudmessage(ID_SHOWHUD, "Name: %s | SteamID: %s - %s^nHP: %d | Armor: %d | AmmoPacks: %d"
		,player_name,player_authid,class_name,player_HP,player_AP,player_AmmoPacks)
	}
	else
	{
		new id_name[32]
		get_user_name(ID_SHOWHUD,id_name,charsmax(id_name))
		new id_authid[32]
		get_user_authid(ID_SHOWHUD,id_authid,charsmax(id_authid))
		new ID_HP = get_user_health(ID_SHOWHUD)
		new ID_AP = get_user_health(ID_SHOWHUD)
		new ID_AmmoPacks = zp_ammopacks_get(ID_SHOWHUD)
		
		// Show health, class
		set_hudmessage(red, green, blue, 0.02, 0.9, 0, 6.0, 1.1, 0.0, 0.0, -1)
		show_hudmessage(ID_SHOWHUD, "Name: %s | SteamID: %s - %s^nHP: %d | Armor: %d | AmmoPacks: %d"
		,id_name,id_authid,class_name,ID_HP,ID_AP,ID_AmmoPacks)
	}
}
stock szName(index)
{
	new szName[32];
	get_user_name(index,szName,charsmax(szName));
	return szName;
}
Here.

I have this error:

HTML Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

D:\Counter Strike 1.6 Servers\AMX Mod X\files\base\scripting\include\zp50_class_nightcrawler.inc(1) : warning 200: symbol "_zp50_class_nightcrawler_includ" is truncated to 31 characters
C:\Users\Zeky\Desktop\zp50_hud_info_edit_by_zeky.sma(152 -- 153) : error 017: undefined symbol "id_name"

1 Error.
Could not locate output file D:\Counter Strike 1.6 Servers\Plugins\zp50_hud_info_edit_by_zeky.amx (compile failed).
<<< Process finished (PID=1464). (Exit code 0)

How can i fix it?
Zeky is offline
Noam
Member
Join Date: Jun 2019
Old 11-10-2019 , 06:53   Re: DHUD ZP 5.0 info
Reply With Quote #12

Quote:
Originally Posted by Zeky View Post
I have this error:

HTML Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

D:\Counter Strike 1.6 Servers\AMX Mod X\files\base\scripting\include\zp50_class_nightcrawler.inc(1) : warning 200: symbol "_zp50_class_nightcrawler_includ" is truncated to 31 characters
C:\Users\Zeky\Desktop\zp50_hud_info_edit_by_zeky.sma(152 -- 153) : error 017: undefined symbol "id_name"

1 Error.
Could not locate output file D:\Counter Strike 1.6 Servers\Plugins\zp50_hud_info_edit_by_zeky.amx (compile failed).
<<< Process finished (PID=1464). (Exit code 0)

How can i fix it?
i got no error.
what did you edited?


Code:
/*================================================================================

----------------------------
-*- [ZP] Hud Information -*-
----------------------------

This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.

================================================================================*/

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <zp50_class_human>
#include <zp50_class_zombie>
#include <zp50_class_nemesis>
#include <zp50_class_dragon>
#include <zp50_class_nightcrawler>
#include <zp50_class_assassin>
#include <zp50_class_survivor>
#include <zp50_class_sniper>
#include <zp50_class_plasma>
#include <zp50_class_knifer>
#include <zp50_ammopacks>
#include <zp50_gamemodes>
#include <engine>
#include <dhudmessage>

const HUD_STATS_ZOMBIE_R = 200
const HUD_STATS_ZOMBIE_G = 250
const HUD_STATS_ZOMBIE_B = 0

const HUD_STATS_HUMAN_R = 0
const HUD_STATS_HUMAN_G = 200
const HUD_STATS_HUMAN_B = 250

const HUD_STATS_SPEC_R = 255
const HUD_STATS_SPEC_G = 255
const HUD_STATS_SPEC_B = 255

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
	
const PEV_SPEC_TARGET = pev_iuser2

public plugin_init()
{
	register_plugin("[ZP] Hud Information", ZP_VERSION_STRING, "ZP Dev Team")
}

public client_putinserver(id)
{
	if (!is_user_bot(id))
	{
		// Set the custom HUD display task
		set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
	}
}
// Show HUD Task
public ShowHUD(taskid)
{
	new player = ID_SHOWHUD
	
	// Player dead?
	if (!is_user_alive(player))
	{
		// Get spectating target
		player = pev(player, PEV_SPEC_TARGET)
		
		// Target not alive
		if (!is_user_alive(player))
			return;
	}
	
	// Format classname
	static class_name[32], transkey[64]
	new red, green, blue
	
	if (zp_core_is_zombie(player)) // zombies
	{
		red = HUD_STATS_ZOMBIE_R
		green = HUD_STATS_ZOMBIE_G
		blue = HUD_STATS_ZOMBIE_B
		
		// Nemesis Class loaded?
		if (zp_class_nemesis_get(player))
			formatex(class_name, charsmax(class_name), "Nemesis")
			
		// Assassin Class loaded?
		else if (zp_class_assassin_get(player))
			formatex(class_name, charsmax(class_name), "Assassin")
			
		else if (zp_class_dragon_get(player))
			formatex(class_name, charsmax(class_name), "Dragon")	
			
		else if (zp_class_nightcrawler_get(player))
			formatex(class_name, charsmax(class_name), "NightCrawler")
		else
		{
			zp_class_zombie_get_name(zp_class_zombie_get_current(player), class_name, charsmax(class_name))
			
			// ML support for class name
			formatex(transkey, charsmax(transkey), "ZOMBIENAME %s", class_name)
			if (GetLangTransKey(transkey) != TransKey_Bad) formatex(class_name, charsmax(class_name), "%L", ID_SHOWHUD, transkey)
		}
	}
	else // humans
	{
		red = HUD_STATS_HUMAN_R
		green = HUD_STATS_HUMAN_G
		blue = HUD_STATS_HUMAN_B
		
		// Survivor Class loaded?
		if (zp_class_survivor_get(player))
			formatex(class_name, charsmax(class_name), "Survivor")

		// Sniper Class loaded?
		else if (zp_class_sniper_get(player))
			formatex(class_name, charsmax(class_name), "Sniper")
			
		else if (zp_class_knifer_get(player))
			formatex(class_name, charsmax(class_name), "Knifer")
      
      		else if (zp_class_plasma_get(player))
			formatex(class_name, charsmax(class_name), "Plasma")
		
		else
		{
			zp_class_human_get_name(zp_class_human_get_current(player), class_name, charsmax(class_name))
			
			// ML support for class name
			formatex(transkey, charsmax(transkey), "HUMANNAME %s", class_name)
			if (GetLangTransKey(transkey) != TransKey_Bad) formatex(class_name, charsmax(class_name), "%L", ID_SHOWHUD, transkey)
		}
	}
	
	// Spectating someone else?
	if (player != ID_SHOWHUD)
	{
		new player_name[32]
		get_user_name(player,player_name,charsmax(player_name))
		new player_authid[32]
		get_user_authid(player,player_authid,charsmax(player_authid))
		new player_HP = get_user_health(player)
		new player_AP = get_user_armor(player)
		new player_AmmoPacks = zp_ammopacks_get(player)
		
		// Show name, health, class, and money
		set_dhudmessage(red, green, blue, 0.02, 0.9, 0, 6.0, 1.1, 0.0, 0.0, -1)
		show_dhudmessage(ID_SHOWHUD, "Name: %s | SteamID: %s - %s^nHP: %d | Armor: %d | AmmoPacks: %d"
		,player_name,player_authid,class_name,player_HP,player_AP,player_AmmoPacks)
	}
	else
	{
		new id_name[32]
		get_user_name(ID_SHOWHUD,id_name,charsmax(id_name))
		new id_authid[32]
		get_user_authid(ID_SHOWHUD,id_authid,charsmax(id_authid))
		new ID_HP = get_user_health(ID_SHOWHUD)
		new ID_AP = get_user_health(ID_SHOWHUD)
		new ID_AmmoPacks = zp_ammopacks_get(ID_SHOWHUD)
		
		// Show health, class
		set_dhudmessage(red, green, blue, 0.02, 0.9, 0, 6.0, 1.1, 0.0, 0.0, -1)
		show_dhudmessage(ID_SHOWHUD, "Name: %s | SteamID: %s - %s^nHP: %d | Armor: %d | AmmoPacks: %d"
		,id_name,id_authid,class_name,ID_HP,ID_AP,ID_AmmoPacks)
	}
}
stock szName(index)
{
	new szName[32];
	get_user_name(index,szName,charsmax(szName));
	return szName;
}
Try this.
Noam is offline
Zeky
Junior Member
Join Date: Jul 2019
Old 11-10-2019 , 09:55   Re: DHUD ZP 5.0 info
Reply With Quote #13

Quote:
Originally Posted by Noam View Post
i got no error.
what did you edited?


Code:
/*================================================================================

----------------------------
-*- [ZP] Hud Information -*-
----------------------------

This plugin is part of Zombie Plague Mod and is distributed under the
terms of the GNU General Public License. Check ZP_ReadMe.txt for details.

================================================================================*/

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <zp50_class_human>
#include <zp50_class_zombie>
#include <zp50_class_nemesis>
#include <zp50_class_dragon>
#include <zp50_class_nightcrawler>
#include <zp50_class_assassin>
#include <zp50_class_survivor>
#include <zp50_class_sniper>
#include <zp50_class_plasma>
#include <zp50_class_knifer>
#include <zp50_ammopacks>
#include <zp50_gamemodes>
#include <engine>
#include <dhudmessage>

const HUD_STATS_ZOMBIE_R = 200
const HUD_STATS_ZOMBIE_G = 250
const HUD_STATS_ZOMBIE_B = 0

const HUD_STATS_HUMAN_R = 0
const HUD_STATS_HUMAN_G = 200
const HUD_STATS_HUMAN_B = 250

const HUD_STATS_SPEC_R = 255
const HUD_STATS_SPEC_G = 255
const HUD_STATS_SPEC_B = 255

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)
	
const PEV_SPEC_TARGET = pev_iuser2

public plugin_init()
{
	register_plugin("[ZP] Hud Information", ZP_VERSION_STRING, "ZP Dev Team")
}

public client_putinserver(id)
{
	if (!is_user_bot(id))
	{
		// Set the custom HUD display task
		set_task(1.0, "ShowHUD", id+TASK_SHOWHUD, _, _, "b")
	}
}
// Show HUD Task
public ShowHUD(taskid)
{
	new player = ID_SHOWHUD
	
	// Player dead?
	if (!is_user_alive(player))
	{
		// Get spectating target
		player = pev(player, PEV_SPEC_TARGET)
		
		// Target not alive
		if (!is_user_alive(player))
			return;
	}
	
	// Format classname
	static class_name[32], transkey[64]
	new red, green, blue
	
	if (zp_core_is_zombie(player)) // zombies
	{
		red = HUD_STATS_ZOMBIE_R
		green = HUD_STATS_ZOMBIE_G
		blue = HUD_STATS_ZOMBIE_B
		
		// Nemesis Class loaded?
		if (zp_class_nemesis_get(player))
			formatex(class_name, charsmax(class_name), "Nemesis")
			
		// Assassin Class loaded?
		else if (zp_class_assassin_get(player))
			formatex(class_name, charsmax(class_name), "Assassin")
			
		else if (zp_class_dragon_get(player))
			formatex(class_name, charsmax(class_name), "Dragon")	
			
		else if (zp_class_nightcrawler_get(player))
			formatex(class_name, charsmax(class_name), "NightCrawler")
		else
		{
			zp_class_zombie_get_name(zp_class_zombie_get_current(player), class_name, charsmax(class_name))
			
			// ML support for class name
			formatex(transkey, charsmax(transkey), "ZOMBIENAME %s", class_name)
			if (GetLangTransKey(transkey) != TransKey_Bad) formatex(class_name, charsmax(class_name), "%L", ID_SHOWHUD, transkey)
		}
	}
	else // humans
	{
		red = HUD_STATS_HUMAN_R
		green = HUD_STATS_HUMAN_G
		blue = HUD_STATS_HUMAN_B
		
		// Survivor Class loaded?
		if (zp_class_survivor_get(player))
			formatex(class_name, charsmax(class_name), "Survivor")

		// Sniper Class loaded?
		else if (zp_class_sniper_get(player))
			formatex(class_name, charsmax(class_name), "Sniper")
			
		else if (zp_class_knifer_get(player))
			formatex(class_name, charsmax(class_name), "Knifer")
      
      		else if (zp_class_plasma_get(player))
			formatex(class_name, charsmax(class_name), "Plasma")
		
		else
		{
			zp_class_human_get_name(zp_class_human_get_current(player), class_name, charsmax(class_name))
			
			// ML support for class name
			formatex(transkey, charsmax(transkey), "HUMANNAME %s", class_name)
			if (GetLangTransKey(transkey) != TransKey_Bad) formatex(class_name, charsmax(class_name), "%L", ID_SHOWHUD, transkey)
		}
	}
	
	// Spectating someone else?
	if (player != ID_SHOWHUD)
	{
		new player_name[32]
		get_user_name(player,player_name,charsmax(player_name))
		new player_authid[32]
		get_user_authid(player,player_authid,charsmax(player_authid))
		new player_HP = get_user_health(player)
		new player_AP = get_user_armor(player)
		new player_AmmoPacks = zp_ammopacks_get(player)
		
		// Show name, health, class, and money
		set_dhudmessage(red, green, blue, 0.02, 0.9, 0, 6.0, 1.1, 0.0, 0.0, -1)
		show_dhudmessage(ID_SHOWHUD, "Name: %s | SteamID: %s - %s^nHP: %d | Armor: %d | AmmoPacks: %d"
		,player_name,player_authid,class_name,player_HP,player_AP,player_AmmoPacks)
	}
	else
	{
		new id_name[32]
		get_user_name(ID_SHOWHUD,id_name,charsmax(id_name))
		new id_authid[32]
		get_user_authid(ID_SHOWHUD,id_authid,charsmax(id_authid))
		new ID_HP = get_user_health(ID_SHOWHUD)
		new ID_AP = get_user_health(ID_SHOWHUD)
		new ID_AmmoPacks = zp_ammopacks_get(ID_SHOWHUD)
		
		// Show health, class
		set_dhudmessage(red, green, blue, 0.02, 0.9, 0, 6.0, 1.1, 0.0, 0.0, -1)
		show_dhudmessage(ID_SHOWHUD, "Name: %s | SteamID: %s - %s^nHP: %d | Armor: %d | AmmoPacks: %d"
		,id_name,id_authid,class_name,ID_HP,ID_AP,ID_AmmoPacks)
	}
}
stock szName(index)
{
	new szName[32];
	get_user_name(index,szName,charsmax(szName));
	return szName;
}
Try this.


Im fix my error, my wrong edit... Sorry
Zeky 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 21:29.


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