SzC 49 Posted December 16, 2014 Share Posted December 16, 2014 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 More sharing options...
.TeodorPL 22 Posted December 16, 2014 Share Posted December 16, 2014 Try define rr as locale. Link to comment Share on other sites More sharing options...
Rumor 2604 Posted December 16, 2014 Share Posted December 16, 2014 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 1 Link to comment Share on other sites More sharing options...
SzC 49 Posted December 16, 2014 Author Share Posted December 16, 2014 Rumor i use vrunner, and mysql_query not found... necesary use mysql_query in game.. thx for you help but this does not help me. Try define rr as locale. No is the problem thx. Link to comment Share on other sites More sharing options...
Rumor 2604 Posted December 16, 2014 Share Posted December 16, 2014 I don't understand how you using vrunner means you can't use mysql_query in a quest Link to comment Share on other sites More sharing options...
SzC 49 Posted December 16, 2014 Author Share Posted December 16, 2014 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 More sharing options...
Solution Rexors 4 Posted December 17, 2014 Solution Share Posted December 17, 2014 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 4 Link to comment Share on other sites More sharing options...
SzC 49 Posted December 17, 2014 Author Share Posted December 17, 2014 Thx Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now