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

I Search Frag Rewand Scipts [Rep++]

rege stail

New Member
Joined
Jul 16, 2009
Messages
150
Reaction score
4
I Search Frag Rewand Scipts with options :

1.three Kill this same player , Don't Give items/frags.
2.Frags for killer , not for everyone.

Pls Give me Scripts Rep ++
 
It's not tested. You have to add this feature "1.three Kill this same player , Don't Give items/frags."
Lua:
function onDeath(cid, corpse, deathList)
local reward = {
        item = 2152,
        count = 1
}
	for i = 1, #deathList do
		if isPlayer(cid) and isPlayer(deathList[i]) then
			--[[if getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then	]]--	
				if getPlayerItemCount(deathList[i], reward.item) > 0 then
					local item = getPlayerItemById(deathList[i], true, reward.item)
					if item.type >= ITEMCOUNT_MAX then
						doPlayerAddItem(deathList[i], reward.item, reward.count)
						setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
						doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
						doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
					else
						doTransformItem(item.uid, reward.item, item.type + 1)
						doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
						doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
					end
				else
					doPlayerAddItem(deathList[i], reward.item, reward.count)
					setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
					doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
					doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
				end
			--[[else
					doPlayerSendTextMessage(deathList[i], 18, "You didn't get frag/reward because of killing a player with same ip.")
					doPlayerAddExperience(cid,  - 500000)
			end ]]--
		end
	end
	return true
end


Simplest
Lua:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152,
        exp = 10000,
        count = 1
}
        if(isPlayer(cid) and isPlayer(target)) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
		setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
		else
			doPlayerAddExperience(cid, -reward.exp)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
		end
	end
return TRUE
end

If you add this feature please post here
1.three Kill this same player , Don't Give items/frags.
 
Last edited:
Lua:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152,
        exp = 10000,
        count = 1
}
        if(isPlayer(cid) and isPlayer(target)) then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
		setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
		else
			doPlayerAddExperience(cid, -reward.exp)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
		end
	end
return TRUE
end

Can someone implement this?
If kill 3 times the same player, killer don't get frags/reward.

edit:
Lua:
local block_kills_acc = {}
local block_kills_ip = {}
local max_kills_per_target_account = 3
local max_kills_per_target_ip = 3
 
function onKill(cid, target, lastHit)
	if isPlayer(target) then
		local g, a, ip = getPlayerGUID(cid), getPlayerAccountId(target), getPlayerIp(target)
		if not block_kills_acc[g] then
			block_kills_acc[g] = {}
			block_kills_ip[g] = {}
		end
		block_kills_acc[g][a] = (block_kills_acc[g][a] or 0) + 1
		block_kills_ip[g][ip] = (block_kills_ip[g][ip] or 0) + 1
		if block_kills_acc[g][a] <= max_kills_per_target_account and block_kills_ip[g][ip] <= max_kills_per_target_ip then
			doPlayerAddItem(cid, 2152, 1)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You killed " .. getCreatureName(target) .. " too many times. NO REWARD!")
		end
	end
	return true
end
 
Last edited:
Back
Top