samuel157
/root
- Joined
- Mar 19, 2010
- Messages
- 518
- Solutions
- 3
- Reaction score
- 71
- Location
- São Paulo, Brazil
- GitHub
- Samuel10M
NO FUNCTION
LUA:
-- kills.lua
function onSay(cid, words, param)
if not isPlayer(cid) then
return false
end
local playerGUID = getPlayerGUID(cid)
-- Query the killers table to get the number of unjustified kills
local resultId = db.storeQuery("SELECT COUNT(*) as total_unjustified FROM killers WHERE final_hit = " .. playerGUID .. " AND unjustified = 1")
if resultId ~= false then
local totalUnjustifiedKills = result.getDataInt(resultId, "total_unjustified")
-- Send the message to the player
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have killed " .. totalUnjustifiedKills .. " players without justification.")
-- Check if the player is close to getting a Red Skull or Black Skull
local redSkullLimit = getConfigValue("dailyFragsToRedSkull")
local blackSkullLimit = getConfigValue("dailyFragsToBlackSkull")
local banishmentLimit = getConfigValue("dailyFragsToBanishment")
if totalUnjustifiedKills >= redSkullLimit then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Warning! You are close to getting a Red Skull.")
elseif totalUnjustifiedKills >= blackSkullLimit then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Warning! You are close to getting a Black Skull.")
elseif totalUnjustifiedKills >= banishmentLimit then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Warning! You are close to being banned!")
end
result.free(resultId)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Could not retrieve your unjustified kills.")
end
return true
end