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

Help- Frag Reward - TFS 0.3.6 pl1

Demonder

New Member
Joined
May 22, 2009
Messages
8
Reaction score
0
Hello guys.
I'm with a doubt about the use of a parameter of function 'onDeath'.
In version 0.3.4 of TFS, the 'onDeath' went like this:
function onDeath (cid, corpse, lastHitKiller, mostDamageKiller)
But now in version 0.3.6 pl1 this function is as follows:
function onDeath (cid, corpse, deathList)
If anyone knows, could explain how I use this function to add an item to the player to kill another player?
Thx for attention.

No More~
Xina~
 
I dont understand that sentence:
If anyone knows, could explain how I use this function to add an item to the player to kill another player?

But if you want to give the killer an item you can either do it by looping deathList:
Code:
for _,cid in pairs(deathList) do
    if isPlayer(cid) then
        doPlayerAddItem(cid,ITEMID,COUNT)
    end
end

or you could use function onKill(cid,target):
Code:
if isPlayer(target) then
    doPlayerAddItem(cid,ITEMID,COUNT)
end
 
Back
Top Bottom