script_name("killInformer")
local sampev = require("samp.events")
local inicfg = require("inicfg")
local path = thisScript().name
local ini = inicfg.load({
set = {
x = 500,
y = 500
}
}, path)
local font = renderCreateFont("Arial", 10, 13)
local kills = 0
local deaths = 0
local gived = 0
local taked = 0
function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand("kipos", changepos)
while true do wait(0)
local format = string.format("{FFFFFF}Kills: {00FF00}%s \n{FFFFFF}Deaths: {FF0000}%s \n{FFFFFF}GiveDamage: {00FF00}%s \n{FFFFFF}TakeDamage: {FF0000}%s", kills, deaths, gived, taked)
renderFontDrawText(font, format, ini.set.x, ini.set.y, -1)
end
end
function sampev.onSendGiveDamage(id, damage, weapon, bodypart)
if damage then
gived = gived + math.floor(damage)
end
end
function sampev.onSendTakeDamage(id, damage, weapon, bodypart)
if damage then
taked = taked + math.floor(damage)
end
end
function sampev.onPlayerDeathNotification(killer1, killer2, reason)
bool, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
if killer1 == id then
kills = kills + 1
else
if killer2 == id then
death = death + 1
end
end
end
function changepos()
lua_thread.create(function()
while not isKeyJustPressed(0x01) do wait(0)
sampSetCursorMode(4)
ini.set.x, ini.set.y = getCursorPos()
end
sampSetCursorMode(0)
inicfg.save(ini, path)
end)
end