MultiLanguage System [ENG/BALKAN]
#1

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(playeridcolorleng[], lbal[])//sending language messages with the simplified way.
{
    switch(
GetPlayerLanguage(playerid))
    {
         case 
ENG:SendClientMessage(playeridcolorleng);
         case 
BAL:SendClientMessage(playeridcolorlbal);
    }
    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(playeriddialogidresponselistiteminputtext[])
{
    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(playeridparams[])//just a test
{
    
SendLanguageMessage(playerid, -1"Help Center""Centar Za Pomoc");
    return 
1;

Reply
#2

i realeased an include for multilanguages
just use the search
Reply
#3

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

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
Reply
#5

Your Link with the Language.rar is down.
Reply
#6

yep ill update it with autosave so he dont need to rechange it.
wait a hour and iam done and update my inc
Reply
#7

Sure.....
Reply
#8

Still nothing...help?
Reply
#9

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)
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)