Jump to content

[CLOSED]Error: Excepting "when" or "function"


Go to solution Solved by NoFr1ends,

Recommended Posts

Hello. I have a problem when i try to close my server. Yesterday i tryed to install a quest but I received this error:

ef8d0ca5ee16ced6fb4bbba31b8c589d.png

This is the quest that i wanted to install when i received core dumped.

quest welcome begin
state start begin	
when login begin
if pc.getqf("metin2")== 0 then	
pc.setqf( "metin2", 1)
if pc.job == 0 then
pc.give_item2(19,1)
pc.give_item2(11209,1)
pc.give_item2(12209,1)
elseif pc.job == 1 then
pc.give_item2(1009,1)
pc.give_item2(11409,1)
pc.give_item2(12349,1)
elseif pc.job == 2 then
pc.give_item2(19,1)
pc.give_item2(11609,1)
pc.give_item2(12489,1)
elseif pc.job == 3 then
pc.give_item2(7009,1)
pc.give_item2(11809,1)
pc.give_item2(12620,1)
end
pc.change_money(50000)
pc.give_item2(13009,1)
pc.give_item2(14009,1)
pc.give_item2(15009,1)
pc.give_item2(16009,1)
pc.give_item2(17009,1)
pc.give_item2(50051,1)

horse.advance()
horse.ride()
pc.change_alignment(500)
pc.give_item2(50187,1)

syschat("Bine aþi venit pe "..settings.server_name..".")
complete_quest()
end
end	
state __COMPLETE__ begin
end	-- state
end -- state
end -- begin

Resolved. A moderator can close the topic xD

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/493-closederror-excepting-when-or-function/
Share on other sites

You have a state in a state.

Just add one end after line 39 and remove one in live 43.

 

Kind regards

Chuck

The quest resolved now but, i still can`t close my server using sh close.sh . It says kill : no such process

syserr from ch1 core1 : SYSERR: Mar 16 14:48:00 :: socket_connect: HOST IP :65012, could not connect.

SYSERR: Mar 16 14:48:01 :: socket_connect: HOST IP :65011, could not connect.
SYSERR: Mar 16 14:48:02 :: socket_connect: HOST IP .:65010, could not connect.
SYSERR: Mar 16 14:48:03 :: socket_connect: HOST IP :65012, could not connect.
Where is writed IP on the syserr is the ip from my dedicat.

That you have a problem with closing your server is not caused by the quest.

Your close.sh tries to kill the wrong process which is not running.

 

Regards

 

P.S: Because of the "socket_connect" error I think it will close your db core but not the game cores.

  • Love 1

That you have a problem with closing your server is not caused by the quest.

Your close.sh tries to kill the wrong process which is not running.

 

Regards

 

P.S: Because of the "socket_connect" error I think it will close your db core but not the game cores.

Ok then, what i need to do to fix it?

quest welcome begin
	state start begin
		when login begin
			if(pc.getqf("metin2") == 0) then
				pc.setqf("metin2",1)
				if(pc.job == 0) then
					pc.give_item2(19,1)
					pc.give_item2(11209,1)
					pc.give_item2(12209,1)
				elseif(pc.job == 1) then
					pc.give_item2(1009,1)
					pc.give_item2(11409,1)
					pc.give_item2(12349,1)
				elseif(pc.job == 2) then
					pc.give_item2(19,1)
					pc.give_item2(11609,1)
					pc.give_item2(12489,1)
				elseif(pc.job == 3) then
					pc.give_item2(7009,1)
					pc.give_item2(11809,1)
					pc.give_item2(12620,1)
				end
				pc.change_money(50000)
				pc.give_item2(13009,1)
				pc.give_item2(14009,1)
				pc.give_item2(15009,1)
				pc.give_item2(16009,1)
				pc.give_item2(17009,1)
				pc.give_item2(50051,1)
				pc.give_item2(50187,1)
				pc.change_alignment(500)
				horse.advance()
				horse.ride()		
				syschat("Bine aþi venit pe "..settings.server_name)
				set_state(__COMPLETE__)
			end
		end
	end
	state __COMPLETE__ begin
	end
end

Try like this. (I test it. It's work)

 

Regards.

  • Love 1

Plain logic saves lives.

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.