XML multi language
#1

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)