• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Free Exp Auto ban Script

tanii

Empire-war.com
Joined
Jan 16, 2015
Messages
383
Solutions
1
Reaction score
12
Hello i have war server and players are giving free exp with NO MCS pls there are any script to solv this problem @Limos pls help me!!
 
1) Limos have exams idk if she have time atm.
2) Don't tag people in your post. I am sure she will answer your thread. Just wait until she finished her exams. You don't need to tag people they will eventually see your post.
 
1) Limos have exams idk if she have time atm.
2) Don't tag people in your post. I am sure she will answer your thread. Just wait until she finished her exams. You don't need to tag people they will eventually see your post.
bro u got any idea of this how to solv etc???
 
Here is a skeleton that can be used in 2 different ways.
1. You can make it ban (I've added this functionality by default)
2. You can remove the ban and add an exp system to it. (this will basically prevent exp from being granted to player that bypass the kill limit)

I have added some extra stuff and commented it out for people who wish to use it, this script is tested on 0.4
Sorry that it is so bare-bones but I do not have the time to make a war server exp system from scratch.

Tldr on what this script does:
It is based on IP, if player A kills player B 3 times within 10 minutes (default) the next kill will ban for 30 minutes. If you so chose to disable the ban function and add your own exp system then this script will give exp for the first 3 kills (default) and prevent all exp gain thereafter until the 10 minute timer (default) expires.

I DO STRONGLY RECOMMEND MAKING YOUR OWN EXP SYSTEM INSTEAD OF JUST BANNING PEOPLE AS INNOCENT PLAYERS COULD BE BANNED IF THEY ACCIDENTALLY KILL THE SAME PLAYER MORE THAN 3 TIMES IN 10 MINUTES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code:
local killLimit = 3 -- How many kills before the player will no longer gain exp
local timerLength = 10*60 -- how long before a player can gain exp from the same player after reaching the limit (time is in seconds, 10*60 = 10 minutes)

local ipTables = {
    -- This is an example of what the table will look like after it is populated in-game (you do not edit anything inside this table ever!)
   
    -- [player ip] = {
        -- [victim ip] = {kills = 0, timer = os.time()}
    -- }
}


function onKill(cid, target, damage, flags)
    if(not isPlayer(target)) then return true end
   
    local cidIp = getPlayerIp(cid)
    if(not ipTables[cidIp]) then
        ipTables[cidIp] = {}
    end
   
    local targetIp = getPlayerIp(target)
    if(not ipTables[cidIp][targetIp]) then
        ipTables[cidIp][targetIp] = {kills = 1, timer = os.time()+timerLength}
    else
        local targetInfo = ipTables[cidIp][targetIp]
        if(targetInfo.timer < os.time()) then
            targetInfo.kills = 0
            targetInfo.timer = os.time()+timerLength
        end
       
        if(targetInfo.kills >= killLimit) then
            -- do not give exp (possible ban script goes here if you want)
            doAddAccountBanishment(getPlayerAccountId(cid), 3, os.time()+(30*60), 11, 2, "Free Exping (30 minute ban)")
            doRemoveCreature(cid)
        else
            -- give exp script goes here(you will have to figure out a way to calculate exp gain here...)
           
           
           
            -- This will add a kill to the count
            targetInfo.kills = targetInfo.kills+1
            -- This will refresh the timer after each kill pre-limit
            -- targetInfo.timer = os.time()+timerLength
        end
    end   
    return true
end
 
Here is a skeleton that can be used in 2 different ways.
1. You can make it ban (I've added this functionality by default)
2. You can remove the ban and add an exp system to it. (this will basically prevent exp from being granted to player that bypass the kill limit)

I have added some extra stuff and commented it out for people who wish to use it, this script is tested on 0.4
Sorry that it is so bare-bones but I do not have the time to make a war server exp system from scratch.

Tldr on what this script does:
It is based on IP, if player A kills player B 3 times within 10 minutes (default) the next kill will ban for 30 minutes. If you so chose to disable the ban function and add your own exp system then this script will give exp for the first 3 kills (default) and prevent all exp gain thereafter until the 10 minute timer (default) expires.

I DO STRONGLY RECOMMEND MAKING YOUR OWN EXP SYSTEM INSTEAD OF JUST BANNING PEOPLE AS INNOCENT PLAYERS COULD BE BANNED IF THEY ACCIDENTALLY KILL THE SAME PLAYER MORE THAN 3 TIMES IN 10 MINUTES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code:
local killLimit = 3 -- How many kills before the player will no longer gain exp
local timerLength = 10*60 -- how long before a player can gain exp from the same player after reaching the limit (time is in seconds, 10*60 = 10 minutes)

local ipTables = {
    -- This is an example of what the table will look like after it is populated in-game (you do not edit anything inside this table ever!)
  
    -- [player ip] = {
        -- [victim ip] = {kills = 0, timer = os.time()}
    -- }
}


function onKill(cid, target, damage, flags)
    if(not isPlayer(target)) then return true end
  
    local cidIp = getPlayerIp(cid)
    if(not ipTables[cidIp]) then
        ipTables[cidIp] = {}
    end
  
    local targetIp = getPlayerIp(target)
    if(not ipTables[cidIp][targetIp]) then
        ipTables[cidIp][targetIp] = {kills = 1, timer = os.time()+timerLength}
    else
        local targetInfo = ipTables[cidIp][targetIp]
        if(targetInfo.timer < os.time()) then
            targetInfo.kills = 0
            targetInfo.timer = os.time()+timerLength
        end
      
        if(targetInfo.kills >= killLimit) then
            -- do not give exp (possible ban script goes here if you want)
            doAddAccountBanishment(getPlayerAccountId(cid), 3, os.time()+(30*60), 11, 2, "Free Exping (30 minute ban)")
            doRemoveCreature(cid)
        else
            -- give exp script goes here(you will have to figure out a way to calculate exp gain here...)
          
          
          
            -- This will add a kill to the count
            targetInfo.kills = targetInfo.kills+1
            -- This will refresh the timer after each kill pre-limit
            -- targetInfo.timer = os.time()+timerLength
        end
    end  
    return true
end
@Xagul there are problem bro if 3 persons kill to 1 person 3 time all 3 persons banned! lolz show to solv this
 
Yes that is sorta how it works... 3 ppl get exp from kill = 3 ppl that can abuse free exp = 3 ppl get banned.
 
Back
Top