Raised This Month: $ Target: $400
 0% 

Help to Multilang standart zombie classes (zp4.3fix5a)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
strahh
Junior Member
Join Date: Mar 2022
Old 03-05-2022 , 19:17   Help to Multilang standart zombie classes (zp4.3fix5a)
Reply With Quote #1

Hello everyone, I wanted to make a multilang of standard zombie classes

faced with the problem that zombieclasses.ini does not read info from lang (ML_)
, i.e. for the place of text information in the game with lang, I get ML_CLSC, ML_BIG etc.

but in the zombie selection menu, everything works



in zombie_plague.txt keys are present
Attached Files
File Type: sma Get Plugin or Get Source (zombie_plague40v25-1.sma - 46 views - 344.6 KB)
File Type: ini zp_zombieclasses.ini (1.1 KB, 47 views)
strahh is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-06-2022 , 07:44   Re: Help to Multilang standart zombie classes (zp4.3fix5a)
Reply With Quote #2

Search for
Code:
register_dictionary("zombie_plague.txt")
And paste this below it

Code:
register_dictionary("zombie_classes.txt")
Create the zombie_classes.txt file in addons/amxmodx/data/lang and replace the ShowHud function (should be in line 8525) with this.

Code:
// Show HUD Task
public ShowHUD(taskid)
{
	static id
	id = ID_SHOWHUD;
	
	// Player died?
	if (!g_isalive[id])
	{
		// Get spectating target
		id = pev(id, PEV_SPEC_TARGET)
		
		// Target not alive
		if (!g_isalive[id]) return;
	}
	
	// Format classname
	static class[32], red, green, blue
	
	if (g_zombie[id]) // zombies
	{
		red = 255
		green = 255
		blue = 0
		
		if (g_nemesis[id])
		{
			formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_NEMESIS")
		}
		else
		{
			ArrayGetString(g_zclass_name, g_zombieclass[id], class, charsmax(class))

			new key[64]
			formatex(key, charsmax(key), "ZOMBIE(%s)", class)
			replace_all(key, charsmax(key), " ", "-")

			if (GetLangTransKey(key) != TransKey_Bad)
			{
				formatex(class, charsmax(class), "%L", ID_SHOWHUD, key)
			}
		}

		//copy(class, charsmax(class), g_zombie_classname[id])
	}
	else // humans
	{
		red = 0
		green = 0
		blue = 255
		
		if (g_survivor[id])
		formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SURVIVOR")
		else
		formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_HUMAN")
	}
	
	// Spectating someone else?
	if (id != ID_SHOWHUD)
	{
		// Show name, health, class, and ammo packs 
		set_dhudmessage(255, 255, 255, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0)
		show_dhudmessage(ID_SHOWHUD, "[%L %s]^n[HP: %d] [%L %s] [%L %d]", ID_SHOWHUD, "SPECTATING", g_playername[id], pev(id, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[id])
	}
	else
	{
		// Show health, class and ammo packs 
		set_hudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0)
		show_hudmessage(ID_SHOWHUD, "[%L: %d] [%L %s] [%L %d]", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD])
	}
}
Now just add the translations for the classes in the zombie_classes.txt file you created. The format is

Quote:
ZOMBIE(Zombie-Name) = The Zombie Name
where "Zombie-Name" is the name of the class. Spaces must be replaced with a dash "-".

Suppose you've this in zp_zombieclasses.ini

Code:
[Classic Zombie]
NAME = Classic Zombie
INFO = =Balanced=
MODELS = host_zombie
CLAWMODEL = models/nst_zombie/v_knife_tank_zombi.mdl
HEALTH = 3000
SPEED = 0.75
GRAVITY = 1.00
KNOCKBACK = 1.00
You would replace "Zombie-Name" with the one marked in red, in this case, Classic Zombie.

Code:
ZOMBIE(Classic-Zombie) = Classic Zombie
Hope that makes sense.
__________________









Last edited by CrazY.; 03-06-2022 at 07:46.
CrazY. is offline
strahh
Junior Member
Join Date: Mar 2022
Old 03-08-2022 , 08:17   Re: Help to Multilang standart zombie classes (zp4.3fix5a)
Reply With Quote #3

yes it really works, thanks

I also changed it here according to your example

// Show selected zombie class info and stats

Last edited by strahh; 03-09-2022 at 02:05.
strahh is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-08-2022 , 10:46   Re: Help to Multilang standart zombie classes (zp4.3fix5a)
Reply With Quote #4

In this line

Code:
formatex(name, charsmax(name), "%L", name, key)

name should be either id or LANG_PLAYER

Code:
formatex(name, charsmax(name), "%L", id, key)
__________________








CrazY. is offline
strahh
Junior Member
Join Date: Mar 2022
Old 03-09-2022 , 02:04   Re: Help to Multilang standart zombie classes (zp4.3fix5a)
Reply With Quote #5

Quote:
Originally Posted by CrazY. View Post
In this line

Code:
formatex(name, charsmax(name), "%L", name, key)

name should be either id or LANG_PLAYER

Code:
formatex(name, charsmax(name), "%L", id, key)
Yes, I did the same, accidentally inserted one of the failed attempts in reply!
Thanks again!
strahh 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 00:25.


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