Jump to content

[string.format()]fail


Go to solution Solved by metin2team,

Recommended Posts

  • Honorable Member

Hello everyone, 

 

I've got problems with string.format, it don't work, and i can't explain why.

 

an example:

 

Quest: http://puu.sh/8NYD8.quest

 

Fail screen: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

 

Why?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Dislove 2
  • Good 2
  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/1257-stringformatfail/
Share on other sites

Your String is correct but i have no idea why is not works...

 

 

test this;

 --[[quest guild_ranking 2006
riscritta decentemente da nabbhacker per newage2]]

quest guild_ranking begin
	state start begin
		when 11000.chat."Andamento della tua Gilda" or 11002.chat."Andamento della tua Gilda" or 11004.chat."Andamento della tua Gilda" begin
		local name = mob_name(npc.get_race())..":"
			say_title(name)
			say("Classifica:[DELAY value;0]"); 
			say(" |  Nome  | Punti |  Vit.  | Sconfitte   |  Pareggi  "); 
			say(guild.around_ranking_string().."[/DELAY]")
			wait()
			say_title(name)
			say("Prestazioni della tua Gilda ed informazioni:[ENTER]")
			
			--don't work begin
			--[[
			say(string.format("Nome Gilda:%s ;", guild.get_name()))
			say(string.format("Livello:%d ;", guild.get_level()))
			say(string.format("Numero Membri:%d ;", guild.get_member_count()))
			say(string.format("Guerre Combattute:%d: ;", guild.get_any_war()))
			say(string.format("Posizione Classifica:%d ;", guild.get_rank()))
			]]
			say("Nome Gilda: "..guild.get_name().."")
			say("Livello: "..guild.get_level().."")
			say("Numero Membri: "..guild.get_member_count().."")
			say("Guerre Combattute: "..guild.get_any_war().."")
			say("Posizione Classifica: "..guild.get_rank().."")
			--don't work end
		end	-- when
		

		when 11000.chat."Andamento Top Gilde" or 11002.chat."Andamento Top Gilde" or 11004.chat."Andamento Top Gilde" begin
		local name = mob_name(npc.get_race())..":"
			say_title(name)
			say("Classifica:[DELAY value;0]");
			say(" |  Nome  | Punti |  Vit.  | Sconfitte   |  Pareggi  "); 
			say(guild.high_ranking_string().."[/DELAY]")
		end -- when
	end -- state
end -- quest
  • Love 1
Link to comment
https://metin2.dev/topic/1257-stringformatfail/#findComment-9256
Share on other sites

  • Honorable Member

 

Your String is correct but i have no idea why is not works...

 

 

test this;

 --[[quest guild_ranking 2006
riscritta decentemente da nabbhacker per newage2]]

quest guild_ranking begin
	state start begin
		when 11000.chat."Andamento della tua Gilda" or 11002.chat."Andamento della tua Gilda" or 11004.chat."Andamento della tua Gilda" begin
		local name = mob_name(npc.get_race())..":"
			say_title(name)
			say("Classifica:[DELAY value;0]"); 
			say(" |  Nome  | Punti |  Vit.  | Sconfitte   |  Pareggi  "); 
			say(guild.around_ranking_string().."[/DELAY]")
			wait()
			say_title(name)
			say("Prestazioni della tua Gilda ed informazioni:[ENTER]")
			
			--don't work begin
			--[[
			say(string.format("Nome Gilda:%s ;", guild.get_name()))
			say(string.format("Livello:%d ;", guild.get_level()))
			say(string.format("Numero Membri:%d ;", guild.get_member_count()))
			say(string.format("Guerre Combattute:%d: ;", guild.get_any_war()))
			say(string.format("Posizione Classifica:%d ;", guild.get_rank()))
			]]
			say("Nome Gilda: "..guild.get_name().."")
			say("Livello: "..guild.get_level().."")
			say("Numero Membri: "..guild.get_member_count().."")
			say("Guerre Combattute: "..guild.get_any_war().."")
			say("Posizione Classifica: "..guild.get_rank().."")
			--don't work end
		end	-- when
		

		when 11000.chat."Andamento Top Gilde" or 11002.chat."Andamento Top Gilde" or 11004.chat."Andamento Top Gilde" begin
		local name = mob_name(npc.get_race())..":"
			say_title(name)
			say("Classifica:[DELAY value;0]");
			say(" |  Nome  | Punti |  Vit.  | Sconfitte   |  Pareggi  "); 
			say(guild.high_ranking_string().."[/DELAY]")
		end -- when
	end -- state
end -- quest

already tested it, same result.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/1257-stringformatfail/#findComment-9257
Share on other sites

  • Honorable Member

Thank guys, it works, i forgot to put pc.get_guild() inside guild.get_name().

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/1257-stringformatfail/#findComment-9264
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.