• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

tfs 0.4 to 1.0

Transfer your script to the 1.0 engine and open the server and check for the server. Since we can't predict the errors.
 
everything is done and recompiled but no results..
can you have a look in the bounty hunter script? maybe I f*cked it really hard xD

talkaction:
Code:
local player = Player(cid)
function onSay(cid, words, param)
    if(param == "") then
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
        return TRUE
    end
    local t = string.split(param, ",")
    if(not t[2]) then
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
        return TRUE
    end
    local sp_id = getPlayerGUIDByName(t[2])
    if sp_id == nil then
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] This player doesn't exists.")  
        return TRUE
    end
    local resultId = db.storeQuery("SELECT `bounty_hunters` WHERE `sp_id` = "..sp_id.."  AND `killed` = 0;")
    if(resultId ~= false) then
        is = tonumber(result.getDataInt(resultId, "sp_id"))
        result.free(resultId)
    else
        is = 0
    end
    prize = tonumber(t[1])

    if(prize == nil or prize < 1) then
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Use: \"!hunt [prize],[nick]\" where prize is for example 1(k).")
        return TRUE
    end
    if(prize >= 100000000000000000000) then
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Sorry, you typed too big number!")
        return TRUE
    end

    if is ~= 0 then
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] This player has already hunted.")
        return TRUE
    end

    if player:removeMoney(cid, prize*1000) == TRUE then
        db.query("INSERT INTO `bounty_hunters` VALUES (NULL,"..getPlayerGUID(cid)..","..sp_id..",0," .. os.time() .. ","..prize..",0,0);")
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] Hunt has been added!")      
    else
        player:sendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[BOUNTY HUNTERS] You haven't got enough money!")      
    end
    return 1
end

Creaturescripts:
Code:
local player = Player(cid)
function onKill(cid, target)
if isPlayer(target) == TRUE then
---- BOUNTY HUNTERS START -----
pid = cid
pid2 = getPlayerGUID(target)
    local resultId = db.storeQuery("SELECT `bounty_hunters` WHERE `sp_id` = "..pid2.." AND `killed` = 0;")
    if(resultId:getID() ~= -1) then
    prize = tonumber(resultId:getDataInt("prize"))
    bid = tonumber(resultId:getDataInt("id"))
    resultId:free()
    else
    prize = 0
    bid = 0
    end

if (bid ~= 0 and prize ~= 0 and not(getTileInfo(getCreaturePosition(cid)).pvp)) then
    db.query("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..getPlayerGUID(cid)..", `kill_time` = " .. os.time() .. " WHERE `id`  = "..bid..";")
    player:addMoney(cid,prize*1000)
    player:sendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[BOUNTY HUNTERS] You killed hunted player, so you gained the reward!')
end   
---- BOUNTY HUNTERS END -----
end
return TRUE
end
 
Last edited:
You can see functions in:
data/lib/101-compat

And remember on make reload or try using scripts
get error on console you see what lines.. and edit script
 
Back
Top