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

Add dictionary


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supergirl
Member
Join Date: Jul 2016
Old 08-14-2016 , 09:34   Add dictionary
Reply With Quote #1

Hi,

I made this plugin: https://forums.alliedmods.net/showthread.php?t=286293, and I tried to add dictionary, for a few hours. I failed, I always get to many errors when I'm going to compile it.

Q/A

Q: Why am I trying to do some type of dictionary/add lang file?
A: (Quote)
Quote:
Originally Posted by fysiks View Post
A released plugin should never require editing the source code to make the core functionality work.
... (So, when users need to edit the messages, they will only need to go at the txt file)

W8ing for help,
Greetings.

Last edited by Supergirl; 08-14-2016 at 09:34.
Supergirl is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 08-14-2016 , 09:58   Re: Add dictionary
Reply With Quote #2

I think you need to read this to update and handle your plugin
https://wiki.alliedmods.net/Advanced...ingual_Support

Here is some example:
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "AlliedMods"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_dictionary("lang_file.txt")
    
    
register_clcmd("say /lang_decript""cmdLang")
}

public 
cmdLang(id)
    
client_print(idprint_chat"%L"id"LOOK_FOR_LANG"
TXT File
Code:
[EN]
LOOK_FOR_LANG = Hello
[ES]
LOOK_FOR_LANG = Hola
__________________

Last edited by Artifact; 08-14-2016 at 10:03.
Artifact is offline
Supergirl
Member
Join Date: Jul 2016
Old 08-14-2016 , 14:58   Re: Add dictionary
Reply With Quote #3

Thanks,

Just one question: What about this? - register_clcmd("say /lang_decript", "cmdEzmmo")
I tried to compile without it, and it compiles well (no errors/warnings)
Supergirl is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 08-15-2016 , 00:27   Re: Add dictionary
Reply With Quote #4

How I can see, your plugin with that command can compile fine
__________________
Artifact is offline
Supergirl
Member
Join Date: Jul 2016
Old 08-15-2016 , 04:50   Re: Add dictionary
Reply With Quote #5

Ham, yes, it compiles. Now I'm just trying to understand why it compiles with and without the command...
Supergirl is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-15-2016 , 06:47   Re: Add dictionary
Reply With Quote #6

Quote:
Originally Posted by Supergirl View Post
Ham, yes, it compiles. Now I'm just trying to understand why it compiles with and without the command...
Compiler does not care about what you do, as long as you don't break it's rules. It warns you about other kind of errors. Plugin compiles, but it won't work.
__________________
HamletEagle is offline
Supergirl
Member
Join Date: Jul 2016
Old 08-15-2016 , 09:03   Re: Add dictionary
Reply With Quote #7

Ah, thanks.

Please, close/move the topic.
Supergirl 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 22:55.


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