SA-MP Forums Archive
language system - 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)
+--- Thread: language system (/showthread.php?tid=575135)



language system - OnelifeGaming - 24.05.2015

How to create language system ?


Re: language system - Sellize - 24.05.2015

PHP код:
new language[MAX_PLAYERS];

if(
language[playerid] == 1){ do something }
else if(
language[playerid] == 2){ do this 



Re: language system - KingHual - 24.05.2015

PHP код:
new language[MAX_PLAYERS][16];
if(!
strcmp(language[playerid], "packistani")) print("India > packIStan :PP");
else if(!
strcmp(language[playerid], "indion")) print("am Idia .. "); 



Re: language system - Beckett - 24.05.2015

Quote:
Originally Posted by KingHual
Посмотреть сообщение
PHP код:
new language[MAX_PLAYERS][16];
if(!
strcmp(language[playerid], "packistani")) print("India > packIStan :PP");
else if(!
strcmp(language[playerid], "india")) print("am Idia .. "); 
Packistan, ok.

OnTopic:

Create a variable which determines the player's language selected for example you show a dialog upon connecting to select the language player would like to view.

pawn Код:
new language[MAX_PLAYERS];
#define DIALOG_LANGUAGE 911

// Depends on where and when you want to show the dialog.
ShowPlayerDialog(playerid,DIALOG_LANGUAGE,DIALOG_STYLE_LIST,"English\nOtherLanguage\OtherLanguage","Select","Cancel");

// OnDialogResponse
switch(dialog_id)
{
    case DIALOG_LANGUAGE:
    {
        switch(listitem)
        {
            case 0:
            {
                language[playerid] = 1; // Let's say ID 1 language is English.
            }
            case 1:
            {
                language[playerid] = 2; // What language you want.
            }
            // and so on
        }
    }
}
// OnPlayerDoesSomething
switch(language)
{
    case 1:
    {
        SendClientMessage(playerid,-1,"Selected language English.");
    }
    case 2:
    {
        SendClientMessage(playerid,-1,"adsaidsaidsaidad");
    }
}
// Don't forget to reset the variable when the player disconnects.
public OnPlayerDisconnect(playerid, reason)
{
      language[playerid] = 0;
}



Re: language system - Yashas - 24.05.2015

https://sampforum.blast.hk/showthread.php?tid=573825

If you need more use http://forum.sa-mp.com/search.php