[Include] [INC] Language System (nine languages support) - !No developer, no script!
#1

I'm still going to make version 2, but the question is when
Reply
#2

Och thanks.. i really needed it .
Reply
#3

Quote:
Originally Posted by Toney
Och thanks.. i really needed it .
Ty
Reply
#4

nice !!
good job.
Reply
#5

Quote:
Originally Posted by _Gangster_
nice !!
good job.
Thanks
Reply
#6

Veri nice man!
Reply
#7

Cool INCLUDE man i gone use it for my server
Reply
#8

I personally don't like it very much, it's neither very comfortable nor very efficient, sorry.
Reply
#9

This is really not efficient, try to code more efficiently.
Reply
#10

Quote:
Originally Posted by MaVe - leeturl.de
I personally don't like it very much, it's neither very comfortable nor very efficient, sorry.
Quote:
Originally Posted by Don Correlli
This is really not efficient, try to code more efficiently.
I know it's not so efficeint, but I scripted it in 20-30 mins.
I'll fix code in next version.
Reply
#11

Quote:
Originally Posted by MaVe - leeturl.de
I personally don't like it very much, it's neither very comfortable nor very efficient, sorry.
Sorry for double-posting, but I don't understand what you mean by that?
There is

SetPlayerLanguage
GetPlayerLanguage

so what's the problem?
Reply
#12

I think most people don't want to change the function parameters if they have like 1 more language to add, it's also not very comfortable to have 2 or even more strings all the time.
I suggest using something like a "text library part" in your gamemode with defines for all texts like

Код:
#define TXT_WELCOME_EN "Welcome to my server"
#define TXT_WELCOME_DE "Willkommen auf meinem Server"
and then do something like
pawn Код:
SendLanguageMessage(playerid, COLOR_GREEN, TXT_WELCOME); // without _DE, append that with a macro?
Reply
#13

Quote:
Originally Posted by MaVe - leeturl.de
I think most people don't want to change the function parameters if they have like 1 more language to add, it's also not very comfortable to have 2 or even more strings all the time.
I suggest using something like a "text library part" in your gamemode with defines for all texts like

Код:
#define TXT_WELCOME_EN "Welcome to my server"
#define TXT_WELCOME_DE "Willkommen auf meinem Server"
and then do something like
pawn Код:
SendLanguageMessage(playerid, COLOR_GREEN, TXT_WELCOME); // without _DE, append that with a macro?
Okay, thanks for suggestion. I'll maybe do v2 soon.
Reply
#14

Nice, useful script
Reply
#15

Quote:
Originally Posted by sstk (Шустрик)
Nice, useful script
Thanks, but it isn't so good. Like Mave - leeturl.de said, it's not so comfortable.
But I'll maybe make v2, I don't know.
Reply
#16

Try something like this?
pawn Код:
#define LANG_DE 1
#define LANG_EN 2

#define WELCOME_DE "Willkommen"
#define WELCOME_EN "Welcome"

#define SetLanguage(%1) \
    language = %1

#define GetLanguage() \
    language

#define PrintInLanguage(%1) \
    if (language == LANG_DE) \
      print(%1_DE); \
    else if (language == LANG_EN) \
      print(%1_EN)

new language = 0;

public OnFilterScriptInit()
{
    SetLanguage(LANG_DE);
    PrintInLanguage(WELCOME);
   
    SetLanguage(LANG_EN);
    PrintInLanguage(WELCOME);
    return 1;
}
Note: I've made it for console testing only, so just one language variable.
Reply
#17

How do i make a command now ??

i tryed this:
Код:
dcmd_racetrack(playerid, params[])
{
  #pragma unused params
  if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  {
  SetVehicleVirtualWorld(playerid, 0);
  SetVehiclePos(GetPlayerVehicleID(playerid), 554.0462,-2840.1121,7.4550+5);
  }
  else
  {
  new pname[MAX_PLAYER_NAME], string1[256], string2[256];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string1, sizeof(string1), "%s has Teleported to /racetrack.", pname);
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string2, sizeof(string2), "%s Is naar /racetrack geteleporteert", pname);
  SendLanguageMessageToAll(COLOR_DARKGREEN,string1,string2);
  }
  return 1;
}
i got 2 languages

