MultiLanguage System [ENG/BALKAN] -
Mrki_Drakula - 17.12.2011
Hello Everyone.
Well, I'm a bit stucked with this...
I'd appreciate any help you can give me.
This is my problem. I think i did everything correctly, but check it out. I'm trying to make multilanguage system, which I made...but, i have no idea how to save this variable into ini file with y_ini. Can you help me? I'd appreciate any help. Thanks in advance. Here's my code so far:
PHP код:
#include <a_samp>//include1
#include <ZCMD>//include2
#define DIALOG_LANGUAGE 1 //dialog for choosing the language
#define ENG 0 //english language
#define BAL 1//balkan language
new pLanguage[MAX_PLAYERS char];//variable that needs to be saved
stock SendLanguageMessage(playerid, color, leng[], lbal[])//sending language messages with the simplified way.
{
switch(GetPlayerLanguage(playerid))
{
case ENG:SendClientMessage(playerid, color, leng);
case BAL:SendClientMessage(playerid, color, lbal);
}
return 1;
}
stock GetPlayerLanguage(playerid)
{
return pLanguage{playerid};
}
public OnPlayerConnect(playerid)
{
pLanguage{playerid} = ENG;
//code..bla bla
ShowPlayerDialog(playerid,DIALOG_LANGUAGE,DIALOG_STYLE_MSGBOX,"Language","Please choose your Language!","English","Balkan");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_LANGUAGE: {
switch(response) {
case 0: {
SendClientMessage(playerid, -1, "You selected the English(ENG) language, now messages will be written in English");
pLanguage{playerid} = ENG;
return 1;
}
case 1: {
SendClientMessage(playerid, -1, "Izabrao si Balkanski(BAL) jezik, tvoje poruke ce sada biti na Balkanskom.");
pLanguage{playerid} = BAL;
return 1;
}
}
return 1;
}
}
return 1;
}
CMD:help(playerid, params[])//just a test
{
SendLanguageMessage(playerid, -1, "Help Center", "Centar Za Pomoc");
return 1;
}
Re: MultiLanguage System [ENG/BALKAN] -
Tigerkiller - 17.12.2011
i realeased an include for multilanguages
just use the search
Re: MultiLanguage System [ENG/BALKAN] -
Mrki_Drakula - 17.12.2011
Yeah i know, but i don't know does it saves player language, do player need to choose his language every time he enters the server?
Re: MultiLanguage System [ENG/BALKAN] -
Tigerkiller - 17.12.2011
yep he need
Link:
http://forum.sa-mp.com/showthread.ph...nguage+include
but DL are broken, wait a hour so i can fix the download link because iam online with phone
Re: MultiLanguage System [ENG/BALKAN] -
Mrki_Drakula - 17.12.2011
Your Link with the Language.rar is down.
Re: MultiLanguage System [ENG/BALKAN] -
Tigerkiller - 17.12.2011
yep ill update it with autosave so he dont need to rechange it.
wait a hour and iam done and update my inc
Re: MultiLanguage System [ENG/BALKAN] -
Mrki_Drakula - 17.12.2011
Sure.....
Re: MultiLanguage System [ENG/BALKAN] -
Mrki_Drakula - 17.12.2011
Still nothing...help?
Re: MultiLanguage System [ENG/BALKAN] -
PlayHard - 17.12.2011
Do you have a registering system? Yes? I suggest you to use an enum for this,
I'll script an enum for you ( Using Y_INI ). --- BRB (went to script it :P)
Re: MultiLanguage System [ENG/BALKAN] -
Mrki_Drakula - 17.12.2011
Yes, i already got register system, i just dont know how to save that variable, like pLanguage is English so: pLanguage{playerid} = ENG; and now i want to save it into ini file. I have no idea how to save it, neither to load it.
I dont know how to check what is player language, i mean what is proper use for GetPlayerLanguage - i mean If(GetPlayerLanguage(playerid) == ENG) or what?