No your GetLocalizedMessage does nothing else then "translate" the hello in the language you specify.
There is a way to send a message to a player in his language.
The Player object contends a method called LanguageName()
so for remoteplayer you can use:
Code:
foreach (Player pl in GamePlay.gpRemotePlayers())
{
if (pl.LanguageName().Equals("de"))
{
GamePlay.gpHUDLogCenter(new Player[]{pl}, "Hallo", null);
}
else if (pl.LanguageName().Equals("ru"))
{
GamePlay.gpHUDLogCenter(new Player[] { pl }, "Привет!", null);
}
else GamePlay.gpHUDLogCenter(new Player[] { pl }, "Hello", null);
}
Will integrate this in my script tomoro, now its time to relax
@all
can you please test your language Version with:
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
GamePlay.gpLogServer(null, "\n\nYour language: {0}\n\n", new object[] { player.LanguageName() });
}
}
german is "de" (tested myself)
english is "en" (not tested)
russian is "ru" (not tested)
so can anyone with this language version check this for me?
But i think the best is to add a option to
private void sendChatMessageTo(int army, string playerlanguage, string msg, object[] parms)
so it will be possible to use
sendChatMessageTo(1, "en", "Hello", null);
so it will send it only to the red players with english language version.
Tomorow