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

Frag error

Kriggarrn

New Member
Joined
Aug 23, 2019
Messages
24
Reaction score
2
can someone help me with this issue

16:33 Warning! The murder of Training was not justified.

16:33 You currently have 0 frags today, 0 this week and 0 this month.

always when play kill someone he did not take a frag
im using tfs 0.4 i trying to change the frag.lua but nothing happened if someone has idea just tell me
thanks.
 
here you are

Config.

Code:
accountManager = true
namelockManager = true
newPlayerChooseVoc = true
newPlayerSpawnPosX = 32109
newPlayerSpawnPosY = 31938
newPlayerSpawnPosZ = 7
newPlayerTownId = 1
newPlayerLevel = 8
newPlayerMagicLevel = 0
generateAccountNumber = false
generateAccountSalt = false

useFragHandler = true
redSkullLength = 2 * 24 * 60 * 60
blackSkullLength = 3 * 24 * 60 * 60
dailyFragsToRedSkull = 10
weeklyFragsToRedSkull = 15
monthlyFragsToRedSkull = 20
dailyFragsToBlackSkull = 50
weeklyFragsToBlackSkull = 60
monthlyFragsToBlackSkull = 200
dailyFragsToBanishment = dailyFragsToRedSkull
weeklyFragsToBanishment = weeklyFragsToRedSkull
monthlyFragsToBanishment = monthlyFragsToRedSkull
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
useBlackSkull = true
advancedFragList = false

notationsToBan = 3
warningsToFinalBan = 4
warningsToDeletion = 5
banLength = 7 * 24 * 60 * 60
killsBanLength = 7 * 24 * 60 * 60
finalBanLength = 30 * 24 * 60 * 60
ipBanishmentLength = 1 * 24 * 60 * 60
broadcastBanishments = false
maxViolationCommentSize = 200
violationNameReportActionType = 2
autoBanishUnknownBytes = false

worldType = "open"
protectionLevel = 100
pvpTileIgnoreLevelAndVocationProtection = true
pzLocked = 60 * 1000
huntingDuration = 60 * 1000
criticalHitChance = 7
criticalHitMultiplier = 1
displayCriticalHitNotify = false
removeWeaponAmmunition = false
removeWeaponCharges = true
removeRuneCharges = false
whiteSkullTime = 10 * 60 * 1000
noDamageToSameLookfeet = false
showHealingDamage = true
showHealingDamageForMonsters = false
fieldOwnershipDuration = 5 * 1000
stopAttackingAtExit = false
loginProtectionPeriod = 10 * 1000
deathLostPercent = 7
stairhopDelay = 2 * 1000
pushCreatureDelay = 2 * 500
deathContainerId = 1987
gainExperienceColor = 215
addManaSpentInPvPZone = true
squareColor = 0
allowFightback = true
fistBaseAttack = 7

worldId = 0
ip = "127.0.0.1"
bindOnlyGlobalAddress = false
loginPort = 7171
gamePort = 7172
loginTries = 5
retryTimeout = 5 * 1000
loginTimeout = 60 * 1000
maxPlayers = 500
motd = "*Welcome to GhostOt Server*"
displayOnOrOffAtCharlist = false
onePlayerOnlinePerAccount = false
allowClones = false
serverName = "GhostOt"
loginMessage = "GhostOt, Everyday news."
statusTimeout = 5 * 60 * 1000
replaceKickOnLogin = true
forceSlowConnectionsToDisconnect = false
loginOnlyWithLoginServer = false
premiumPlayerSkipWaitList = false
enableCast = true
healthHealingColor = 29

sqlType = "sqlite"
sqlHost = "127.0.0.1"
sqlPort = 3306
sqlUser = "root"
sqlPass = ""
sqlDatabase = "GhostOt"
sqlFile = "forgottenserver.s3db"
sqlKeepAlive = 0
mysqlReadTimeout = 10
mysqlWriteTimeout = 10
encryptionType = "plain"

deathListEnabled = true
deathListRequiredTime = 1 * 60 * 1000
deathAssistCount = 19
maxDeathRecords = 5

ingameGuildManagement = true
levelToFormGuild = 60
premiumDaysToFormGuild = 0
guildNameMinLength = 4
guildNameMaxLength = 20

highscoreDisplayPlayers = 15
updateHighscoresAfterMinutes = 60

buyableAndSellableHouses = true
houseNeedPremium = false
bedsRequirePremium = false
levelToBuyHouse = 100
housesPerAccount = 1
houseRentAsPrice = true
housePriceAsRent = false
housePriceEachSquare = 1000
houseRentPeriod = "monthly"
houseCleanOld = 0
guildHalls = false

timeBetweenActions = 200
timeBetweenExActions = 1000
hotkeyAimbotEnabled = true

mapName = "map.otbm"
mapAuthor = "Gryby"
randomizeTiles = true
storeTrash = true
cleanProtectedZones = true
mailboxDisabledTowns = ""

