Sziasztok, valaki meg tudná mondani, hogy lehet azt megoldani, hogy mysql-be írja bele egy adott játékos öléseinek számát?
questlib:
db_user="root"
db_pass="jelszó"
db_host="ipcim"
function mysql_select(query,notselect)
local tmp=number(11111111,99999999)
os.execute('mysql -h '..db_host..' -u '..db_user..' -p'..db_pass..' -N -e '..string.format("%q",query)..' 2>&1 > /tmp/'..tmp)
if not notselect then
local res,i={},1
local f,e=io.open("/tmp/"..tmp)
if f then
local line=f:read("*l")
while line do
res[i]={}
string.gsub(line,"([^\t]+)\t*", function(s)
table.insert(res[i],s)
end)
i=i+1
line=f:read("*l")
end
f:close()
os.execute("rm /tmp/"..tmp)
end
return res
end
end
function mysql_notselect(query)
return mysql_select(query,true)
end
mysql_query = mysql_select
Csinálsz player-ben egy új oszlopot(típus int), pl: olesek néven. majd itt a quest
quest olesek begin
state start begin
when kill begin
if npc.is_pc() then
local ID = pc.get_account_id()
mysql_query("UPDATE player.player SET olesek + 1 WHERE id = "..ID..";")
end
end
end
Ha qc-nál hibát ír ki akkor egészítsd ki a quest_functionst.