[Include] MultiLanguage (Message, GameText, TextDraw, Dialog)
#1

Hi

I don't relase any my scripts/include there, but it can help many people.
It's simple include allows you to send a message in multiple languages

DOWNLOAD:
V1 (16.07.2011)
V2 (19.07.2011)
V3 (29.07.2011) -> http://pastebin.com/2L0bj87y

How To Install ?

1) On the top add:
Код:
#include <ML>
2) In OnDialogResponse add:
Код:
LANGUAGE_ODR(playerid, dialogid, response, listitem);
How To Use ?

First, choose your language, use this function in command/OnPlayerConnect:
Код:
ChooseLanguage(playerid);
Код:
native LanguageMessage(playerid, color, ...);
native LanguageMessageToAll(color, ...);
native LanguageTextDrawMessage(playerid, Text:ID, ...);
native LanguageGameTextForPlayer(playerid, styleid, time, ...);
native LanguageGameTextForAll(styleid, time, ...);
native LanguageDialogForPlayer(playerid, dialogid, style, ...);
We change dots (...) to ID of language (defined in include) and message in this language, for example:
Код:
LanguageMessage(playerid, -1, LANGUAGE_POLISH, "Po polsku", LANGUAGE_ENGLISH, "English message");
Function LanguageDialogForPlayer is an exception, example of using:
Код:
LanguageDialogForPlayer(playerid, 0, DIALOG_STYLE_MSGBOX, LANGUAGE_POLISH, "naglowek", "info", "OK", "Anuluj", LANGUAGE_ENGLISH, "caption", "info", "Accept", "Ignore");
Of course, the number of languages ​​used is not limited.

Questions ?
Ask in topic


Sorry for my bad english
Reply
#2

Good job.
Reply
#3

Requests
Код HTML:
# include <ML>
and can do as a normal Filterscript?
Reply
#4

Of course.
Reply
#5

Example? Does it allow you to use russian characters etc? I don't really get this.
Reply
#6

Example script:

pawn Код:
#include <a_samp>
#include <ML>

new Text:TD;
public OnFilterScriptInit()
{
    TD = TextDrawCreate(200.0, 200.0, "???");
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, TD);
    ChooseLanguage(playerid);
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    LANGUAGE_ODR(playerid, dialogid, response, listitem);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/message", true) == 0)
    {
        LanguageMessage(playerid, -1, LANGUAGE_POLISH, "Cześć", LANGUAGE_ENGLISH, "Hi");
        return 1;
    }
    if(strcmp(cmdtext, "/gametext", true) == 0)
    {
        LanguageGameTextForPlayer(playerid, 5, 5000, LANGUAGE_POLISH, "TEST", LANGUAGE_ENGLISH, "test");
        return 1;
    }
    if(strcmp(cmdtext, "/textdraw", true) == 0)
    {
        LanguageTextDrawMessage(playerid, TD, LANGUAGE_POLISH, "PL", LANGUAGE_ENGLISH, "EN");
        return 1;
    }
    if(strcmp(cmdtext, "/dialog", true) == 0)
    {
        LanguageDialogForPlayer(playerid, 0, DIALOG_STYLE_MSGBOX, LANGUAGE_POLISH, "naglowek", "infoPL", "OK", "Anuluj", LANGUAGE_ENGLISH, "caption", "infoEN", "Accept", "Ignore");
        return 1;
    }
    return 0;
}
If SA-MP support russian language, my include support too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)