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

Scorpvm 101

Active Member
Joined
Feb 23, 2010
Messages
460
Solutions
3
Reaction score
28
Location
Spain
Hi guys,

Someone knows how is the script when a person kills another, to give you a prize.

I have one example but dont function.
I use REV_0.4

PHP:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152, --ITEM ID!(EDIT HERE)
        count = 1 -- How many?(EDIT HERE)
}
        if(isPlayer(cid) and isPlayer(target)) then
    if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
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
 
That's not PhP code. :d try [.lua] [./lua] without the dots. XD


EDIT. and if you're saving the file as xxxx.php, that could be the problem ! XD

Try saving it as xxxx.lua??
 
I want one lua code*

Me example is:

function onKill(cid, target, lastHit)
local reward = {
item = 2152, --ITEM ID!(EDIT HERE)
count = 1 -- How many?(EDIT HERE)
}
if(isPlayer(cid) and isPlayer(target)) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doPlayerAddItem(cid, reward.item, reward.count)
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
 
Back
Top