Код:
#define Englisch 0
#define Dutch 1
but i send nothing in the chat :S pls help !!!
Reply
#18

Quote:
Originally Posted by shotyoudie
How do i make a command now ??

i tryed this:
Код:
dcmd_racetrack(playerid, params[])
{
  #pragma unused params
  if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  {
  SetVehicleVirtualWorld(playerid, 0);
  SetVehiclePos(GetPlayerVehicleID(playerid), 554.0462,-2840.1121,7.4550+5);
  }
  else
  {
  new pname[MAX_PLAYER_NAME], string1[256], string2[256];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string1, sizeof(string1), "%s has Teleported to /racetrack.", pname);
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string2, sizeof(string2), "%s Is naar /racetrack geteleporteert", pname);
  SendLanguageMessageToAll(COLOR_DARKGREEN,string1,string2);
  }
  return 1;
}
i got 2 languages

Код:
#define Englisch 0
#define Dutch 1
but i send nothing in the chat :S pls help !!!
Did you set player's language? (SetPlayerLanguage).
Try this

pawn Код:
public OnPlayerConnect(playerid)
{
     SetPlayerLanguage(playerid, Dutch);
     return 1;
}
Now the command code:
pawn Код:
dcmd_racetrack(playerid, params[])
{
    #pragma unused params

    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
       SetVehicleVirtualWorld(playerid, 0);
       SetVehiclePos(GetPlayerVehicleID(playerid), 554.0462,-2840.1121,7.4550+5);
    }
    else
    {
        new pname[MAX_PLAYER_NAME], string1[256], string2[256];
        GetPlayerName(playerid, pname, sizeof(pname));

        format(string1, sizeof(string1), "%s has teleported to /racketrack.", pname);
        format(string2, sizeof(string2), "%s Is naar /racketrack geteleporteert", pname),
 
        SendLanguageMessageToAll(COLOR_DARKGREEN,string1,string2);
     }
     return 1;
}
It should send message in Dutch.
You can make language choose menu for player when he connect.
Reply
#19

I have a dialog that pops up if you join the server

Код:
OnPlayerConnect:
ShowPlayerDialog(playerid,212, DIALOG_STYLE_LIST,"Select your language:","1\tEnglisch\n2\tDutch","Select","Cancel");

OnDialogResponse:
}
  if(dialogid == 212 && response == 1)
  {
  if(listitem == 0)
  {
  SetPlayerLanguage(playerid, Englisch);
  SendClientMessage(playerid, COLOR_YELLOW, "Your language is set to Englisch");
  }
  if(listitem == 1)
  {
  SetPlayerLanguage(playerid, Dutch);
  SendClientMessage(playerid, COLOR_YELLOW, "Je taal is gezet op Nederlands");
  }
  return 1;
  }
  return 0;
}
either the messages that comes when someone joins arent working 2 and that just copied of you mainpost :O

And that still not working

gratz shotyoudie


Reply
#20

Hmmm.. it was working fine for me.
Now try this

pawn Код:
dcmd_racetrack(playerid, params[])
{
  #pragma unused params
  if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  {
      SetVehicleVirtualWorld(playerid, 0);
      SetVehiclePos(GetPlayerVehicleID(playerid), 554.0462,-2840.1121,7.4550+5);
  }
  else
  {
      new pname[MAX_PLAYER_NAME], string1[256], string2[256];
      GetPlayerName(playerid, pname, sizeof(pname));
     
      format(string1, sizeof(string1), "%s has Teleported to /racetrack.", pname);
      format(string2, sizeof(string2), "%s Is naar /racetrack geteleporteert", pname);
     
      for(new i; i < MAX_PLAYERS < i++;) SendLanguageMessage(i, COLOR_DARKGREEN, string1, string2);
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)