[Include] [INC] Multi-Lingual 1.0
#1



This include is very useful for international and multi-lingual servers.
In version 1.0 it's possible to script with up to 2 languages easily.
Avaible Functions:
  • » ClientLanguageText(playerid, color, const message0[], const message1[]);
    » ClientLanguageTextToAll(color, const message0[], const message1[]);
    » GameLanguageText(playerid, const message0[], const message1[], time, style);
    » GameLanguageTextToAll(const message0[], const message1[], time, style);
    » SetPlayerLanguage(playerid, language);

Examples:

ClientLanguageText:
Code:
public OnPlayerSpawn(playerid)
{
	ClientLanguageText(playerid, YELLOW, "This is an english text!", "Das ist ein deutscher Text!");
	return 1;
}
ClientLanguageTextToAll:
Code:
public OnPlayerSpawn(playerid)
{
	ClientLanguageTextToAll(YELLOW, "Text for all english people!", "Text fьr alle deutschen Leute!");
	return 1;
}
GameLanguageText:
Code:
public OnPlayerSpawn(playerid)
{
	GameLanguageText(playerid, "This is an english text!", "Das ist ein deutscher Text!", 5000, 3);
	return 1;
}
GameLanguageTextToAll:
Code:
public OnPlayerSpawn(playerid)
{
	GameLanguageTextToAll(playerid, "Text for all english people!", "Text fьr alle deutschen Leute!", 5000, 3);
	return 1;
}
SetPlayerLanguage:
Code:
public OnPlayerSpawn(playerid)
{
	SetPlayerLanguage(playerid, 0); // 0 for the first language, 1 for the second language
	return 1;
}
Selfmade Codes | Tested Successfully




Please, only use it with Credits to the San Andreas Script Crew
Reply
#2

Isn't there a more creative way to make it really Multi-Lingual? coz 2 isn't really "Multi"

its nicely coded though ( i like allman, not that: i need to resize my 500 line script to 75 line piece of shit
Reply
#3

I'm thinking of how it could work. I'm thinking of a command like UseLanguages(number of languages); which could be under OnGameModeInit.
But I don't know at the moment.

Or I release more scripts like:

Downloads:
2 languages
3 languages
4 languages
5 languages
...
Reply
#4

I've done such a Multi-Lang System too, it works with .lang Files and a Function like "SendLanguageMessage(playerid, ..., langid)". langid is the string of the message. The files look like:

Code:
// Lang File English
hellomsg1=blabla
hellomsg2=blabla
You might look up the script, it's inside of my cancelled [no advert]project GTA Nightlife.[/no advert]

Nice script BTW.

MfG
Recycler
Reply
#5

That's nice and a good idea, Recycler, but the include was to add easily a new languages.
And I think yours would be to difficult for newbie scripters.
Reply
#6

Quote:
Originally Posted by MrMaccaroni
That's nice and a good idea, Recycler, but the include was to add easily a new languages.
You're right, it's a nasty work to replace all SendClientMessage's with the new syntax of the language function.

It's just much more easier to add x-Languages, cuz you only have to create a new file named "language.lang" and translate your msg's :P

MfG
Recycler
Reply
#7

If you are using a loop you can have unlimited languages, also thx for the idea for my gm
Reply
#8

Thanks, Wadabak, I could try this.

I've got an idea how it could work, but I'll update this later :P
Reply
#9

What with the function GetPlayerLanguage?
Reply
#10

This is nice, i like it. i have been looking for something like this, and not had time to use it myself
ive been using...

pawn Code:
if(PlayerLanguage[playerid][Nowegian] == 1)
{
   SendClientMessage.//bla/bla/bla
}
if(PlayerLanguage[playerid][German] == 1)
{
   SendClientMessage.//bla/bla/bla
}
return 1;
}
I would suggest to add more languages in.
make it support like 5 languages. Shouldnt be hard, to do
Good work.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)