uhm okay but now coming:
here my kill.lua... waht is wrong?
Code:
[15/04/2009 23:33:34] luaCreateConditionObject(). Condition not found
[15/04/2009 23:33:34] [Warning - Event::loadScript] Can not load script (data/creaturescripts/scripts/kill.lua)
[15/04/2009 23:33:34] data/creaturescripts/scripts/kill.lua:27: 'then' expected near ')'
[15/04/2009 23:33:35] [Warning - Event::loadScript] Can not load script (data/creaturescripts/scripts/kill.lua)
[15/04/2009 23:33:35] data/creaturescripts/scripts/kill.lua:27: 'then' expected near ')'
here my kill.lua... waht is wrong?
Code:
function onKill(cid, target)
local monster = getCreatureName(target)
local room = getArenaMonsterIdByName(monster)
if room > 0 then
setPlayerStorageValue(cid, room, 1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'You can enter next arena room!')
end
return TRUE
end
function onKill(cid, target)
if isPlayer(target) == TRUE then
---- BOUNTY HUNTERS START -----
pid = cid
pid2 = getPlayerGUID(target)
local result_plr = db.getResult("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..pid2.." AND `killed` = 0;")
if(result_plr:getID() ~= -1) then
prize = tonumber(result_plr:getDataInt("prize"))
bid = tonumber(result_plr:getDataInt("id"))
result_plr:free()
else
prize = 0
bid = 0
end
if bid ~= 0 and prize ~= 0 and getTileInfo(getCreaturePostion(cid)).pvp ~= true) then
db.executeQuery("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " WHERE `id` = "..bid..";")
doPlayerAddMoney(cid,prize*1000)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[BOUNTY HUNTERS] You killed hunted player, so you gained the reward!')
end
---- BOUNTY HUNTERS END -----
end
return TRUE
end