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

Solved Help Fix Frag reward

weverton

New Member
Joined
May 30, 2009
Messages
104
Reaction score
2
Code:
function onKill(cid, target, lastHit)
if cid ~= target and isPlayer(target) then
if getPlayerIp(cid) == getPlayerIp(target) then
doPlayerAddExperience(cid, -500)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
else
doPlayerAddItem(cid, 2152, 1)
doPlayerAddExperience(cid, 500)
doSendAnimatedText(getPlayerPosition(cid),"500", TEXTCOLOR_WHITE)
end
end
return true
end

My server 0.4
this script does not work ;/

help Please!
 
Give this a shot, I don't have a copy of 0.4 anymore so it is untested.

Code:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152, --reward item id
        count = 1 --reward item count
        experienceGain = 500
        experienceLoss = -500
}
        if(isPlayer(cid) and isPlayer(target)) then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
                doPlayerAddExperience(cid, reward.experienceGain)
                doSendAnimatedText(getPlayerPosition(cid),"500", TEXTCOLOR_WHITE)
else
doPlayerAddExperience(cid, reward.experienceLoss)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
                end
end
return TRUE
end
 
Back
Top