XML multi language - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: XML multi language (
/showthread.php?tid=203236)
XML multi language -
armyoftwo - 26.12.2010
pawn Код:
stock SM(playerid, COLOR, LINEID[])
{
new File[48];
new MyLanguage[24];
GetPVarString(playerid, "Language", MyLanguage, 24);
format(File, sizeof(File), "Languages/%s.xml", MyLanguage);
new XML:xml = xml_open(File);
if(xml)
{
new Message[128];
xml_get_string(xml, LINEID, Message, 128);
SendClientMessage(playerid, COLOR, Message);
xml_close(xml);
}
}
I have this and the code works.
for example
pawn Код:
SM(playerid, YELLOW, "WELCOME_MESSAGE");
Код:
<WELCOME_MESSAGE>Welcome to my server!</WELCOME_MESSAGE>
But how can i read for example formatted messages?
pawn Код:
SM(playerid, YELLOW, "WELCOME_MESSAGE", PlayerName);
Код:
<WELCOME_MESSAGE>Welcome %s to my server</WELCOME_MESSAGE>
Any ideas? Or any hint?