Jump to content
  • 0
Sign in to follow this  
Namikaze

Guild account problem

Question

Hey guys i have a problem with this quest

quest gildenkonto begin
state start begin
function get_money()
return tonumber(mysql_query("select gold from player.guild where name = '".. guild.get_name() .."';")[1][1]) or 0
end
when 11000.chat."Gildenkonto" or 11002.chat."Gildenkonto" or 11004.chat."Gildenkonto" with pc.has_guild() begin
say_title("Gildenkonto")
if not pc.is_guild_master() then
say_reward("Nur der Gildenleader kann auf das[ENTER]Konto zugreifen")
say()
return
else
say_reward("Guthaben: ".. gildenkonto.get_money())
say()
local s = select("Geld abheben","Geld einzahlen","Abbrechen")
if s == 3 then return
elseif s == 1 then
say_title("Gildenkonto")
say("Wieviel Geld möchtest du abheben?")
say()
local m = tonumber(input())
if m < 1 or m == nil then return end
if m > gildenkonto.get_money() then
return syschat("Es ist nicht genügend Yang vorhanden")
end
if pc.get_money()+m > 1999999999 then
return syschat("Du hast zu viel Yang bei dir")
end
pc.change_money(m)
mysql_query("update player.guild set gold = gold - ".. m .." where name = '".. guild.get_name() .."';")
else
say_title("Gildenkonto")
say("Wieviel Geld möchtest du einzahlen?")
say()
local m = tonumber(input())
if m < 1 or m == nil then return end
if m > pc.get_money() then
return syschat("Du hast nicht genügend Yang")
end
pc.change_money(-m)
mysql_query("update player.guild set gold = gold - ".. m .. " where name = '".. guild.get_name() .."';")
end
end
end
end
end

if i click on Gildenkonto nothing happens and it just say Gildenkonto and Ok

6PRTP.jpg

 

my syserr says only this

SYSERR: Feb 9 17:40:37 :: RunState: LUA_ERROR: locale/germany/quest/object/state/gildenkonto:1: attempt to index field `?' (a nil value)


SYSERR: Feb 9 17:40:37 :: WriteRunningStateToSyserr: LUA_ERROR: quest gildenkonto.start enter

Edited by Rumor
Updated quest with code BBCODE (see edit history)

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

try to replace your quest function get_money()

with this

function get_money()
	local a = mysql_query("select * from player.guild where name = '".. guild.get_name() .."';")
	return a.gold[1]
end

Share this post


Link to post
  • 0

Please use the code BBCODE and select "Quest" when you post quests, it looks much neater.

 

Moved to Programming.

Share this post


Link to post
  • 0

That's not going to work. Guild table cannot be updated while game is running.

Share this post


Link to post
  • 0

That's not going to work. Guild table cannot be updated while game is running.

hm okay...

 

Please use the code BBCODE and select "Quest" when you post quests, it looks much neater.

 

Moved to Programming.

 

sry now i know it for the next time :)

Share this post


Link to post
  • 0

You would need to change the game or db source for that to work.

 

Actually, in 2007 or so, Ymir had this system working, they removed it for some reason.

Share this post


Link to post
  • 0

You would need to change the game or db source for that to work.

 

Actually, in 2007 or so, Ymir had this system working, they removed it for some reason.

hm okay but atm i use the 34083 game because the new game has a callback function as i know ^^

Share this post


Link to post

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
Sign in to follow this  
  • Recently Browsing   0 members

    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.