Jump to content
  • 0

Language selection for NPC dialogue


AsuraBro

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  74
  • Reputation:   3
  • Joined:  07/12/14
  • Last Seen:  

.@result = query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `group_id` > 0 ) ORDER BY RAND() LIMIT 1",.@aid,.@name$ );

thank you

.@result = query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `group_id` > 0 ) ORDER BY RAND() LIMIT 1",.@aid,.@name$ );

i know i'm asking a lot but, there is

if (#language == 1) {
English text
} else {
text
}

i want the text to appear on the player language not my language.

it always will do the announce on my language not the player selected one.

 

ref to https://rathena.org/board/topic/93969-language-system/?p=251072

Edited by AsuraBro
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   35
  • Joined:  12/18/14
  • Last Seen:  

You want the player's language to be shown instead of your own language?

Then you should set an NPC where they can choose which language they want to see in most NPCs.
 

At the link you have given, El Dragon has explained it completely and in full detail of how to use it, if you want something to be added to it, please explain in detail so we can help out.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  74
  • Reputation:   3
  • Joined:  07/12/14
  • Last Seen:  

You want the player's language to be shown instead of your own language?

Then you should set an NPC where they can choose which language they want to see in most NPCs.

 

At the link you have given, El Dragon has explained it completely and in full detail of how to use it, if you want something to be added to it, please explain in detail so we can help out.

this is my both scripts

 

this is El Dragon language system

prontera,148,52,5	script	Language Changer::trans	 412,{
mes "[Translator]";
mes " * Please choose a language";
mes " * الرجاء إختيار لغة";
next;
menu "العربية",-,"English",L_En;
  set #language,0;
  next;
  mes "[المترجم]";
  mes ".شكرا";
  mes "أستمتع ببقائك في راجناروك !.";
  close;
L_En:
  set #language,1;
  next;
  mes "[Translator]";
  mes "Thank you.";
  mes "Have fun on ??? Ro.";
  close;
}

-	script	LanguageChanger	 1,{
OnPCLoginEvent:
if(!#Translated) {
set #Translated, 1;
mes "[Translator]";
mes " * Please choose a language";
mes " * الرجاء إختيار لغة";
next;
menu "العربية",-,"English",L_En;
  set #language,0;
  next;
  mes "[المترجم]";
  mes ".شكرا";
  mes "أستمتع ببقائك في راجناروك !.";
  close;
L_En:
  set #language,1;
  next;
  mes "[Translator]";
  mes "Thank you.";
  mes "Have fun on RO";
  mes "You can still change";
  mes "the language from the old man";
  mes "called Language Changer.";
  close;
}
end;
}

new_1-1,65,108,4	duplicate(trans)	Language Changer	412

this is the event

-	script	Sample	-1,{
OnWhisperGlobal:	if( getgmlevel() < 98 ) end;	// only gm >= 99 can talk
	mes "There is currently ^ff0000"+ getusers(1) +"^000000 player(s) online.";
	mes "You can add an item to all player, except whose on vending or chatting mode.";
	next;
	if( select( "Send an item ID", "Leave" ) -1 ) close;
	mes "Input item ID.";
	input .@item_id;
	mes "The item you selected is " + getitemname( .@item_id );
	input .@amount;
	mes "You will Give " + .@amount + "x " + getitemname( .@item_id );
	mes "Please wait until the event is done.";
	mes "OR use @refresh ";
	if( getitemname( .@item_id ) == "null" || .@amount < 1 ){
		mes "Enter valid item id and amount.";
		close;
	}
	set .@item_name$, getitemname( .@item_id );
	set .@gm_name$, strcharinfo(0);
	do{
			.@result = query_sql( "SELECT `account_id`,`name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `group_id` > 0 ) ORDER BY RAND() LIMIT 1",.@aid,.@name$ );
		} while( .@result && ( checkvending( .@name$ ) || checkchatting( .@name$ ) ) );
		
		if ( .@result ) {
		
if (#language == 1) {
	announce "Lottery Manager: ENGLISH TEXT ! ",0;
	sleep2 07555;
	announce "Lottery Manager: In 5 seconds we will announce the winner ! ",0;
	sleep2 07555;
	announce "Lottery Manager: Starting from NOW ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 5 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 4 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 3 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 2 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 1 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: Player "+ rid2name(.@aid) + " has WON the lottery and has benn rewarded " + .@amount + "x " + getitemname( .@item_id ),0;
	message rid2name( .@aid ), "You have won the lottery " +". The prize is "+ .@item_name$ +".";
		} else {
	announce "Lottery Manager: ARABIC TEXT ! ",0;
	sleep2 07555;
	announce "Lottery Manager: In 5 seconds we will announce the winner ! ",0;
	sleep2 07555;
	announce "Lottery Manager: Starting from NOW ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 5 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 4 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 3 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 2 ! ",0;
	sleep2 01250;
	announce "Lottery Manager: 1 ! ",0;
	sleep2 01250;
	announce .@amount + " x " + getitemname(.@item_id)+ " على " + rid2name(.@aid) + " حصل اللاعب ",0;
	message rid2name( .@aid ), "You have won the lottery " +". The prize is "+ .@item_name$ +".";
		}
			getitem .@item_id, .@amount, .@aid;
		}
		set .@loop, .@loop +1;
	mes "Done.";
	close;
		end;
	} 

i have tested in this picture

 

6635ba23c2.jpg

 

they both gets English text because i have it selected on the GM who started the event, also if i changed it to arabic in the GM it will display ARABIC TEXT for both player and gm.

 

what i want is, make announce change with the player selected language, not event starter language.

 

ex.

Player have is selected Arabic the announce display "ARABIC TEXT ! " for him and other who have English display "ENGLISH TEXT ! " for him.

and the GM who started the event can have it on any language selected and wont affect the players.

Edited by AsuraBro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  452
  • Reputation:   35
  • Joined:  12/18/14
  • Last Seen:  

I think you will have to do a source edit with that kind of setting. But you might want to wait for the scripting masters to see if they can do something like that.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  74
  • Reputation:   3
  • Joined:  07/12/14
  • Last Seen:  

I think you will have to do a source edit with that kind of setting. But you might want to wait for the scripting masters to see if they can do something like that.

well if it's source editing i'm going to leave as it is, i really don't know much on scripting.

 

im sure that there is a way around it.

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...