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

Lua Script fix

Bassam421

Lockout RPG/PVP Owner
Joined
Nov 8, 2008
Messages
359
Reaction score
7
Location
Sweden , Göteborg
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?
 
Before:
LUA:
block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] = block_kills_ip[getPlayerGUID(cid)][getPlayerIp(target)] + 1

Add:
LUA:
YOURFUNCTIONTOSETHONOR(target, YOURFUNCTIONTOGETHONOR(target)-1)
 
Back
Top