SA-MP Forums Archive
[Include] [INC] Multi-Lingual 1.0 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] Multi-Lingual 1.0 (/showthread.php?tid=50219)



[INC] Multi-Lingual 1.0 - MrMaccaroni - 09.09.2008



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:
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



Re: [INC] Multi-Lingual 1.0 - boemeles - 09.09.2008

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


Re: [INC] Multi-Lingual 1.0 - MrMaccaroni - 09.09.2008

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
...


Re: [INC] Multi-Lingual 1.0 - Recycler - 09.09.2008

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


Re: [INC] Multi-Lingual 1.0 - MrMaccaroni - 09.09.2008

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.


Re: [INC] Multi-Lingual 1.0 - Recycler - 09.09.2008

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


Re: [INC] Multi-Lingual 1.0 - Antironix - 09.09.2008

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


Re: [INC] Multi-Lingual 1.0 - MrMaccaroni - 09.09.2008

Thanks, Wadabak, I could try this.

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


Re: [INC] Multi-Lingual 1.0 - asdfgh98 - 31.12.2009

What with the function GetPlayerLanguage?


Re: [INC] Multi-Lingual 1.0 - aspire5630 - 31.12.2009

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.