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

Cialo znika

woocSlave

New Member
Joined
Apr 18, 2010
Messages
63
Reaction score
0
Location
Wroclaw <3
mysql_real_query(): INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (1161, 1273135072, 250, '', ''); - MYSQL ERROR: Nieznana kolumna 'time' w field list (1054)

Po zabiciu, gracz dalej ma aol'a.
bs i rs tez nic nei zdzialaja, gdy ktos padnie na rsie dalej ma all eq.

Prosze o WSKAZOWKE ;]

playerdea~.lua

local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled == TRUE) then
local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
if(isPlayer(lastHitKiller) == TRUE) then
hitKillerName = getPlayerGUID(lastHitKiller)
else
hitKillerName = getCreatureName(lastHitKiller)
end

if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
if(isPlayer(mostDamageKiller) == TRUE) then
damageKillerName = getPlayerGUID(mostDamageKiller)
else
damageKillerName = getCreatureName(mostDamageKiller)
end
end
end

db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
local amount = (rows:numRows(true) - config.maxDeathRecords)
if(amount > 0) then
if(config.sqlType == "sqlite") then
for i = 1, amount do
db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
end
else
db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
end
end
end
end
end

prosze o pomoc!
 
Last edited:
nie ;]
wywolaj mi zapytanie ;]
#up
nie mam, tylko jak wywolac
"ALTER TABLE XX(11) NOT NULL DEFAULT 0; "
zielony jestem
 
alter table `player_deaths` add `time` BIGINT UNSIGNED NOT NULL DEFAULT 0;
 
3,6,1 pl 1

;]

89433bbb.bmp


Pomoze ktos?
Tabela utworzyłem ;]
 
Last edited by a moderator:
ja w playerdeath.lua mam coś takiego

Code:
function onDeath(cid, corpse, deathList)

local strings = {""}
local t, position = 1, 1

local deathType = "killed"
local toSlain, toCrushed, toEliminated = 3, 9, 15

        if #deathList >= toSlain and #deathList < toCrushed then
                deathType = "slain"
        elseif #deathList >= toCrushed and #deathList < toEliminated then
                deathType = "crushed"
        elseif #deathList >= toEliminated then
                deathType = "eliminated"
        end

        for _, pid in ipairs(deathList) do
                if isCreature(pid) == true then
                        strings[position] = t == 1 and "" or strings[position] .. ", "
                        strings[position] = strings[position] .. getCreatureName(pid) .. ""
                        t = t + 1
                else
                        strings[position] = t == 1 and "" or strings[position] .. ", "
                        strings[position] = strings[position] .."a field item"
                        t = t + 1
                end
        end

        for i, str in ipairs(strings) do
                if(str:sub(str:len()) ~= ",") then
                        str = str .. "."
                end

                msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str
        end

        for _, oid in ipairs(getPlayersOnline()) do
                doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
        end
        return true
end
 
Back
Top