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

Lua Help deathchannel I wanted the level and reset to appear I wand show Level (1) and Reset [1] example

samuel157

/root
Joined
Mar 19, 2010
Messages
189
Solutions
1
Reaction score
17
Location
São Paulo, Brazil
GitHub
Samuel10M
21:00: Player Name (3435) [23] id dead for player Pallydin (56822) [47]

21:00: Player Name Level (3435) Reset [23] id dead for player Player x Level (56822) Reset [47]

data\creaturescripts\scripts\deathchannel.lua

Lua:
-- Coded by Zoom..
local info, win, lose = "%s [Level: %s] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos."
local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 150, 200, 250, 300}, 30045

function onDeath(cid, corpse, deathList)
if(not isPlayer(cid)) then
return true
end

local target = deathList[1]
doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1))

for _, pid in ipairs(getPlayersOnline()) do
doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_O, 0xF)
for _, frag in ipairs(frags) do
if(getCreatureStorage(target, storage) == frag) then
doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_W, 0xF)
end

if(getCreatureStorage(cid, storage) >= frag) then
doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_CHANNEL_RN, 0xF)
end
end
end

doCreatureSetStorage(cid, storage, 0)
return true
end
 
Solution
@Levi999x 54676 <- id storage of reset. I want show reset and level example: Player Level (1) Reset [1] this way

Lua:
-- Coded by Zoom..
local info, win, lose = "%s (Level: %s) [Reset: %d] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos."
local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 150, 200, 250, 300}, 30045

function onDeath(cid, corpse, deathList)
    local target = deathList[1]
    doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1))
    for _, pid in ipairs(getPlayersOnline()) do...

Roddet

::continue::
Premium User
Joined
May 1, 2013
Messages
482
Solutions
33
Reaction score
221
Location
mx
@Levi999x 54676 <- id storage of reset. I want show reset and level example: Player Level (1) Reset [1] this way

Lua:
-- Coded by Zoom..
local info, win, lose = "%s (Level: %s) [Reset: %d] foi mort%s pelo %s %s%s", "%s obteve %s frags seguidos após derrotar %s.", "%s acabou de impedir que %s fizesse uma sequência de %s frags seguidos."
local frags, storage = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 150, 200, 250, 300}, 30045

function onDeath(cid, corpse, deathList)
    local target = deathList[1]
    doCreatureSetStorage(target, storage, getCreatureStorage(target, storage) + (getCreatureStorage(target, storage) == -1 and 2 or 1))
    for _, pid in ipairs(getPlayersOnline()) do
        doPlayerSendChannelMessage(pid, '', info:format(getCreatureName(cid),getPlayerLevel(cid), getPlayerStorageValue(54676), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_CHANNEL_O, 0xF)
        for _, frag in ipairs(frags) do
            if(getCreatureStorage(target, storage) == frag) then
                doPlayerSendChannelMessage(pid, '', win:format(getCreatureName(target), frag, getCreatureName(cid)), TALKTYPE_CHANNEL_W, 0xF)
            end
            if(getCreatureStorage(cid, storage) >= frag) then
                doPlayerSendChannelMessage(pid, '', lose:format(getCreatureName(target), getCreatureName(cid), getCreatureStorage(cid, storage)+1), TALKTYPE_CHANNEL_RN, 0xF)
            end
        end
    end
    doCreatureSetStorage(cid, storage, 0)
    return true
end
 
Solution
Top