AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   %L (https://forums.alliedmods.net/showthread.php?t=57136)

Rolnaaba 06-28-2007 22:47

%L
 
can someone explain, the %L used like in client_print(). I am not sure what it is could someone explain what it is, and how to use it, and why to use it ect.

stupok 06-28-2007 22:59

Re: %L
 
You must create a txt file in "amxmodx\data\lang" with translations, formatted like this:

Code:

[en]
LOADED_ADMIN = Loaded 1 admin from file

[de]
LOADED_ADMIN = 1 Admin aus der Datei geladen

[sr]
LOADED_ADMIN = Ucitan 1 administrator iz fajla

In plugin_init() do this:

Code:

register_dictionary("your_file.txt")
Then use format() to format the string in the user's or server's language:

Code:

new text[64]
format(text, 63, "%L", LANG_PLAYER, "LOADED_ADMIN")

Code:

#define LANG_SERVER                0
#define LANG_PLAYER                -1


Rolnaaba 06-28-2007 23:09

Re: %L
 
then you could do, client_print(id, print_chat, text); interesting, are the [en], [de] ect. headers hardcoded? meaning does it have to be [en] or can i say [english]? And if hardcoded can I find a list of all of them?

XxAvalanchexX 06-28-2007 23:10

Re: %L
 
http://wiki.amxmodx.org/Advanced_Scr...ingual_Support

Rolnaaba 06-28-2007 23:11

Re: %L
 
thanx


All times are GMT -4. The time now is 21:30.

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