[Plugin] imessage - fast multilanguage strings
#1

imessage plugin
Author: Bombo
Version: 1.1.0


[+] speed up

This plugin allows a quick access to an unlimited number of named strings with translations in various languages.

Functions:
native init_ifile(in_filename[]); //set filename
native close_ifile(); //close file
native imessage(out_string[], in_str_name[], in_language[], size=sizeof out_string); //get string


The file must be UTF8 encoded, so strings keeps extended characters. A size of this file is unlimited (by the plugin).

Pattern:
Код:
#multilanguage message file
#pattern file for imessage v1.0.0 by Bombo
#Supported languages: "en","ru","fr","uk","es","cs","de","it","pl","tr","sr","bg","ro"
#
#Format of the name: "\n[MESSAGE_NAME]\n", where MESSAGE_NAME is latin only
#Format of the language: "\nxx {", xx - language code, contains 2 latin characters only
#Format of the end of string: "};\n", no spaces between caracters
#In the end of file: "\n\n", message lost is possible in other case (!)
#
#Encoding: UTF8
#New line: Unix
#
#File size is unlimited.
#Location: samp-server root

[HELLO_MESSAGE]
en {Set your language, please};
ru {Укажите ваш язык};

[YOUR_LANGUAGE]
en {Your language: };
ru {Ваш язык: };
es {Su idioma: };

[HELPLANG]
en {{00FF00}/lang <xx> {FFCC00}- set your language, xx: {FF0000}en,ru,es};
es {{00FF00}/lang <xx> {FFCC00}- seleccione su idioma, xx: {FF0000}en,ru,es};
ru {{00FF00}/lang <xx> {FFCC00}- укажите ваш язык, xx: {FF0000}en,ru,es};

[HELPSHOW]
en {{00FF00}/show {FFCC00}- show you language of all online players.};
es {{00FF00}/show {FFCC00}- mostrarle país y el idioma los jugadores en línea.};
ru {{00FF00}/show {FFCC00}- язык всех онлайн игроков.};
#fr {...};

[NEWLANG]
en {Your language is: };
es {Ahora su idioma: };
ru {Теперь ваш язык: };

[COMMAND_USAGE]
en {Usage: };
es {Uso: };
ru {Использование команды: };
It is strongly recommend to keep the file format.


Usage:
PHP код:
#include <a_samp>
...
#include <imessage>
...
public 
OnFilterScriptInit()
{
    ...
    
//set filename
    
init_ifile("pattern.txt"); 
    ...
    return 
1;
}
public 
OnPlayerConnect(playerid//or any other function
{
    new 
imes[128];
    ...
    
//get string
    
imessage(imes"HELLO_MESSAGE""en");
    
//set the string in any function
    
SendClientMessage(playerid0xFFCC00AAimes);
    ...
    return 
1

Result:


0.3e, 0.3x, 0.3z, 0.3.7 tested




You can see the plugin in work on test servers below.
Reply


Messages In This Thread
imessage - fast multilanguage strings - by Bombo - 20.03.2013, 16:06
Re: imessage - fast multilanguage strings - by Gamer_Z - 20.03.2013, 17:12
Re: imessage - fast multilanguage strings - by Bombo - 20.03.2013, 17:27
Re: imessage - fast multilanguage strings - by leong124 - 20.03.2013, 17:40
Re: imessage - fast multilanguage strings - by Bombo - 20.03.2013, 18:09
Re: imessage - fast multilanguage strings - by Gamer_Z - 20.03.2013, 19:36
Re: imessage - fast multilanguage strings - by Bombo - 20.03.2013, 20:05
Re: imessage - fast multilanguage strings - by Rock - 20.03.2013, 20:48
Re: imessage - fast multilanguage strings - by TheArcher - 20.03.2013, 21:25
Re: imessage - fast multilanguage strings - by Bombo - 20.03.2013, 21:59
Re: imessage - fast multilanguage strings - by freddy smyth - 21.03.2013, 01:55
Re: imessage - fast multilanguage strings - by ReneG - 21.03.2013, 05:12
Re: imessage - fast multilanguage strings - by Dzines4SAMP - 21.03.2013, 05:53
Re: imessage - fast multilanguage strings - by CoaPsyFactor - 21.03.2013, 09:57
Re: imessage - fast multilanguage strings - by steki. - 21.03.2013, 10:14
Re: imessage - fast multilanguage strings - by u3ber - 21.03.2013, 10:22
Respuesta: imessage - fast multilanguage strings - by TheChaoz - 21.03.2013, 11:40
Re: imessage - fast multilanguage strings - by Rock - 21.03.2013, 12:05
Re: imessage - fast multilanguage strings - by Gamer_Z - 21.03.2013, 12:38
Re: imessage - fast multilanguage strings - by xeeZ - 21.03.2013, 12:50
Re: imessage - fast multilanguage strings - by Edvin - 21.03.2013, 14:15
Re: imessage - fast multilanguage strings - by leong124 - 22.03.2013, 16:13
Re: imessage - fast multilanguage strings - by QuaTTrO - 23.03.2013, 19:42
Re: imessage - fast multilanguage strings - by legodude - 24.03.2013, 11:23
Re: imessage - fast multilanguage strings - by Bombo - 25.03.2013, 23:54
Re: imessage - fast multilanguage strings - by Gamer_Z - 26.03.2013, 00:07
Respuesta: imessage - fast multilanguage strings - by xDarkuzSx - 01.10.2014, 10:04
Re: imessage - fast multilanguage strings - by wahyumahadir - 01.03.2015, 16:25
Re: imessage - fast multilanguage strings - by Kaperstone - 02.03.2015, 12:15
Re: imessage - fast multilanguage strings - by nevahudo - 13.06.2015, 23:22
Re: imessage - fast multilanguage strings - by CoaPsyFactor - 16.06.2015, 11:03
Re: imessage - fast multilanguage strings - by iSanchez - 26.12.2016, 00:28

Forum Jump:


Users browsing this thread: 1 Guest(s)