Jump to content

Change name problem


Recommended Posts

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This is probably but I use two different quest but the error is same...
 

quest changename begin
state start begin
when 20355.chat."Chciałbym Zmienić Swój Nick " begin
say_title("Zmiana Nicku:")
say("")
say("Witaj,")
say("dzięki mnie możesz zmienić swój nick na stałe! ")
say("Wystarczy, że się zgodzisz !")
say("")
say_reward("Czy chciałbyś zmienić swój nick?")
say("")
local change = select("Tak", "Nie")
if change == 1 then
say_title("Zmiana Nicku:")
say("")
say("więc chcesz zmienić swój nick?")
say("Dobrze, tylko pamiętaj, że przyjaciele ")
say("mogą Cię nie rozpoznać pod tym nowym imieniem")
say("")
say_reward("Podaj swój nowy nick:")
say_reward("Nie możesz używać kodów ASCI!")
say("")
local c_name = input()
local c_search = find_pc_by_name(c_name)
 
if c_search==0 then 
say_title("Zmiana Nicku:")
say("")
say("Podałeś już swój nowy nick wygloąda on tak:")
say(""..c_name.." zostawić taki?")
say("")
local secure = select("Tak", "Nie")
if secure == 1 then
say_title("Zmiana Nicku:")
say("")
say("Pomyślnie Zmieniono Nick!")
say("")
say("Twoja nowa nazwa to: "..c_name.." ")
say("")
say_reward("Przeloguj się aby zaktualizować zmiany!")
say("")
a(c_name)
pc.remove_item(71055, 1)
else
say_title("Zmiana Nicku:")
say("")
say("Dobrze, że zmieniłeś zdanie...")
say("Twoja nazwa została nie zmieniona!")
say("")
end
else
say_title("Zmiana Nicku:")
say("")
say("Podana przez Ciebie nazwa nicku już jest zajęta!")
say("Wybierz sobie nowy inny nick i go podaj...")
say("")
end
else
return
end
end
end
end 


 
If the quest is wrong so I apologize for my unskilled... I'm not very experienced in this..

Link to comment
Share on other sites

  • Active Member

This quest is wrong. Use the original one.

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


Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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