17.12.2011, 16:39
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:
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;
}