Jump to content
  • 0

Language Change NPC


Question

Posted

can some one help me with this script ?

Spoiler

prt_in,290,137,6    script    Tradutor    768,{

/* Use this SQL table
CREATE TABLE IF NOT EXISTS `acc_lang` (
  `id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  `name` VARCHAR(30) NOT NULL DEFAULT '',
  `language` INT(11) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM;
*/

    mes "[Tradutor]";
    mes "Eu sou o Tradutor!";
    mes "I'm the Translator!";
    next;
    mes "Escolha sua linguagem:";
    mes "Choose your language:";
    switch(select("Português Brazil:English")) {
        case 1:
            query_sql "SELECT `language` FROM `acc_lang` WHERE `id` = '"+getcharid(0)+"'", .@language;
            if (.@language = 2)
                {
                    mes "Sorry, you already have the active English language!";
                    close;
                }
            else
                {
                    query_sql "UPDATE `acc_lang` SET `language` = '2' WHERE `id` = '"+getcharid(0)+"'";
                    mes "Ready, active english language!";
                    close;
                }
        case 2:
            query_sql "SELECT `language` FROM `acc_lang` WHERE `id` = '"+getcharid(0)+"'", .@language;
            if (.@language = 2)
                {
                    mes "Sorry, you already have the active English language!";
                    close;
                }
            else
                {
                    query_sql "UPDATE `acc_lang` SET `language` = '2' WHERE `id` = '"+getcharid(0)+"'";
                    mes "Ready, active english language!";
                    close;
                }
            
    }

}
prt_in,282,138,6    script    Teste    768,{

    query_sql "SELECT `language` FROM `acc_lang` WHERE `id` = '"+getcharid(0)+"'", .@language;
    if (.@language = 1){
        // if language English - language = 1
        mes "[Teste]";
        mes "Welcome ^3355FF"+strcharinfo(0)+"^000000";
        close;
    }
    else
    {
        //if language Português Brazil - language = 2
        mes "[Teste]";
        mes "Bem vindo ^3355FF"+strcharinfo(0)+"^000000";
        close;
    }
}

 

3 answers to this question

Recommended Posts

  • 0
Posted (edited)
On 22/02/2018 at 11:19 PM, Akbare said:

excute mysql table

and add this script for your server npc

what script ?

Edited by ZelosAvalon
miss words
  • 0
Posted

Well the one you gave in your first post. It contains in comment (/* [...] */ section) the sql command to execute on server's database, and the global script to include on your server.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...