defaultPriority = "high"
niceLevel = 5
coresUsed = "-1"

startupDatabaseOptimization = true
updatePremiumStateAtStartup = true
confirmOutdatedVersion = false

formulaLevel = 5.0
formulaMagic = 1.0
bufferMutedOnSpellFailure = false
spellNameInsteadOfWords = false
emoteSpells = false

allowChangeOutfit = true
allowChangeColors = true
allowChangeAddons = true
disableOutfitsForPrivilegedPlayers = false
addonsOnlyPremium = false

dataDirectory = "data/"
logsDirectory = "data/logs/"
bankSystem = true
displaySkillLevelOnAdvance = false
promptExceptionTracerErrorBox = true
maximumDoorLevel = 2000
maxMessageBuffer = 4

separateVipListPerCharacter = false
vipListDefaultLimit = 20
vipListDefaultPremiumLimit = 100

saveGlobalStorage = true
useHouseDataStorage = false
storePlayerDirection = false

checkCorpseOwner = true
monsterLootMessage = 3
monsterLootMessageType = 25

ghostModeInvisibleEffect = true
ghostModeSpellEffects = true

idleWarningTime = 14 * 60 * 10000000000
idleKickTime = 14 * 60 * 10000000000
reportsExpirationAfterReads = 1
playerQueryDeepness = 2
tileLimit = 0
protectionTileLimit = 0
houseTileLimit = 0

freePremium = true
premiumForPromotion = false

blessings = true
blessingOnlyPremium = false
blessingReductionBase = 30
blessingReductionDecrement = 5
eachBlessReduction = 8

experienceStages = true
rateExperience = 400.0
rateExperienceFromPlayers = 1
rateSkill = 35
rateMagic = 25
rateLoot = 10
rateSpawn = 5

rateMonsterHealth = 1.0
rateMonsterMana = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0

minLevelThresholdForKilledPlayer = 0.9
maxLevelThresholdForKilledPlayer = 1.1

rateStaminaLoss = 1
rateStaminaGain = 3
rateStaminaThresholdGain = 24
staminaRatingLimitTop = 40 * 60
staminaRatingLimitBottom = 14 * 60
staminaLootLimit = 14 * 60
rateStaminaAboveNormal = 1.0
rateStaminaUnderNormal = 0.5
staminaThresholdOnlyPremium = true

experienceShareRadiusX = 30
experienceShareRadiusY = 30
experienceShareRadiusZ = 1
experienceShareLevelDifference = 2 / 3
extraPartyExperienceLimit = 20
extraPartyExperiencePercent = 5
experienceShareActivity = 2 * 60 * 1000

globalSaveEnabled = false
globalSaveHour = 8
globalSaveMinute = 0
shutdownAtGlobalSave = true
cleanMapAtGlobalSave = false

deSpawnRange = 2
deSpawnRadius = 50

maxPlayerSummons = 2
teleportAllSummons = false
teleportPlayerSummons = false

statusPort = 7171
ownerName = "GhostOt"
ownerEmail = ""
url = "http://orion-otserv.servegame.com"
location = "brazil"
displayGamemastersWithOnlineCommand = false

displayPlayersLogging = true
prefixChannelLogs = ""
runFile = ""
outputLog = ""
truncateLogOnStartup = false

managerPort = 7171
managerLogs = true
managerPassword = ""
managerLocalhostOnly = true
managerConnectionsLimit = 1

adminPort = 7171
adminLogs = true
adminPassword = ""
adminLocalhostOnly = true
adminConnectionsLimit = 1
adminRequireLogin = true
adminEncryption = ""
adminEncryptionData = ""

frag.lua
Code:
local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
    advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}

