pawlacz741
New Member
- Joined
- Jan 23, 2009
- Messages
- 90
- Reaction score
- 2
Hello can somebody edit my script to it: buy first look
Its killing MC and free fraging but its not good idea to kill and don't always kill player becouse when he kill random player he get lvl and 5 hp more and script don't kill him..
Somebody have other idea to antyfrag? Meaby somebody can to do teleport to position XXX? Or change it to don't get exp for player when u kill that same player 5 times.
Sry but my english is low..
function onKill(cid, target, lastHit)
local timeWithinKill = 40 --in seconds
local killsLimit = 5 --limit to die
local lastKill, lastKillTime = nil, nil
local storage = 65535 --storage to check if player has killed another player 'killsLimit' times
if(isPlayer(target) == false) or (isMonster(cid) == true) then
return true
end
query = db.getResult("select lastKill, lastKillTime from players where id = " .. getPlayerGUID(cid) .. ";")
if(query:getID() ~= -1) then
lastKill, lastKillTime = query:getDataInt("lastKill"), query:getDataInt("lastKillTime")
if(lastKill == getPlayerGUID(target)) then
if(os.clock() - lastKillTime) < timeWithinKill then
if(getPlayerStorageValue(cid, storage) < 0) then
doPlayerSetStorageValue(cid, storage, 0)
end
doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
if(getPlayerStorageValue(cid, storage) >= killsLimit) then
doCreatureAddHealth(cid, -getCreatureHealth(cid))
doPlayerSendTextMessage(cid,22,"FREE FRAGING OR MC = DEATH")
end
else
doPlayerSetStorageValue(cid, storage, 0)
end
end
db.executeQuery("update players set lastKill = " .. getPlayerGUID(target) .. ", lastKillTime = " .. os.clock() .. " where id = " .. getPlayerGUID(cid) .. ";")
else
return LUA_ERROR
end
return true
end
Its killing MC and free fraging but its not good idea to kill and don't always kill player becouse when he kill random player he get lvl and 5 hp more and script don't kill him..
Somebody have other idea to antyfrag? Meaby somebody can to do teleport to position XXX? Or change it to don't get exp for player when u kill that same player 5 times.
Sry but my english is low..