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

i dont know how to add lang .ini file for the menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 04-17-2019 , 13:00   i dont know how to add lang .ini file for the menu
Reply With Quote #1

i registered dictionary but i dont know how to like make this
Code:
menu_additem(menu,"\yYes","",0);(
how to make it read the lang in the .ini

Code:
/*
		|\      | |	    |  |       |       /\        |\      | |\      |	   /\       |--------|
		| \     | | 	    |  |       |      /  \ 	 | \     | | \ 	   |	  /  \	    |        |  
		|  \    | |         |  |       |     /    \	 |  \    | |  \	   |	 /    \     |        |    
		|   \   | |         |  |-------|    /      \	 |   \   | |   \   |    /      \    |        |    
		|    \  | |	    |  |       |   /--------\    |    \  | |	\  |   /--------\   |        |   
		|     \ | |	    |  |       |  /          \   |     \ | |	 \ |  /          \  |        |  
		|      \| |_________|__|       | /            \  |      \| |      \| /            \ |--------|
		
							/Made By Nuhannad\
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#include <colorchat>

#define NuhT 600.0

new pcvar_adv
new pcvar_display
new pcvar_rs

public plugin_init()
{
	//plugin init
	//DONT CHANGE PLUGIN AUTHOR!!!!!!!!
	register_plugin("ResetScore System", "0.1", "Nuhannad")
	
	//Cvars settings
	pcvar_display = register_cvar("Nuhannad_rsdisplay", "1")
	pcvar_adv = register_cvar("nuhannad_adv", "1")
	pcvar_rs = register_cvar("nuhannad_rsmenu", "1")
	
	//server chat commands
	register_clcmd("say /rs","rs")
	register_clcmd("say_team /rs","rs")
	register_clcmd("say /resetscore","rs")
	register_clcmd("say_team /resetscore","rs")
	register_clcmd("say /rsadmin","rsadmin")
	
	register_dictionary("ResetScoreLang.txt");
		
	//connect msg
	if(get_cvar_num("Nuhannad_adv") == 1)
	{
		set_task(NuhT, "advertise", _, _, _, "b")
	}
}

public rsadmin(id,item)
{
	if(is_user_admin(id))
	{
		new menu = menu_create("Rs AdminMenu", "adminmenu")
		if(get_user_flags(id) & ADMIN_CVAR)
		menu_additem(menu, "\r%d","",0);
		if(get_user_flags(id) & ADMIN_CVAR)
		menu_additem(menu, "\r%d","",0);
		
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL );
		menu_display(id, menu, 0 );
	
		return PLUGIN_HANDLED;
	}
	else
	{
		ColorChat(id,GREEN,"You Dont Have Acces")
	}
	return PLUGIN_HANDLED;
}

public adminmenu(id, iMenu, iItem)
{
	if( iItem == MENU_EXIT ) {
		menu_destroy( iMenu );
		return PLUGIN_CONTINUE;
	}
	switch( iItem ) {
		case 0: 
		{
			//NORMAL
			client_cmd(id,"nuhannad_rsmenu 0")
	
		}
		case 1:
		{
			//MENU
			client_cmd(id,"nuhannad_rsmenu 1")			
			}
		}

	menu_destroy(iMenu)
	return PLUGIN_HANDLED;
}
	
	
public rs(id,item)
{
	//with menu
	if(get_pcvar_num(pcvar_rs) == 1)
	{
		new szArgs[256]
		formatex(szArgs, charsmax(szArgs), "\y[\rResetScore\y] \wYour score is: \rKills:%d/Deaths:%d^nMade By Nuhannad To Cant Be Killed", get_user_frags(id),get_user_deaths(id))
		new menu = menu_create(szArgs, "rsmenu")
		menu_additem(menu, "\yYes","",0);
		menu_additem(menu, "\rNo","",0);
		
		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL );
		menu_display(id, menu, 0 );
	
		return PLUGIN_HANDLED;
	}
	else
	{
		//without menu
		new name[33]
		get_user_name(id,name,32)
		cs_set_user_deaths(id, 0)
		set_user_frags(id, 0)
		cs_set_user_deaths(id, 0)
		set_user_frags(id, 0)	
		set_hudmessage(255, 0, 0, -1.0, 0.01)
		show_hudmessage(0, "<[KnifeMod ResetScore] %s has just restarted his score>",name)
		ColorChat(0, NORMAL, "^1[^4KnifeMod ResetScore^1] ^3%s, ^4has just restarted his score.", name)			
	}
	return PLUGIN_HANDLED;
}

public rsmenu( id, iMenu, iItem  )
{
	if( iItem == MENU_EXIT ) {
		menu_destroy( iMenu );
		return PLUGIN_CONTINUE;
	}
	switch( iItem ) {
		case 0: 
		{
			//Yes
			cs_set_user_deaths(id, 0)
			set_user_frags(id, 0)
			cs_set_user_deaths(id, 0)
			set_user_frags(id, 0)	
	
			new name[33]
			get_user_name(id, name, 32)
			if(get_pcvar_num(pcvar_display) == 1)
			{
				set_hudmessage(255, 0, 0, -1.0, 0.01)
				show_hudmessage(0, "<[KnifeMod ResetScore] %s has just restarted his score>",name)
				ColorChat(0, NORMAL, "^1[^4KnifeMod ResetScore^1] ^3%s, ^4has just restarted his score.", name)
			}
		}
		case 1:
		{
			//No
				new name[33]
				get_user_name(id, name, 32)
				if(get_pcvar_num(pcvar_display) == 1)
				{
					set_hudmessage(255, 0, 0, -1.0, 0.01)
					show_hudmessage(0, "<[KnifeMod ResetScore] %s has just decided to not restart his score>",name)
					ColorChat(0,NORMAL,"^1[^4KnifeMod ResetScore^1] ^3%s, ^4has just decided to not reset his score.",name)
				}
			}
		}

	menu_destroy(iMenu)
	return PLUGIN_HANDLED;
}


public client_putinserver(id)
{
	if(get_pcvar_num(pcvar_adv) == 1)
	{
		set_task(10.0, "con", id, _, _, "a", 1)
	}
	return PLUGIN_HANDLED;
}

public con(id)
{
	if(is_user_connected(id))
	{
		if(is_user_alive(id))
		{
			//Connect message
			new name[33]
			get_user_name(id,name,32)
			ColorChat(0, NORMAL, "^1[^4KnifeMod ResetScore^1] ^3Welcome %s, ^4You Can reset Your score by typing /rs.", name)
			ColorChat(0, NORMAL, "^1[^4KnifeMod ResetScore^1] ^3Made By Nuhannad To Cant Be Killed.", name)
			set_hudmessage(255, 0, 0, -1.0, 0.01)
			show_hudmessage(0, "<[KnifeMod ResetScore] You can reset your score by typing /rs>")
			show_hudmessage(0, "<[KnifeMod ResetScore] Made By Nuhannad To Cant Be Killed>")
		}
	}
	return PLUGIN_HANDLED;
}


// You Can Add other stuff :D
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-17-2019 , 13:39   Re: i dont know how to add lang .ini file for the menu
Reply With Quote #2

https://wiki.alliedmods.net/Advanced...ingual_Support

Example:
PHP Code:
new item_name[32]
formatexitem_namecharsmax(item_name), "%L"playerID"DICT_KEY" // player lang
menu_additemmenuitem_name )
// or
menu_additemmenufmt("%L"playerID"DICT_KEY") ) // if AMXX 190+ 
__________________
My English is A0

Last edited by E1_531G; 04-17-2019 at 13:41.
E1_531G is offline
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 04-17-2019 , 13:47   Re: i dont know how to add lang .ini file for the menu
Reply With Quote #3

Code:
menu_additem( menu, fmt("%L", playerID, "DICT_KEY") ) // if AMXX 190+
you mean "%L = name in .ini" "but playerID what means"> is it id?
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 04-17-2019 , 13:55   Re: i dont know how to add lang .ini file for the menu
Reply With Quote #4

i made it like this
Code:
		new item_name[32]
		formatex( item_name, charsmax(item_name), "%L", id, "YES" ) // player lang
		menu_additem( menu, item_name )
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 04-17-2019 , 13:59   Re: i dont know how to add lang .ini file for the menu
Reply With Quote #5

i got it now works thanks any way
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
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 02:04.


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