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

Error in onKill event, reward to kill players

Status
Not open for further replies.

docma

New Member
Joined
Feb 21, 2011
Messages
14
Reaction score
0
Hi, i use this script

http://otland.net/f132/kill-player-gain-1-platinum-coin-rep-kill-reward-126811/

But look the error

errorfrags.jpg


I have this now
Code:
function onKill(cid, target, lastHit)
	local reward = {
			item = 2152, --ITEM ID!
			count = 1 -- How many?
	}
    if(isPlayer(cid) and isPlayer(target)) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
            doPlayerAddItem(cid, reward.item, reward.count)
		else
			doPlayerAddExperience(cid, -1000000)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
		end
	end
	return TRUE
end

I try with empty funcion, but don't work
Code:
function onKill(cid, target, lastHit)
end

please help :>
 
Lua:
function onKill(cid, target, lastHit)
	local rewardItem = {
		2152, --ITEM ID!
		1 -- How many?
	}
   
	if isPlayer(cid) and isPlayer(target) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
			doPlayerAddItem(cid, rewardItem[1], rewardItem[2])
		else
			doPlayerAddExperience(cid, -1000000)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have been punished for killing a player of the same IP.")
		end
	end
	return true
end
 
Status
Not open for further replies.
Back
Top