Jump to content
  • 0

[HELP]Problem with quest


SzC

Question

I use its quest and its error.

 

Quest:

quest coins begin
    state start begin

        when 80017.use or 80014.use or 80015.use or 80016.use begin

            rr = {

            [80017] = {"Cupon de Coins (50)", 50},
            [80014] = {"Cupon de Coins (100)", 100},
            [80015] = {"Cupon de Coins (200)", 200},
            [80016] = {"Cupon de Coins (500)", 500}

                }

            syschat(""..pc.get_name().." has usado "..rr[item.get_vnum()][1].." con exito.")
            item.remove()
            game.mysql_update_query("UPDATE account.account SET coins = coins + "..rr[item.get_vnum()][2].." WHERE id = "..pc.get_account_id()..";'")
        end
    end
end

 

syserr:

SYSERR: Dec 16 21:30:05 :: RunState: LUA_ERROR: [string "coins"]:9: attempt to index field `?' (a nil value)
SYSERR: Dec 16 21:30:05 :: WriteRunningStateToSyserr: LUA_ERROR: quest coins.start click

 

Thx all.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Try this. Array is from from Rumor quest. I tested on my server and works.

quest coins begin
    state start begin
 
        when 80017.use or 80014.use or 80015.use or 80016.use begin
 
        local value = ({
                [80017] = 50,
                [80014] = 100,
                [80015] = 200,
                [80016] = 500,
            })[item.get_vnum()]
 
           syschat(""..pc.get_name().." has usado Cupon de Coins ("..value..") con exito.")
           item.remove()
           game.mysql_update_query("UPDATE account.account SET coins=coins+"..value.." WHERE id = "..pc.get_account_id().." ;")
 
        end
    end
end
  • Love 4
Link to comment
Share on other sites

  • 0

here's a fully working one I used over a year:

quest givecoins begin
    state start begin
        when 80014.use or 80015.use or 80016.use begin
            local count = pc.count_item(item.get_vnum())
            local value = ({
                [80014] = 10,
                [80015] = 25,
                [80016] = 50,
            })[item.get_vnum()]
            say_title('Coin Scroll')
			say('')
            say('This coin scroll is worth: '..value..' NM.')
			say('Nirvana Marks can be used in the itemshop!')
            say('Would you like to add the NM to your acccount?')
			say('You can only use this item once.')
			say('')
            if select('Yes','No') == 2 then return end
            if count ~= pc.count_item(item.get_vnum()) then -- BUGUSER!
				say('')
                say_reward('Bug use attempted. Coin reward has been cancelled.')
				say('')
                return
            end
            mysql_query('UPDATE account.account SET nm = nm+'..value..' WHERE id = '..pc.get_account_id()..' LIMIT 1')
			mysql_query('INSERT INTO log.coinscroll_log (account_id, marks, time) VALUES (".. pc.get_account_id() ..", ".. value ..", NOW())')
            pc.remove_item(item.get_vnum())
            syschat('Your account has successfully been rewarded with NM.')
            -- If item is not stackable use:
            -- item.remove()
        end
    end
end
  • Love 1
Link to comment
Share on other sites

  • 0

I use mysql_query in game and found 100% with vrunner, but in its quest say its error in syserr:

SYSERR: Dec 16 21:30:05 :: RunState: LUA_ERROR: [string "coins"]:9: attempt to index field `?' (a nil value)

SYSERR: Dec 16 21:30:05 :: WriteRunningStateToSyserr: LUA_ERROR: quest coins.start click

my functions:

game.mysql_real_escape_string

game.mysql_query

game.mysql_update_query

and found 100%, but in its quest wrong..

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

      damage from int to long long

    2. 22

      Green & Purple Potions Effect

    3. 12

      When Uninstalling Gaya System

    4. 12

      When Uninstalling Gaya System

    5. 12

      When Uninstalling Gaya System

    6. 12

      When Uninstalling Gaya System

    7. 12

      When Uninstalling Gaya System

    8. 12

      When Uninstalling Gaya System

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.