local config = {
fragTime = getConfigInfo('timeToDecreaseFrags'),
fragToBan = getConfigInfo('killsToBan')
}
function onSay(cid, words, param)
maxfrag = config.fragToBan
local amount = getPlayerRedSkullTicks(cid)
if(amount > 0 and config.fragTime > 0) then
local frags = (amount / config.fragTime);
frags = math.ceil(frags)
local remainingTime = amount
local hours = ((remainingTime / 1000) / 60) / 60;
hours = math.floor(hours)
local minutes = ((remainingTime / 1000) / 60) - (hours * 60);
minutes = math.floor(minutes)
text = ""
if(frags == maxfrag-1) then
text = "Warning!!! You have " ..frags.. " unjustified frag" .. (frags > 2 and "s" or "") .. ". If you have "..maxfrag.." frags you been banned."
else
text = "You have " .. frags .. " unjustified frag" .. (frags > 2 and "s" or "") .. "."
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..text.." The amount of unjustified frags will decrease after: " .. hours .. "h and " .. minutes .. "m.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified frag.")
end
return TRUE
end