Jump to content
×
×
  • Create New...
  • 0

Problem with a little function in quest


Zoom

Question

 

Hi, i have a problem with "if" in my quest.

 

This quest looks like:

 

when xxx.use begin

 

[...]

 

if pc.get_skill_group() != 1 and pc.get_job() != 0 or pc.get_job() != 4 then
    syschat("["..item.get_name().."]".." you are not a warrior body")
    return

end

 

Translate: When im not a BODY and WARRIOR MEN or WOMAN, return...

but when i try use item on warrior with skills BODY, i got syschat "you are not a warrior body"

 

Really i don't know why this doesn't work, this is a simple function, somebody have idea whats wrong?

 

Best regards.

 

Link to comment
Share on other sites

  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

4 answers to this question

Recommended Posts

  • 0
quest test begin
	state start begin
		when login begin
			set_state(information)
		end
	end
	state information begin
		when letter begin
			send_letter("Test")
		end
		when button or info begin
			if pc.get_skill_group() == 1 and pc.get_job() == 0 or pc.get_job() == 4 then
				say_title("Test")
				say("")
				say("You are a warrior body. (man/woman)")
				say("")
				clear_letter()
			else
				say_title("Test")
				say("")
				say("You are not a warrior body. (man/woman)")
				say("")
				clear_letter()
			end
		end
	end
end
if not pc.get_skill_group() == 1 and pc.get_job() == 0 or pc.get_job() == 4 then
	syschat("["..item.get_name().."]".." you are not a warrior body")
	return
end
quest test2 begin
	state start begin
		when login begin
			set_state(information)
		end
	end
	state information begin
		when letter begin
			send_letter("Test2")
		end
		when button or info begin
			if not pc.get_skill_group() == 1 and pc.get_job() == 0 or pc.get_job() == 4 then
				say_title("Test2")
				say("")
				say("You are not a warrior body. (man/woman)")
				say("")
				clear_letter()
			else
				say_title("Test2")
				say("")
				say("You are a warrior body. (man/woman)")
				say("")
				clear_letter()
			end
		end
	end
end

 

Edited by Cunoo
Link to comment
Share on other sites

  • 0

@Cunoo

 

When i change my line of "if" to "if not pc.get_skill_group() == 1 and pc.get_job()== 0 or pc.get_job() == 4 then

i doesn't work, when i change pc.get_skill_group() == 1 to pc.get_skill_group() == 2 (MENTAL) i can use item.

 

Thanks for quests but in my case i can't use like this:

 

if bla bla

   bla bla

else <---- with else

  bla bla

 

I have to include this "if" to this list:

 

when xxx.use begin

 

if pc.get_skill_group() == 0 then
                syschat("...")
                return
            end

if table.getn(vnum_list) == 0 then
                syschat("...")
                return
            end
            
if pc.count_item(50513) == 0 then
                syschat("..")
                return
            end
            
 if not pc.can_warp() then
                syschat("..")
                return
            end

 

----- HERE TO SPEACE FOR IF --

 

"if" must end with return end :)

Link to comment
Share on other sites

  • 0
  • Premium
1 hour ago, Zoom said:

@Cunoo

 

When i change my line of "if" to "if not pc.get_skill_group() == 1 and pc.get_job()== 0 or pc.get_job() == 4 then

i doesn't work, when i change pc.get_skill_group() == 1 to pc.get_skill_group() == 2 (MENTAL) i can use item.

 

Thanks for quests but in my case i can't use like this:

 

if bla bla

   bla bla

else <---- with else

  bla bla

 

I have to include this "if" to this list:

 

when xxx.use begin

 

if pc.get_skill_group() == 0 then
                syschat("...")
                return
            end

if table.getn(vnum_list) == 0 then
                syschat("...")
                return
            end
            
if pc.count_item(50513) == 0 then
                syschat("..")
                return
            end
            
 if not pc.can_warp() then
                syschat("..")
                return
            end

 

----- HERE TO SPEACE FOR IF --

 

"if" must end with return end :)

weed GIF

Link to comment
Share on other sites

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


  • Activity

    1. 0

      Looking for Someone to create the queries etc for armors and weapons

    2. 13

      Official Private Shop Search

    3. 944

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    4. 79

      GUI Teleport System

    5. 0

      inventory slot marking system cant compile

    6. 8

      Inventory Bug

    7. 63

      Metin2 Dev - Changelogs

  • Recently Browsing

    • No registered users viewing this page.

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.