• 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!

Request help with this Script

chiki1562

New Member
Joined
Aug 26, 2008
Messages
33
Reaction score
0
Well what I need to do to get this script esque that the message appear throughout the half when he talks like a gm because it appears only in default does not appear in the overall and should be read and also the level of the Dead
español

Code:
dofile("./config.lua")

function onDeath(cid, corpse, killer)
local player = getCreatureName(cid)
local killername = getCreatureName(killer)

    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are dead.")
    broadcastMessage(""..killername.." Just killed "..player.."!",19)
    if deathListEnabled == "yes" then
        if sqlType == "mysql" then
            env = assert(luasql.mysql())
            con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
        else -- sqlite
            env = assert(luasql.sqlite3())
            con = assert(env:connect(sqliteDatabase))
        end
        local byPlayer = FALSE
        if killer == FALSE then
            killerName = "field item"
        else
            if isPlayer(killer) == TRUE then
                byPlayer = TRUE
            end
            killerName = getCreatureName(killer)
        end
        assert(con:execute("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", '" .. escapeString(killerName) .. "', " .. byPlayer .. ");"))
        local cursor = assert(con:execute("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";"))
        local deathRecords = numRows(cursor)
        if sqlType == "mysql" then
            while deathRecords > maxDeathRecords do
                delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1;"))
                deathRecords = deathRecords - 1
            end
        else
            while deathRecords > maxDeathRecords do
                delete = assert(con:execute("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);"))
                deathRecords = deathRecords - 1
            end
        end            
        con:close()
        env:close()
    end
end
 
Replace
Code:
broadcastMessage(""..killername.." Just killed "..player.."!",19)
with
Code:
broadcastMessage(killername.." just killed "..player.."!", MESSAGE_STATUS_WARNING)
 
Thank you a question you do not know how to do so that the color is orange and not red? and also to show the level at which killed the player?
 
Code:
broadcastMessage(killername.." ["..getPlayerLevel(killername).."] just killed "..player.." ["..getPlayerLevel(player).."]!", MESSAGE_STATUS_WARNING)

I guess there is no orange message shown in the game window.
 
Thanks for your help and I have another invitation.
I need an exe from a TFS v.02 for 8.31 that has compiled that the houses can be purchased for the free account that is not only for the premium account as on my server I use the Premium account as the account vip
 
Back
Top