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

Execute Different Commands for Different Lang Users


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snake.
Senior Member
Join Date: Jul 2017
Old 05-07-2020 , 00:06   Execute Different Commands for Different Lang Users
Reply With Quote #1

When players type their nightvision key, they'll execute different say commands. For example en users will say /menuen or tr users will say /menutr. Can somebody give me example for these two langs if it is possible ?
Snake. is offline
Send a message via Skype™ to Snake.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-07-2020 , 00:17   Re: Execute Different Commands for Different Lang Users
Reply With Quote #2

The simplest way is to register all of the commands (one for each language) that call the same function in the plugin.
__________________
fysiks is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 05-07-2020 , 01:36   Re: Execute Different Commands for Different Lang Users
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
The simplest way is to register all of the commands (one for each language) that call the same function in the plugin.
Could you give me a simple code to do that ? I won't add it in a plugin, this will be a one with its own to just open menus with these say commands.

Last edited by Snake.; 05-07-2020 at 01:40.
Snake. is offline
Send a message via Skype™ to Snake.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-07-2020 , 08:59   Re: Execute Different Commands for Different Lang Users
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=284324
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Snake.
Senior Member
Join Date: Jul 2017
Old 05-07-2020 , 09:07   Re: Execute Different Commands for Different Lang Users
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
I'm already using this, that's why i wrote like that above
Snake. is offline
Send a message via Skype™ to Snake.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-07-2020 , 10:06   Re: Execute Different Commands for Different Lang Users
Reply With Quote #6

Then what's the problem? Simply add multiple commands in different languages that open the menu.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Snake.
Senior Member
Join Date: Jul 2017
Old 05-07-2020 , 10:12   Re: Execute Different Commands for Different Lang Users
Reply With Quote #7

The problem is when anyone press the [N] key, they can only open single menu. For example when en users type nightvision key, they will open say /menuen or for tr users it's say /menutr.
Snake. is offline
Send a message via Skype™ to Snake.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-07-2020 , 22:22   Re: Execute Different Commands for Different Lang Users
Reply With Quote #8

If you want a multilingual menu, then you should create a multilingual menu. No need for having a ton of duplicate code with different text in it.
__________________
fysiks is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 05-07-2020 , 23:39   Re: Execute Different Commands for Different Lang Users
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
If you want a multilingual menu, then you should create a multilingual menu. No need for having a ton of duplicate code with different text in it.
I would really want but i am creating the menus with https://forums.alliedmods.net/showthread.php?t=284324

Last edited by Snake.; 05-07-2020 at 23:40.
Snake. is offline
Send a message via Skype™ to Snake.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2020 , 22:16   Re: Execute Different Commands for Different Lang Users
Reply With Quote #10

That plugin is for 'simple' menus. What you need is not so simple. So, either that plugin would need to be updated to implement multilingual menus or you can create or request a plugin that does what you need. It sounds like it shouldn't be too terrible to create. If you provide your configuration someone might be able to quickly make a custom plugin for you.

I guess a less convenient route, IMO, would be to create an intermediate plugin that handles the language part and then sends the language-specific command back to the user (or via amxclient_cmd() if you're using AMX Mod X 1.9 or newer) to trigger your Simple Menu implementation.
__________________

Last edited by fysiks; 05-08-2020 at 22:23.
fysiks 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 18:05.


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