Bassam421
Lockout RPG/PVP Owner
Code:
local block_kills_acc = {}
local block_kills_ip = {}
local max_kills_per_target_account = 3
local max_kills_per_target_ip = 5
function onKill(cid, target)
if(isPlayer(target)) then
if(block_kills_acc[getPlayerGUID(cid)] == nil) then
block_kills_acc[getPlayerGUID(cid)] = {}
end
if(block_kills_acc[getPlayerGUID(cid)][getPlayerAccountId(target)] == nil) then
block_kills_acc[getPlayerGUID(cid)][getPlayerAccountId(target)] = 0
end
block_kills_acc[getPlayerGUID(cid)][getPlayerAccountId(target)] = block_kills_acc[getPlayerGUID(cid)][getPlayerAccountId(target)] + 1
if(block_kills_ip[getPlayerGUID(cid)] == nil) then
block_kills_ip[getPlayerGUID(cid)] = {}
end
if(block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] == nil) then
block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] = 0
end
block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] = block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] + 1
if(block_kills_acc[getPlayerGUID(cid)][getPlayerAccountId(target)] <= max_kills_per_target_account and block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] <= max_kills_per_target_ip) then
doPlayerAddItem(cid,2152,20)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You have Owned " .. getCreatureName(target) .. ". You get 2k.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You killed " .. getCreatureName(target) .. " too many times. NO REWARD!")
end
end
return TRUE
end
if some1 can edit this to make the person who dies lose 1 honor, and the player rescive 1 honor?