<action itemid="5541" event="script" value="xxxx.lua"/>
local config =
{
item = 5541,
level = 1,
count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags have been removed.")
doRemoveItem(item.uid)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
else
doPlayerSendCancel(cid, "You dot have enough level")
end
return TRUE
end
LUA:<action itemid="5541" event="script" value="xxxx.lua"/>
and in actions/scripts
LUA:local config = { item = 5541, level = 1, count = 0 } function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) >= config.level then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags have been removed.") doRemoveItem(item.uid) db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") else doPlayerSendCancel(cid, "You dot have enough level") end return TRUE end
Do you use Mysql or sqlite as your database?
and what version of tfs do you use?
should works, db.query works on avesta (I see it here AVESTA jajaja
you use that avesta version?
you have the function executequery? post here your functions also the file (if exist) db/database.lua
database.lua isnt a source file bro, its in data pack...