Jump to content
  • 0

problem with warp


Karbust

Question

  • VIP

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

QJ0orbR.png

Metin2 Icon Database

Link to comment

14 answers to this question

Recommended Posts

  • 0
  • VIP

 

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

QJ0orbR.png

Metin2 Icon Database

Link to comment
  • 0
  • VIP

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

QJ0orbR.png

Metin2 Icon Database

Link to comment
  • 0
  • VIP

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

QJ0orbR.png

Metin2 Icon Database

Link to comment
  • 0

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

  • Love 1

:D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.