AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Lang (https://forums.alliedmods.net/showthread.php?t=324400)

Ludak 05-15-2020 04:45

Lang
 
Greetings,
I have a question.
Can language files be reloaded during the game and take an effect immediately?

Thank you.

elmedin 05-15-2020 12:36

Re: Lang
 
As far as i know the moment u launch ur server/game the lang files will be read and will be stored in memory they wont be read again if u change something unless u change map. I might be wrong but this is what i know

Ludak 05-15-2020 17:59

Re: Lang
 
Tried with register_lang
It works.

fysiks 05-15-2020 20:51

Re: Lang
 
When did you call it? Usually that is called in plugin_init() which only runs at the beginnig of the map when the plugin is loaded.

Ludak 05-16-2020 10:26

Re: Lang
 
Quote:

Originally Posted by fysiks (Post 2700419)
When did you call it? Usually that is called in plugin_init() which only runs at the beginnig of the map when the plugin is loaded.

I have it there, but I have used it in a native, since I have some functionality which adds new phrases to lang when players create their stuff.
It works like a charm.

Shadows Adi 05-19-2020 06:21

Re: Lang
 
I don't know if this will work, but it would refresh your lang file every 20.0 seconds:
PHP Code:

#include <amxmodx>
#include <amxmisc>

public plugin_init( )
{
    
register_plugin"Refresh Lang File""0.1""New plugin" )
    
    
set_task(20.0"task_refresh"21412321_,_"b")
}

public 
task_refresh( )
{
    
register_dictionary("file.txt")
    return 
PLUGIN_CONTINUE




All times are GMT -4. The time now is 17:01.

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