• 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 For Frag

Yaboihunna

New Member
Joined
Mar 27, 2019
Messages
136
Reaction score
3
Requesting a script 1 platinum coin per frag
aswell as -2000 experience for killing a person with the same ip
couldn't seem to find one that works I'm using tfs 0.4
 
Try this one, it will remove 1 level from the cheater you can change to EXP easily
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)
                        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)
                    doCreatureSetStorage(deathList[i], 20233, getPlayerStorageValue(deathList[i], 20233)+1)
                    doSendAnimatedText(getPlayerPosition(deathList[i]), "Frag!", TEXTCOLOR_RED)
                end
            else
         doPlayerAddLevel(deathList[i], -1)
            end
        end
    end
    return true
end
 
Add like this
XML:
<event type="death" name="FragReward" event="script" value="fragreward.lua"/>
 
You will have to add it to login.lua
Lua:
registerCreatureEvent(cid, "FragReward")
 
What happens exactly? You get a reward with and without MC? or you don't get reward at all? 0 errors after killing and on startup?
 
You don't lose one level per kill? I think you don't get reward because you are testing with MC, others should get rewarded and you'll always get EXP but you lose 1 level I think so.
 
PM me with working server IP and I will login quick to test it with you.
 
Sorry for the abuse, you can make it work in tfs 1.3?
Can you put it to win a trophy with the name of the person you killed? Of course you do not have to do this but I'd like to know if it's possible :D
 
I think it should work if you just added the old functions to compat.lua
 
Back
Top