Hab ich so eingefügt. Funktioniert nicht, wenn ich auf jeweils auf die drei Schaltflächen beim Npc klicke passiert nichts außer:Quote:
PHP Code:quest rofl begin
state start begin
function buy(vnum,count,cost)
mysql_query("UPDATE account.account SET cash = cash-'"..cost.."' WHERE id = '"..pc.get_account_id().."' LIMIT 1;")
pc.give_item2(vnum,count)
end
when 20092.chat."Cash or Die" begin
mysql_query("UPDATE account.account SET cash = cash+200 WHERE id = '"..pc.get_account_id().."' LIMIT 1;")
say("200 Mehr coins bekommen")
setskin(NOWINDOW)
end
when 20092.chat."Gib mir das Schwert für 200" begin
local cost = 200
if mysql_query("SELECT account.account SET cash = cash+20 WHERE id = '"..pc.get_account_id().."' LIMIT 1;")[1][1] > cost then
rofl.buy(itemvnum,1,cost)
say(say_item(itemvnum).." bought for "..cost.. " Coins!")
end
end
when 20092.chat."wv coins hab ich lack" begin
local cashamount = (mysql_query("SELECT account.account SET cash = cash+20 WHERE id = '"..pc.get_account_id().."' LIMIT 1;")[1][1])
say(cashamount.." Coins")
setskin(NOWINDOW)
end
end
end
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET cash = cash+20 WHERE id = '2' LIMIT 1' at line 1