Jump to content
  • 0

Language Change NPC


ZelosAvalon

Question


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

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;
    }
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  491
  • Reputation:   19
  • Joined:  11/19/11
  • Last Seen:  

excute mysql table

and add this script for your server npc

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  181
  • Reputation:   33
  • Joined:  11/11/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

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.

Link to comment
Share on other sites

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.

×
×
  • Create New...