Jump to content

Recommended Posts

  • Management

Hi guys

 

I'm here with a problem.

 

I'm creating the gm painel for my server, and the option "other event" has to option to choise, pvm and pvp.

 

When the GM activate the event, need to insert the coordinates for the teleporter, and the coordinates is saved in the table called eventos, on db player (player.eventos).

 

The teleporter goes to the table seach for x and y coordinates, something like this:

				local x = mysql_query("SELECT x FROM player.eventos WHERE tipo='pvm'")
				local y = mysql_query("SELECT y FROM player.eventos WHERE tipo='pvm'")	

and the warp is like this:

					pc.warp("..x..", "..y..")

the teleporter is like this:

		when 10682.click begin
			if game.get_event_flag("evento_pvm") == 1 then
				local x = mysql_query("SELECT x FROM eventos WHERE tipo='pvm'")
				local y = mysql_query("SELECT y FROM eventos WHERE tipo='pvm'")			
				local pvm = select ("Participar", "Cancelar")
				if pvm == 1 then
					pc.warp("..x..", "..y..")
				elseif pvm == 2 then
					return
				end
			end

but this isn't teleporting, when I select "Participar" dosen't do nothing, but if I put the coordinates directly in the quest (6843400, 999900) this teleports, the table has the coordinates with the 00.

 

someone can help me with this problem?

 

Thanks everyone

raw

raw

Link to comment
https://metin2.dev/topic/2287-problem-with-warp/
Share on other sites

  • Management

 

change this

pc.warp("..x..", "..y..")

on

pc.warp(x, y)

 

dosen't work :S

		when 10682.click begin
			if game.get_event_flag("evento_pvm") == 1 then
				local x = mysql_query("SELECT x FROM player.eventos WHERE tipo='pvm'")
				local y = mysql_query("SELECT y FROM player.eventos WHERE tipo='pvm'")			
				local pvm = select ("Participar PvM", "Cancelar")
				if pvm == 1 then
					pc.warp(x, y)
				elseif pvm == 2 then
					return
				end
			end
		end

raw

raw

Link to comment
https://metin2.dev/topic/2287-problem-with-warp/#findComment-15942
Share on other sites

  • Management

pc.warp(x.x[1], y.y[1])

 

#Solved

 

Thank you very much, now is working!

 

Just one more question:

 

To set the minimun lvl how can I do?

 

I have this:

			if game.get_event_flag("evento_pvm") == 1 then
				local x = mysql_query("SELECT x FROM player.eventos WHERE tipo='pvm'")
				local y = mysql_query("SELECT y FROM player.eventos WHERE tipo='pvm'")	
				local lvl = mysql_query("SELECT lvl FROM player.eventos WHERE tipo='pvm'")
				local pvm = select ("Participar PvM", "Cancelar")
				if pvm == 1 then
					pc.warp(x.x[1], y.y[1])
				elseif pvm == 2 then
					return
				end
			end

where I put the lvl verification?

 

Thanks

raw

raw

Link to comment
https://metin2.dev/topic/2287-problem-with-warp/#findComment-16060
Share on other sites

  • Management

but the minimum lvl is defined by the gm who activate the event, and before the npc go to te MySQL table and see what is the minimum lvl, like the my last post

thanks for your reply

raw

raw

Link to comment
https://metin2.dev/topic/2287-problem-with-warp/#findComment-16162
Share on other sites

1e340e81f1.png

 

I think thats the reply you're searching.

 

Kind Regards.

 

Akroma

 

PD: if you need exclusive events for your server in lua, add me to skype im not so expensive with that things.

 

magical3200

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

:D

Link to comment
https://metin2.dev/topic/2287-problem-with-warp/#findComment-16164
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.