Raised This Month: $ Target: $400
 0% 

Info about register_dictionary


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OneMoreLevel
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
Old 10-21-2009 , 14:09   Re: Info about register_dictionary
Reply With Quote #1

So if I make a dictionary file like this:
Code:
[en]
OML_TALK = Hello!

[fr]
OML TALK = Some french word!
Then made a VERY simple plugin like this:
PHP Code:
/* Sample plugin */
#include <amxmodx>
#include <amxmisc>

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


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"say /talk" "plugin_talk");
    
register_dictionary("dictionary_talk.txt")
}

public 
plugin_talk (id) {
    
client_printidprint_chat"Server says: %L"LANG_PLAYER"OML_TALK"id )

It would do
Quote:
if the server's language is English, but the client's is French, then it'll print to them in French
__________________
60/100 60%
[||||||||||||||||||||]
Project: Warfighter mod
Blog:
http://sites.google.com/site/dailymultitasker/
PHP Code:
   if ( i_help_you "Yes" ) == )
    
set_user_karma(onemorelevel,add,+1
OneMoreLevel is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-21-2009 , 14:19   Re: Info about register_dictionary
Reply With Quote #2

Yes.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-21-2009 , 14:29   Re: Info about register_dictionary
Reply With Quote #3

Oops, you can scratch that ID stuff. I just looked it up to make sure I was right. I've never used ML before as I think everyone should use English, so you can call me an idiot at this.

LANG_PLAYER seems to only work in functions where an id is passed into them, such as client_print(). Otherwise, you should use LANG_SERVER. There's no id parameter after either of them.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 17:46.


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