function onSay(cid, words, param, channel)
    if(not config.useFragHandler) then
        return false
    end

    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}

    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {
                name = result:getDataString("name"),
                level = result:getDataInt("level"),
                date = result:getDataInt("date")
            }
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end

    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }
    if(config.advancedFragList) then
        local result = "Frags gained today: " .. size.day .. "."
        if(size.day > 0) then
            for _, content in ipairs(contents.day) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
        if(size.week > 0) then
            for _, content in ipairs(contents.week) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
        if(size.month > 0) then
            for _, content in ipairs(contents.month) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
        end

        doPlayerPopupFYI(cid, result)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
        if(size.day > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
        end
    end

    return true
end

login.lua

Code:
local config = {
    loginMessage = getConfigValue('loginMessage'),
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 7)
    end

    local accountManager = getPlayerAccountManager(cid)
    if(accountManager == MANAGER_NONE) then
        local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
        if(lastLogin > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
            str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
        else
            str = str .. " Please choose your outfit."
            doPlayerSendOutfitWindow(cid)
        end

        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
    elseif(accountManager == MANAGER_NAMELOCK) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
    elseif(accountManager == MANAGER_ACCOUNT) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
    end

    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end

    registerCreatureEvent(cid, "firstItems")
    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "GuildMotd")
    registerCreatureEvent(cid, "RushCombat")
    registerCreatureEvent(cid, "RushAttack")
    registerCreatureEvent(cid, "RushDead")
    registerCreatureEvent(cid, "RushOutfit")
    registerCreatureEvent(cid, "FragReward") 
    registerCreatureEvent(cid, "dodge")
    registerCreatureEvent(cid, "critical")
    registerCreatureEvent(cid, "BattlefieldCombat")
    registerCreatureEvent(cid, "BattlefieldAttack")
    registerCreatureEvent(cid, "BattlefieldDead")
    registerCreatureEvent(cid, "BattlefieldOutfit")

    
    registerCreatureEvent(cid, "critical")
    if getPlayerStorageValue(cid, 48913) == -1 then
        setPlayerStorageValue(cid, 48913, 0)
    end
    
    registerCreatureEvent(cid, "dodge")
    if getPlayerStorageValue(cid, 48902) == -1 then
        setPlayerStorageValue(cid, 48902, 0)
    end



    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end

    registerCreatureEvent(cid, 'ZombieAttack')
    registerCreatureEvent(cid, "levelUp")
    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")
    return true
end

about the skullcheck i dont know which one should i send? and about the flag.lua this one i sent which i'm using as a talkactions one you know, which use as !frags.
thanks for reply and hope you find the issue.
 
in config.lua change and retry.
Lua:
advancedFragList = false
to
Lua:
advancedFragList = true
 
nothing happened only found this on !frags command instead of this
Code:
16:33 You currently have 0 frags today, 0 this week and 0 this month.
x-png.39046


and also
21:09 Warning! The murder of Training was not justified.
 

Attachments

Try this one instead of your frag.lua and are you getting any errors on player death in console? Like mysql error?
Lua:
function onSay(cid, words, param, channel)
    if(not getBooleanFromString(getConfigValue('useFragHandler'))) then
        return false
    end

    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}

    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `k`.`war` = 0 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {
                name = result:getDataString("name"),
                level = result:getDataInt("level"),
                date = result:getDataInt("date")
            }
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end

    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }

    if(getBooleanFromString(getConfigValue('advancedFragList'))) then
        local result = "Frags gained today: " .. size.day .. "."
        if(size.day > 0) then
            for _, content in ipairs(contents.day) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
        if(size.week > 0) then
            for _, content in ipairs(contents.week) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
        if(size.month > 0) then
            for _, content in ipairs(contents.month) do
                result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
            end

            result = result .. "\n"
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
        end

        doPlayerPopupFYI(cid, result)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
        if(size.day > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
        end

        local skullEnd = getPlayerSkullEnd(cid)
        if(skullEnd > 0) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
        end
    end

    return true
end
 
still
21:17 You currently have 0 frags today, 0 this week and 0 this month.
i think its not the talkaction ( !frags) issue, its something else but i don't know what is it .
and no i dont have any error, i'm still using sqlite btw
 
You are killing yourself on same ip using MC? in your login.lua this frag reward
registerCreatureEvent(cid, "FragReward")
allows killing players on same ip?
 
this fragrewar is just a reward when u kill other player i take a reward but i dont know about the MC how to allow it?
and btw the frag issue was not working before i add the fragrewar thing
 
Yeah that is related to your database as I thought and I asked above if you have database related errors on console.
Now you'll have to insert this query to your database.
SQL:
ALTER TABLE `killers` ADD `war` TINYINT(1) NOT NULL DEFAULT 0;
If it didn't work try this one
SQL:
ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
If it didn't work then try this one should work.
SQL:
CREATE TABLE IF NOT EXISTS `guild_wars` (

  `id` INT NOT NULL AUTO_INCREMENT,

  `guild_id` INT NOT NULL,

  `enemy_id` INT NOT NULL,

  `begin` BIGINT NOT NULL DEFAULT '0',

  `end` BIGINT NOT NULL DEFAULT '0',

  `frags` INT UNSIGNED NOT NULL DEFAULT '0',

  `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0',

  `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0',

  `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0',

  `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',

  PRIMARY KEY (`id`),

  KEY `status` (`status`),

  KEY `guild_id` (`guild_id`),

  KEY `enemy_id` (`enemy_id`)

) ENGINE=InnoDB;



ALTER TABLE `guild_wars`

  ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE,

  ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;



ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`;



CREATE TABLE IF NOT EXISTS `guild_kills` (

  `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

  `guild_id` INT NOT NULL,

  `war_id` INT NOT NULL,

  `death_id` INT NOT NULL

) ENGINE = InnoDB;



ALTER TABLE `guild_kills`

  ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE,

  ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE,

  ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;



ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
 
Thank you I will do that but I left home atm
I have 1 more question I'm using sqlite right now as I told you and after I finish fixing my server I will insert my database with uniform to make the website then I will insert those codes to the phpmyadmin website right?
 
Yeah you'll have to insert them to phpmyadmin here, Just try one by one first one should work I guess.
inzert.PNG
 
Solution
Back
Top