Jump to content

Recommended Posts

  • Active Member

quest chagne_name begin
	state start begin
		when 71055.use begin
			if pc.is_married() then
				say("You cannot change your name if you are married.")
				say("")
				return
			end

			if pc.is_polymorphed() then
				say("You cannot change your name if you are transformed.")
				say("")
				return
			end

			if pc.has_guild() then
				say("You cannot change your name if you are in a guild. ")
				say("")
				return
			end

			if party.is_party() then
				say("You cannot change your name if you are in a party.")
				say("")
				return
			end

			if pc.get_level() < 35 then
				say("You need level 35 to change your name!")
				say("")
				return
			end

			if get_time() < pc.getqf("next_time") then
				say("You can not use it now.")
				say("")

				if is_test_server() == true then
					say("Since it's test server, you can go")
					say("")
				else
					return
				end
			end

			say("Please enter the name you want to have") ;

			local name = pc.name ;
			local str = input() ;
			if string.len(str) > 16 then
				say("This name is too long. Please try again.")
				say("")
				return
				
			end
			local ret = pc.change_name(str) ;

			if ret == 0 then
				say("You didn't log in after you have changed your name.")
				say("please re-log in.")
				say("")

				char_log(0, "CHANGE_NAME", "HAVE NOT RE-LOGIN")
			elseif ret == 1 then
				say("The problem occured while using the item.")
				say("Please use again.")
				say("")
				
				char_log(0, "CHANGE_NAME", "ITEM USE PROBLEM")
			elseif ret == 2 then
				say("The name is not available.")
				say("Please enter other name.")
				say("")

				char_log(0, "CHANGE_NAME", "CAN NOT USE NAME")
			elseif ret == 3 then
				say("The name is not available.")
				say("Please enter other name.")
				say("")

				char_log(0, "CHANGE_NAME", "ALREADY USING NAME")
			elseif ret == 4 then
				say("You have changed your name successfully.")
				say("Please log in again.")
				say("")

				item.remove() ;

				pc.setqf("next_time", get_time() + time_hour_to_sec(24*15))

				char_log(0, "CHANGE_NAME", "SUCCESS: from "..name.." to "..str)
			else
				say("Unknown error occured.")
				say("")

				char_log(0, "CHANGE_NAME", "UNKNOWN NAME")
			end
		end
	end
end

But doesnt open why I dont understand really
 

Link to comment
https://metin2.dev/topic/32899-change_name-problem/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.