Serginov
Onkonkoronkonk
Who is who?
cid - killer or the one who died?
target - the killer or the one who died?


cid - killer or the one who died?
target - the killer or the one who died?
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Killing streak" version="1.0" author="Slaktaren" contact="otland.net" enabled="yes">
local cfg = {
kills = 1234, -- storage
deaths = 2345, -- storage
kstreak_msg = {
-- 1,2,3,4,5,6,7 is the storage value, 1 means 2 kills. 2 means 3 kills. 3 means 4 kills and so on.
-- The default value is -1, which mean 0 kills.
-- For each kill you get +1 value, so if you want a message after 1 kill, just change the number to 0.
-- If you want a message on 3 kills just change the number to 2.
-- I hope you get it.
-- The same on dstreak_msg!
{1, "Double Kill!"},
{2, "Triple Kill!"},
{3, "Quad Kill!"},
{4, "M-M-M-Monster Kill!!"},
{5, "BLOODBATH!"},
{6, "UNSTOPPABLE!"},
{7, "GODLIKE!!"}},
dstreak_msg = {
{1, "on a death streak of 2 deaths in a row!"},
{2, "on a death streak of 3 deaths in a row!"},
{3, "on a death streak of 4 deaths in a row!"},
{4, "on a death streak of 5 deaths in a row!"},
{5, "on a death streak of 6 or more deaths in a row!"}},
}
<event type="kill" name="Kill streak" event="script"><![CDATA[
local k = cfg.kstreak_msg[cfg.#kstreak_msg]
local d = cfg.dstreak_msg[cfg.#kstreak_msg]
local ks, ds = getPlayerStorageValue(cid, cfg.kills), getPlayerStorageValue(cid, cfg.deaths)
if ks == k[1] then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(cid) .. " - " .. k[2], TALKTYPE_CHANNEL_O, 10)
end
end
if ks >= 7 then
for_, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(cid) .. " - " .. cfg.kstreak_msg[7][2], TALKTYPE_CHANNEL_O, 10)
end
end
if ds = d then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(target) .. " - " .. dmsg, TALKTYPE_CHANNEL_O, 10)
end
end
if ds >= 5 then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(target) .. " - " .. cfg.dstreak_msg[5][2], TALKTYPE_CHANNEL_O, 10)
end
end
if isPlayer(cid) then
setPlayerStorageValue(cid, cfg.kills, getPlayerStorageValue(cid, cfg.kills)+1)
setPlayerStorageValue(cid, cfg.deaths, -1) -- reseting death streak because you died.
end
if isPlayer(target) then
setPlayerStorageValue(target, cfg.deaths, getPlayerStorageValue(target, cfg.deaths)+1)
setPlayerStorageValue(target, cfg.kills, -1) -- reseting kill streak because you died.
end
]]></event>
</mod>
local cfg = {
kstreak_msg = {
{1, "Double Kill!"},
{2, "Triple Kill!"},
{3, "Quad Kill!"},
{4, "M-M-M-Monster Kill!!"},
{5, "BLOODBATH!"},
{6, "UNSTOPPABLE!"},
{7, "GODLIKE!!"}},
}
cfg.kstreak_msg[7][2]
cfg.kstreak_msg[LAST][2]
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Killing streak" version="1.0" author="Slaktaren" contact="otland.net" enabled="yes">
<config name="config"><![CDATA[
cfg = {
kills = 1234, -- storage
deaths = 2345, -- storage
kstreak_msg = {
-- 1,2,3,4,5,6,7 is the storage value, 1 means 2 kills. 2 means 3 kills. 3 means 4 kills and so on.
-- The default value is -1, which mean 0 kills.
-- For each kill you get +1 value, so if you want a message after 1 kill, just change the number to 0.
-- If you want a message on 3 kills just change the number to 2.
-- I hope you get it.
-- The same on dstreak_msg!
{1, "Double Kill!"},
{2, "Triple Kill!"},
{3, "Quad Kill!"},
{4, "M-M-M-Monster Kill!!"},
{5, "BLOODBATH!"},
{6, "UNSTOPPABLE!"},
{7, "GODLIKE!!"}
},
dstreak_msg = {
{1, "on a death streak of 2 deaths in a row!"},
{2, "on a death streak of 3 deaths in a row!"},
{3, "on a death streak of 4 deaths in a row!"},
{4, "on a death streak of 5 deaths in a row!"},
{5, "on a death streak of 6 or more deaths in a row!"}
},
}
]]></config>
<event type="kill" name="Kill streak" event="script"><![CDATA[
domodlib("config")
local k = cfg.kstreak_msg[cfg.#kstreak_msg]
local d = cfg.dstreak_msg[cfg.#kstreak_msg]
local ks, ds = getPlayerStorageValue(cid, cfg.kills), getPlayerStorageValue(cid, cfg.deaths)
if ks == k[1] then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(cid) .. " - " .. k[2], TALKTYPE_CHANNEL_O, 10)
end
end
if ks >= 7 then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(cid) .. " - " .. cfg.kstreak_msg[7][2], TALKTYPE_CHANNEL_O, 10)
end
end
if ds = d then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(target) .. " - " .. dmsg, TALKTYPE_CHANNEL_O, 10)
end
end
if ds >= 5 then
for _, tid in ipairs(getOnlinePlayers()) do
doPlayerSendChannelMessage(tid, "Streaks", getPlayerName(target) .. " - " .. cfg.dstreak_msg[5][2], TALKTYPE_CHANNEL_O, 10)
end
end
if isPlayer(cid) then
setPlayerStorageValue(cid, cfg.kills, getPlayerStorageValue(cid, cfg.kills)+1)
setPlayerStorageValue(cid, cfg.deaths, -1) -- reseting death streak because you died.
end
if isPlayer(target) then
setPlayerStorageValue(target, cfg.deaths, getPlayerStorageValue(target, cfg.deaths)+1)
setPlayerStorageValue(target, cfg.kills, -1) -- reseting kill streak because you died.
end
return true
]]></event>
</mod>
if ks >= cfg.kstreak_msg[LAST][1] then
i didnt even look in the script, it gave me a headache. i just tabbed it