Multilanguage help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Multilanguage help (
/showthread.php?tid=265908)
Multilanguage help -
YoUnG_MoNeY - 02.07.2011
Hello!
I want to make a multi language option in my server.I tryed many times but it isnt working properly.Can anyone please help me to script this ?
Thanks.
AW: Multilanguage help -
xerox8521 - 02.07.2011
What exactly doesnt working properly ? Any errors ? post them with script lines
Re: Multilanguage help -
YoUnG_MoNeY - 02.07.2011
no error.I used this FS
http://forum.sa-mp.com/showthread.ph...=Multilanguage
I made a setlang cmd, in which 3 langs ( Usage /setlang [laguage 1-3] )
when i type setlang 1 or 2 or 3 . language is not changing.When i type something , same thing will come in the chat
Re: Multilanguage help -
Ironboy - 02.07.2011
This will help you
https://sampforum.blast.hk/showthread.php?tid=259662
Re: Multilanguage help -
YoUnG_MoNeY - 02.07.2011
But i need russian language. How can i make russian lang?
Re: Multilanguage help -
Sasino97 - 02.07.2011
Starting of GM
pawn Код:
#define DIALOG_LANGUAGE 334
new Language[MAX_PLAYERS];
OnPlayerConnect
pawn Код:
ShowPlayerDialog(playerid, DIALOG_LANGUAGE, DIALOG_STYLE_LIST, "Select a Language", "English\nItaliano\nFranзaise\nDeutsch\nAnd on...
In the case of DIALOG_LANGUAGE under OnDialogResponse
pawn Код:
Language[playerid] = listitem;
Function
pawn Код:
SendMessage(playerid, color, english[], italian[], french[], german[]/*Add more if you want*/)
{
switch(Language[playerid])
{
case 0: SendClientMessage(playerid, color, english);
case 1: SendClientMessage(playerid, color, italian);
case 2: SendClientMessage(playerid, color, french);
case 3: SendClientMessage(playerid, color, german);
default: SendClientMessage(playerid, color, english); //else
}
return 1;
}
Untested code.
Re: Multilanguage help -
YoUnG_MoNeY - 02.07.2011
I did the same thing that shows in tut
but it shows these errors
pawn Код:
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\filterscripts\lang.pwn(33) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\filterscripts\lang.pwn(55) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
This is the code
pawn Код:
#include <a_samp>
#include <zcmd>
#define LANG_ENGLISH 0
#define LANG_GERMAN 1
// And so on, make sure you increase that number after the language, so 0, 1, 2, 3... It's the language id.
#define LANG_DIALOG 666 // Put any number here, but make sure there isn't same dialog ID anywhere in the script.
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerConnect(playerid)
{
ShowPlayerDialog( playerid, LANG_DIALOG, DIALOG_STYLE_LIST, "Pick your language", "English\nGerman", "Choose" ); // Shows the dialog to pick your language upon connecting...
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}
CMD:mylang( playerid, params[ ] ) {
if( GetPVarInt( playerid, "Language" ) == LANG_ENGLISH ) {
SendClientMessage( playerid, -1, "Your picked language is English. " );
}
else if( GetPVarInt( playerid, "Language" ) == LANG_GERMAN ) {
SendClientMessage( playerid, -1, "Ihre abgeholt Sprache ist Deutsch." ); // ****** again.
}
return 1;
}
public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) {
if( dialogid == LANG_DIALOG ) {
if( !response )
return ShowPlayerDialog( playerid, LANG_DIALOG, DIALOG_STYLE_LIST, "Pick your language", "English\nGerman", "Choose" ); // So he can't exit the dialog without choosing the language.
if( listitem == 0 ) { // If you picked English...
SetPVarInt( playerid, "Language", LANG_ENGLISH ); // Sets your language to English.
SendClientMessage( playerid, -1, "You have choosen English as your language!" );
}
if( listitem == 1 ) { // If you picked German...
SetPVarInt( playerid, "Language", LANG_GERMAN ); // Sets your language to German.
SendClientMessage( playerid, -1, "Sie haben ausgewдhlt Deutsch als Ihre Sprache!" ); // Translated with ****** Translate :p...
}
}
return 1;
}
Re: Multilanguage help -
YoUnG_MoNeY - 02.07.2011
Please help