-
Total de itens
371 -
Registro em
-
Última visita
Histórico de Curtidas
-
bpm91 recebeu reputação de Ricardo Bregantini em Preciso Urgente de Ajuda
@Ricardo Bregantini se vc adicionou atributos ao item talvez seja isso, experimente voltar como estava antes e veja se n da debug
-
bpm91 deu reputação a Tadelho em RP exausted andar e atacar
Cara, eu não sei qual servidor e qual versão você está utilizando, mas talvez a solução passe pelo mesmo método encontrado neste tópico que deixarei ao final; isto é, uma pequena edição no código fonte do seu servidor (que deverá ser compilado novamente a partir da modificação). Infelizmente eu não sei exatamente qual é o trecho de código que condiciona isso que você quer.
-
bpm91 deu reputação a penisagudo em procuro de alguem q faz job com ts 0.4
Cara explica um pouco melhor seu problema é tenta colocar uma foto para eu poder entender o que acontece
-
bpm91 deu reputação a luanluciano93 em Fim Premium
function onLogin(cid) local pos = {x = 32369, y = 32241, z = 7} if isPremium(cid) then setPlayerStorageValue(cid, 59898989, 1) elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerVocation(cid) > 0 then local outfit = getPlayerSex(cid) == 0 and 136 or 128 doCreatureChangeOutfit(cid, {lookType = outfit}) doTeleportThing(cid, pos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your premium account is over") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, 59898989, 0) end return true end
-
bpm91 deu reputação a Rayo em Quais comando linux para Ot Nao fechar?
Veja este tópico:
Ou este da otland:
https://otland.net/threads/auto-restart-linux.262336/
-
bpm91 deu reputação a Rayo em Fim Premium
function onLogin(cid) registerCreatureEvent(cid,"FimPremium") local pos = {x = 32369, y = 32241, z = 7} if isPremium(cid) then setPlayerStorageValue(cid, 59898989, 1) elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 0 and getPlayerVocation(cid) > 0 then doCreatureChangeOutfit(cid, {lookType = 136}) doTeleportThing(cid, pos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t) t = "Your premium account is over" doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, 59898989, -1) elseif getPlayerStorageValue(cid, 59898989) == 1 and not isPremium(cid) and getPlayerSex(cid) == 1 and getPlayerVocation(cid) > 0 then doCreatureChangeOutfit(cid, {lookType = 128}) doTeleportThing(cid, pos) doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, t) t = "Your premium account is over" doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, 59898989, -1) end return TRUE end Eu não testei mas o que eu fiz foi adicionar:
getPlayerVocation(cid) > 0
Ou seja, como um char de rook não tem vocação então ele não vai realizar o resto do algoritmo. Só ira prosseguir se o player tiver alguma vocação.
@bpm91 testa e veja se funcionou!
-
bpm91 deu reputação a Tricoder em (Resolvido)Data e hora gesior
Coloque isso no index:
date_default_timezone_set("America/Sao_Paulo"); //
Se seu problema foi resolvido, por favor marque esse post como melhor resposta. Se não foi, avise e tentarei ajudá-lo.
-
bpm91 deu reputação a Movie em Error ID: Cannot save ItemsList. Player ID not set.
Tenta rodar esse SQL na sua database:
SET GLOBAL sql_mode='';
-
bpm91 deu reputação a luanluciano93 em horario desatualizado
date_default_timezone_set("America/Sao_Paulo");
-
bpm91 deu reputação a luanluciano93 em Premium account ficou free, é teleportado
@LeoTK a titulo de conhecimento ...
• o evento onLogin não precisa ser registrado.
• TRUE em maiúscula é gambiarra do TFS. não use-o
• Se o personagem for premium você não precisa da variável "pos", portanto pode declarar ela depois da segunda verificação ...
function onLogin(cid) if isPremium(cid) then setPlayerStorageValue(cid, 6787656, 1) elseif getPlayerStorageValue(cid, 6787656) == 1 and not isPremium(cid) then doPlayerSetTown(cid, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getPlayerPosition(cid), 240) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Premium expirou!\nNao deixe de visitar nosso SHOP.") setPlayerStorageValue(cid, 6787656, 0) end return true end
-
bpm91 deu reputação a luanluciano93 em vocações e database
Se você usar gesior, existe uma função que verifica se é premium ...
Website::getVocationName($player->getVocation()) https://github.com/gesior/Gesior2012/blob/master/pages/characters.php#L39
-
bpm91 deu reputação a Pedro. em Account Lost Gesior
O primeiro erro, trata-se de um código antigo do php 4, aonde não se usa mais construtor dessa maneira.
<?php class foo { function foo() { echo 'Eu sou um construtor'; } } ?> como deve ser no 7x
class MinhaClasse { public function __construct() { // } } No seu caso, eu baixaria uma versão mais atualizada do phpmailer e do smtp que é o padrão que usa.
caso seu gesior seja 1x mais, pega em algum repositório.
https://github.com/Riicksouzaa/TheRealGesiorFerobra
https://github.com/gutogirardon/Elderia-Global-Gesior
os últimos dois erros trata-se de configuração, se não me engano SSL. Dai teria que usar um try catch pra debugar, mas quase certeza que é SSL. Atualiza os códigos.
-
bpm91 deu reputação a LeoTK em Premium account ficou free, é teleportado
@bpm91
não precisa adicionar no login.lua
function onLogin(cid) registerCreatureEvent(cid,"FimPremium") local pos = {x = 1026, y = 910, z = 7} if isPremium(cid) then setPlayerStorageValue(cid, 6787656, 1) elseif getPlayerStorageValue(cid, 6787656) == 1 and not isPremium(cid) then doTeleportThing(cid, pos) doPlayerSetTown(cid,1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Premium expirou!\nNao deixe de visitar nosso SHOP.") doSendMagicEffect(getPlayerPosition(cid), 240) setPlayerStorageValue(cid, 6787656, -1) end return TRUE end
-
bpm91 deu reputação a Cricket em nome itens
Não me recordo. Mas pra não ficar sem nome coloca Bridger na ponte e Stone.. vai quebrar um galho, melhor que "gamemaster...bla bla bla" rs
-
bpm91 deu reputação a Agaka em Elevador Kazordoon
@bpm91 Os erros no código acima são só falta de lógica, nada de mais.
-
bpm91 recebeu reputação de MatCollier em Sistema server save e clean
@MatCollier vlw pela ajuda na verdade eu ja tinha resolvido mas o topico ficou aberto aqui um tempao ahuaehaueh. mas obg
-
bpm91 deu reputação a MatCollier em Sistema server save e clean
Então, eu não entendo muito, mas vou tentar ajudar:
Em globalevents eu coloco o seguinte evento:
E crio o arquivo save.lua com o seguinte código:
"O que ele vai fazer é uma contagem regressiva de 5 minutos, e ao chegar em 0 ele vai ativar a função shutdown, que na minha source (TFS 1.2) é isso aqui:
Essa parte que eu te falei, vai DESLIGAR o server na hora determinada lá em global events. Aí pro server iniciar novamente, você precisa de um ot restarter.
No meu caso, como o meu ot está em linux, eu criei o seguinte arquivo no bloco de notas e salvei como ".sh" (no lugar de tfs você coloca o nome do seu executável que abre a distro):
Ele vai reabrir a distro sempre que ela fechar, que é quando o server dá shutdown no global event.
Caso tu esteja usando windows pode baixar um aplicativo ot restarter na net q ele faz isso por você.
Espero ter ajudado. De novo, não entendo muito disso, apenas mandei o que tenho aqui.
-
-
-
bpm91 deu reputação a Snowsz em (Resolvido)Talkaction Deathlist [TFS1.X]
Isso é assunto pra outro tópico kk
-
bpm91 deu reputação a Snowsz em (Resolvido)Talkaction Deathlist [TFS1.X]
local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and not isInArray(KillersArray, CreatureMT:getName()) then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end Isso deve resolver ↑.
Sobre o site eu não entendo muito bem, mas posso até tentar.
-
bpm91 deu reputação a Snowsz em (Resolvido)Talkaction Deathlist [TFS1.X]
Pensei que só queria de player kkk, sobre cortar 2 letras, é falta de prática minha, mesmo mexendo com isso todo dia, me sinto enferrujado sempre, isso deve resolver:
local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end Talk:
local function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end local function getMonthDayEnding(day) if day == "01" or day == "21" or day == "31" then return "st" elseif day == "02" or day == "22" then return "nd" elseif day == "03" or day == "23" then return "rd" else return "th" end end local function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function onSay(player, words, param) local resultId = db.storeQuery("SELECT `id`, `name` FROM `players` WHERE `name` = " .. db.escapeString(param)) if resultId ~= false then local targetGUID = result.getNumber(resultId, "id") local targetName = result.getString(resultId, "name") result.free(resultId) local str = "" local breakline = "" local resultId = db.storeQuery("SELECT `time`, `level`, `killed_by`, `is_player`, `player_killers` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC") if resultId ~= false then repeat if str ~= "" then breakline = "\n" end local date = os.date("*t", result.getNumber(resultId, "time")) local article = "" local killed_by = result.getString(resultId, "killed_by") if result.getNumber(resultId, "is_player") == 0 then article = getArticle(killed_by) .. " " killed_by = killed_by:lower() end local killers = (result.getString(resultId, "player_killers") or ""):gsub(";", ", ") if date.day < 10 then date.day = "0" .. date.day end if date.hour < 10 then date.hour = "0" .. date.hour end if date.min < 10 then date.min = "0" .. date.min end if date.sec < 10 then date.sec = "0" .. date.sec end str = str .. breakline .. " " .. date.day .. getMonthDayEnding(date.day) .. " " .. getMonthString(date.month) .. " " .. date.year .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec .. " Morto no Level " .. result.getNumber(resultId, "level") .. " por " .. killers .. "." until not result.next(resultId) result.free(resultId) end if str == "" then str = "Sem mortes." end player:popupFYI("Mortes do personagem, " .. targetName .. ".\n\n" .. str) else player:sendCancelMessage("O jogador com esse nome não existe.") end return false end
-
bpm91 deu reputação a Snowsz em (Resolvido)Talkaction Deathlist [TFS1.X]
Erro meu kkk, fez bem em mudar lá, tenta agora:
local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and CreatureMT:isPlayer() then table.insert(KillersArray, CreatureMT:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', \"' .. table.concat(KillersArray, ";") .. '\")') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end
-
bpm91 deu reputação a Snowsz em (Resolvido)Talkaction Deathlist [TFS1.X]
Execute isso no MySQL:
ALTER TABLE player_deaths ADD player_killers TEXT NOT NULL
Talkaction:
local function getArticle(str) return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a" end local function getMonthDayEnding(day) if day == "01" or day == "21" or day == "31" then return "st" elseif day == "02" or day == "22" then return "nd" elseif day == "03" or day == "23" then return "rd" else return "th" end end local function getMonthString(m) return os.date("%B", os.time{year = 1970, month = m, day = 1}) end function onSay(player, words, param) local resultId = db.storeQuery("SELECT `id`, `name` FROM `players` WHERE `name` = " .. db.escapeString(param)) if resultId ~= false then local targetGUID = result.getNumber(resultId, "id") local targetName = result.getString(resultId, "name") result.free(resultId) local str = "" local breakline = "" local resultId = db.storeQuery("SELECT `time`, `level`, `killed_by`, `is_player`, `player_killers` FROM `player_deaths` WHERE `player_id` = " .. targetGUID .. " ORDER BY `time` DESC") if resultId ~= false then repeat if str ~= "" then breakline = "\n" end local date = os.date("*t", result.getNumber(resultId, "time")) local article = "" local killed_by = result.getString(resultId, "killed_by") if result.getNumber(resultId, "is_player") == 0 then article = getArticle(killed_by) .. " " killed_by = killed_by:lower() end local killers = (result.getString(resultId, "player_killers") or ""):gsub(";", ", ") killers = killers:sub(1, #killers-2) if date.day < 10 then date.day = "0" .. date.day end if date.hour < 10 then date.hour = "0" .. date.hour end if date.min < 10 then date.min = "0" .. date.min end if date.sec < 10 then date.sec = "0" .. date.sec end str = str .. breakline .. " " .. date.day .. getMonthDayEnding(date.day) .. " " .. getMonthString(date.month) .. " " .. date.year .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec .. " Morto no Level " .. result.getNumber(resultId, "level") .. " por " .. killers .. "." until not result.next(resultId) result.free(resultId) end if str == "" then str = "Sem mortes." end player:popupFYI("Mortes do personagem, " .. targetName .. ".\n\n" .. str) else player:sendCancelMessage("O jogador com esse nome não existe.") end return false end
Creaturescript:
local deathListEnabled = true local maxDeathRecords = 5 function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local playerId = player:getId() if nextUseStaminaTime[playerId] ~= nil then nextUseStaminaTime[playerId] = nil end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Você morreu') player:removeBlessing(6) player:removeBlessing(7) if not deathListEnabled then return end local byPlayer = 0 local killerName local killerid if killer ~= nil then if killer:isPlayer() then killerid = killer:getGuid() byPlayer = 1 else local master = killer:getMaster() if master and master ~= killer and master:isPlayer() then killer = master killerid = killer:getGuid() byPlayer = 1 end end killerName = killer:isMonster() and killer:getType():getNameDescription() or killer:getName() else killerName = 'field item' end local byPlayerMostDamage = 0 local mostDamageKillerName if mostDamageKiller ~= nil then if mostDamageKiller:isPlayer() then byPlayerMostDamage = 1 else local master = mostDamageKiller:getMaster() if master and master ~= mostDamageKiller and master:isPlayer() then mostDamageKiller = master byPlayerMostDamage = 1 end end mostDamageName = mostDamageKiller:isMonster() and mostDamageKiller:getType():getNameDescription() or mostDamageKiller:getName() else mostDamageName = 'field item' end local KillersArray = {} for k, v in pairs(player:getDamageMap()) do local CreatureMT = Creature(k) if CreatureMT and CreatureMT:isPlayer() then table.insert(KillersArray, v:getName()) end end local playerGuid = player:getGuid() db.query('INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `is_player`, `mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`, `player_killers`) VALUES (' .. playerGuid .. ', ' .. os.time() .. ', ' .. player:getLevel() .. ', ' .. db.escapeString(killerName) .. ', ' .. byPlayer .. ', ' .. db.escapeString(mostDamageName) .. ', ' .. byPlayerMostDamage .. ', ' .. (unjustified and 1 or 0) .. ', ' .. (mostDamageUnjustified and 1 or 0) .. ', ' .. table.concat(KillersArray, ";") .. ')') local resultId = db.storeQuery('SELECT `player_id` FROM `player_deaths` WHERE `player_id` = ' .. playerGuid) local deathRecords = 0 local tmpResultId = resultId while tmpResultId ~= false do tmpResultId = result.next(resultId) deathRecords = deathRecords + 1 end if resultId ~= false then result.free(resultId) end local limit = deathRecords - maxDeathRecords if limit > 0 then db.asyncQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. playerGuid .. " ORDER BY `time` LIMIT " .. limit) end if byPlayer == 1 then local targetGuild = player:getGuild() targetGuild = targetGuild and targetGuild:getId() or 0 if targetGuild ~= 0 then local killerGuild = killer:getGuild() killerGuild = killerGuild and killerGuild:getId() or 0 if killerGuild ~= 0 and targetGuild ~= killerGuild and isInWar(playerId, killer.uid) then local warId = false resultId = db.storeQuery('SELECT `id` FROM `guild_wars` WHERE `status` = 1 AND ((`guild1` = ' .. killerGuild .. ' AND `guild2` = ' .. targetGuild .. ') OR (`guild1` = ' .. targetGuild .. ' AND `guild2` = ' .. killerGuild .. '))') if resultId ~= false then warId = result.getNumber(resultId, 'id') result.free(resultId) end if warId ~= false then db.asyncQuery('INSERT INTO `guildwar_kills` (`killer`, `target`, `killerguild`, `targetguild`, `time`, `warid`) VALUES (' .. db.escapeString(killerName) .. ', ' .. db.escapeString(player:getName()) .. ', ' .. killerGuild .. ', ' .. targetGuild .. ', ' .. os.time() .. ', ' .. warId .. ')') end end end end end
Não testei então tenta aí.
A identação saiu meio bugada umas partes mas não importa.
-
bpm91 deu reputação a ZoR em item que fala
local Messages = { [13495] = {Text = "Your soul will be mine", Color = 21}, [13496] = {Text = "Your soul will be mine", Color = 21} } function onUse(cid, item, fromPosition, itemEx, toPosition) doSendAnimatedText(item, Messages[item.itemid].Text, Messages[item.itemid].Color) return true end @bpm