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

Kill Reward

3li Xiber

Active Member
Joined
Dec 29, 2014
Messages
395
Reaction score
31
Now I Have This Script
Code:
function onKill(cid, target, lastHit)
local rewardItem = {
6527, --ITEM ID!
1 -- How many?
}

if isPlayer(cid) and isPlayer(target) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doPlayerAddItem(cid, rewardItem[1], rewardItem[2])
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 I Kill Other Char I don't Get Reward Or Error ....

BUMP !!

@Limos

I Use Version 0.3.6 Can u help me Bro ?
 
Last edited by a moderator:
Here you are my script ;)

Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
 
Here you are my script ;)

Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
ok thx bro i will test it
 
Here you are my script ;)

Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
Make sure you added a line for the script in creaturescripts.xml and that you registered it in login.lua.
there are 2 problems with it
first one that got the frags like you wrote ,the system doesn't broadcast the frager who got these frags
Code:
if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
second one players can use this script to gain more item reward so its must be the reward for different ip and with chance to win reward with math like 1-50 CC each kill (item id)
 
Make sure you added a line for the script in creaturescripts.xml and that you registered it in login.lua.



<event type="kill" name="reward" event="script" value="fragreward.lua"/>


registerCreatureEvent(cid, "kill")



I Didn't Get Reward too.
 
<event type="kill" name="reward" event="script" value="fragreward.lua"/>


registerCreatureEvent(cid, "kill")



I Didn't Get Reward too.
registerCreatureEvent(cid, "reward")
register must be like name not event type
http://otland.net/threads/frag-reward.227809/#post-2195321
Don't know what you mean with the broadcast, what does it write then?

My post was btw on the script the thread started posted, which already has the ip check.
the script didn't broadcast name of that player who got 5 frags/10/25 etc and i can take reward and i'm on same ip ,i dont think this script is working to check ip
 
registerCreatureEvent(cid, "reward")
register must be like name not event type

the script didn't broadcast name of that player who got 5 frags/10/25 etc and i can take reward and i'm on same ip ,i dont think this script is working to check ip
same problem
i have other scripts like Owned , Death Broadcast it make anyproblem for the reward script?
 
What Mera Mero posted is correct, register the name, not the type.
Always if you have further problems, post everything, scripts, errors, you can't expect people to be psychic and just only post "same problem".
 
What Mera Mero posted is correct, register the name, not the type.
Always if you have further problems, post everything, scripts, errors, you can't expect people to be psychic and just only post "same problem".
done i register " Reward" But Same problem
 
Then post it, creaturescripts.xml, login.lua, the lua script and the errors, people can not see this here, so you have to post it.
 
What Mera Mero posted is correct, register the name, not the type.
Always if you have further problems, post everything, scripts, errors, you can't expect people to be psychic and just only post "same problem".
Code:
01:42 Currently online players with same IP address(es):
01:42 Momo (192.168.1.2)
01:42 Semi (192.168.1.2)
and i can take a reward when i kill this player and broadcast isn't working this is the script
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
     return true
end

if(getStor == 5) then
doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
    <event type="login" name="PlayerLogin" event="script" value="login.lua"/>
        <event type="look" name="fraglook" event="script" value="fraglook.lua"/>
        <event type="login" name="Hi!" script="loginserver.lua"/>   
    <event type="kill" name="Bounty" script="bounty.lua"/>
        <event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/>
    <event type="login" name="logowanie" event="script" value="logowanie.lua"/>
        <event type="advance" name="getmoney" event="script" value="getmoney.lua"/>
        <event type="death" name="DeathList" event="script" value="deathlist.lua"/> 
    <event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
    <event type="receivemail" name="Mail" event="script" value="mail.lua"/>
    <event type="advance" name="points" event="script" value="points.lua"/>
    <event type="advance" name="advance" event="script" value="advance.lua"/>
    <event type="advance" name="advbr" event="script" value="/advbroadcast.lua"/>
        <event type="look" name="showKD" event="script" value="KillsandDeath.lua"/>
    <event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
    <event type="advance" name="reward" event="script" value="reward50.lua"/>
        <event type="advance" name="fullmh" event="script" value="fullmh.lua"/>
    <event type="kill" name="BotKill" event="script" value="bot/kill.lua"/>
        <event type="advance" name="points" event="script" value="points.lua"/>
        <event type="advance" name="LevelBroadcast" script="levelbroadcast.lua"/>
    <event type="preparedeath" name="forever amulet" event="script" value="forever amulet.lua"/>   
    <event type="preparedeath" name="skull amulet" event="script" value="skull amulet.lua"/>
    <event type="preparedeath" name="charge amulet" event="script" value="charge amulet.lua"/>
    <event type="statschange" name="BotStatsChange" event="script" value="bot/statschange.lua"/>
        <event type="death" name="Pythius the rottenTeleport" script="Pythius the rotten_teleport.lua"/>
        <event type="login" name="freebless" event="script" value="freebless.lua"/>
        <event type="login" name="TopEffect" event="script" value="topeffect.lua"/>
        <event type="death" name="DeathC" event="script" value="deathcast.lua"/>
        <event type="statschange" name="HitMessage" event="script" value="hitmsg.lua"/>
        <event type="combat" name="Hitmsg" event="script" value="hitmsg.lua"/>
        <event type="login" name="Bless" event="script" value="blesscheck.lua"/>
  

        <!-- Zombie Event -->
        <event type="think" name="ZombieThink" event="script" value="zombie/onthink.lua"/>
    <event type="statschange" name="ZombieAttack" event="script" value="zombie/onattack.lua"/>
    <event type="death" name="ZombieDeath" event="script" value="zombie/ondeath.lua"/>
   
    <!-- EvoStorm -->
    <event type="death" name="KillExp" event="script" value="killexp.lua" />
    <event type="death" name="Death" event="script" value="death.lua" />
        <event type="kill" name="reward" event="script" value="fragreward.lua"/>
    <event type="kill" name="HuntingTask" event="script" value="taskkill.lua" />
    <event type="preparedeath" name="arena" event="script" value="arena.lua" />
    <!--event type="statschange" name="BestHit" event="script" value="evostorm/besthit.lua" /-->
</creaturescripts>
 

Attachments

@Mera Mero To fix the name problem try this.
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
return true
end

if(getStor == 5) then
doBroadcastMessage("".. name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage("".. name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage("".. name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage("".. name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
 
@Mera Mero To fix the name problem try this.
Code:
local c = {
item = 6527, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 1},
{"Owned!", 18, 1},
{"Pwnt!", 215, 1}
}
}
function onKill(cid, target)
if(not isPlayer(target)) then return true end

local getStor = getCreatureStorage(cid, c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

doCreatureSetStorage(cid, c.store, (getStor + 1))
doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
doPlayerAddItem(cid, c.item, c.table[rand][3])

if getPlayerIp(cid) == getPlayerIp(target) then
return true
end

if(getStor == 5) then
doBroadcastMessage("".. name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
doBroadcastMessage("".. name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
doBroadcastMessage("".. name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
doBroadcastMessage("".. name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
If this for Broadcast it does not work and about ip problem still not working
Code:
02:10 You currently have 10 frags today, 10 this week and 10 this month.
 
Back
Top Bottom