andypsylon
be be
on request:
http://otland.net/f132/i-found-script-lucaszolson-please-someone-can-you-edit-rep-146067/
What it does?
After killing X times the same target(player) from the same ip, killer gets a black skull for X minutes.
Then killer can no longer attack during this time!
in data\creaturescripts\creaturescripts.xml insert:
in data\creaturescripts\scripts\login.lua insert:
create data\creaturescripts\scripts\kill_fromIp.lua and insert:
is not optimal
but it works nicely on tfs 0.4
0.3.6 should also
http://otland.net/f132/i-found-script-lucaszolson-please-someone-can-you-edit-rep-146067/
Easy to modify
With no storage and no queries to the database!
With no storage and no queries to the database!
What it does?
After killing X times the same target(player) from the same ip, killer gets a black skull for X minutes.
Then killer can no longer attack during this time!
in data\creaturescripts\creaturescripts.xml insert:
XML:
<event type="kill" name="killFromIp" event="script" value="kill_fromIp.lua"/>
Lua:
registerCreatureEvent(cid, "killFromIp")
Lua:
-- ver. 2 2011-12-08
-- author tfs, otland.net/members/andypsylon
--
local c = {
minutes = 3,
maxAccKill = 3,
maxIpKill = 3
}
local blokAcc, blokIP, killweiter = {}, {}, 0
function killFromIp(pid, tid, min)
local upid, utid, ipid = getPlayerGUID(pid), getPlayerGUID(tid), getPlayerIp(tid)
if min == 0 then
blokAcc[upid][utid], blokIP[upid][ipid] = 0, 0
local skull, skullEnd = getCreatureSkull(pid), getPlayerSkullEnd(pid)
doCreatureSetSkullType(pid, 0)
if(skullEnd > 0 and skull > SKULL_BLACK and os.time() > skullEnd) then
doPlayerSetSkullEnd(pid, 0, skull)
end
doCreatureSetSkullType(pid, SKULL_WHITE)
doPlayerSetSkullEnd(pid, os.time() + c.minutes*60*1000, SKULL_WHITE)
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your ".. c.minutes .."min have passed.")
else
if not blokAcc[upid] then
blokAcc[upid], blokIP[upid] = {}, {}
end
blokAcc[upid][utid] = (blokAcc[upid][utid] or 0) + 1
blokIP[upid][ipid] = (blokIP[upid][ipid] or 0) + 1
if blokAcc[upid][utid] >= c.maxAccKill and blokIP[upid][ipid] >= c.maxIpKill then
doCreatureSetSkullType(pid, SKULL_BLACK)
doPlayerSetSkullEnd(pid, os.time() + c.minutes*60*1000, SKULL_BLACK)
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed ".. getCreatureName(tid) .." too many times. Black skull for ".. c.minutes .."min.")
end
stopEvent(killweiter)
killweiter = addEvent(killFromIp, min, pid, tid, 0)
end
end
function onKill(cid, target, lastHit)
if(not isPlayer(target)) then return true end
killFromIp(cid, target, c.minutes*60*1000)
return true
end
is not optimal
but it works nicely on tfs 0.4
0.3.6 should also
Last edited: