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

Reward from Killing Players (Help)

babalow

Nobody o/
Joined
Nov 7, 2007
Messages
393
Reaction score
1
Location
Brazil
well.. I made a function to add item to the killer but..
Is there a way to block players killing the same player to get reward?
I mean.. 3 players
PlayerA
PlayerB
PlayerC

PlayerA kill PlayerB -- add reward (PlayerA last kill PlayerB)
PlayerA kill PlayerB -- no reward
PlayerA kill PlayerC -- add reward (PlayerA last kill PlayerC)
...

My english is too sux to explain it =/
I hope someone understand.
 
there you go.. I hope it's self explained what you have to add etc.

Lua:
function onKill(cid, target)
local storage = 60000 -- storagevalue which is used to store the PlayerUID, to check if he killed the player just before.
	if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
		if getPlayerStorageValue(cid, storage) ~= getPlayerGUID(target) then
			-- code if he should get the items.
			setPlayerStorageValue(cid, storage, getPlayerGUID(target))
		else
			-- code if he doesn't get items.
		end
	end
	return TRUE
end


kind regards, Evil Hero.
 
Back
Top