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

Frag reward script

Guardian OT

New Member
Joined
Jan 8, 2011
Messages
53
Reaction score
0
we are try to get were u only drop the reward when u kill somebody and nothing else
here are script
PHP:
function onKill(cid, target)
        if isPlayer(target) == TRUE then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
        loot = 2152 
	  item = doPlayerAddItem(cid,loot,3)
	elseif getPlayerName(cid) == getPlayerName(target) then
	  doPlayerAddItem(cid,loot,1)
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
But when you kill somebody it drops nothing
 
Last edited:
try this
Code:
function onKill(cid, target)
        if isPlayer(target) == TRUE then
		if getPlayerIp(cid) ~= getPlayerIp(target) then
        loot = 2152 
	  item = doPlayerAddItem(cid,loot,1)
	elseif getPlayerName(cid) == getPlayerName(target) then
	  doPlayerAddItem(cid,loot,1)
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
 
PHP:
local item = 2160 
function onKill(cid, target, lastHit) 
    if isPlayer(cid) == true and isPlayer(target) == true then 
        doPlayerAddItem(cid, item, 1) 
    end 
return true 
end
 
This will add an item inside the corpse of a killed player:
Lua:
local loot = 2160 --item id of the item you want dropped
local amount = 1  --amount of the item dropped

function onDeath(cid, corpse, deathList) --with this function you automaticly get the corpse with it else you'd have to recreate the corpse to add the item in it so this is alot simpler
doAddContainerItem(corpse,loot,amount) --add whatever conditions you might want.
return true
end
 
Back
Top