• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved How to prevent to use runes from the ground?

LuisPro

World War <3
Joined
May 10, 2009
Messages
425
Solutions
1
Reaction score
53
I mean situation where someone put for example UH on ground and use it on yourself for healing becouse it is faster than heal from BP.

Any ideas?

(OTServ SVN)
 
Solution
lol it was so easy... solved!

actions.xml
Code:
<action itemid="2273" script="ground_uh.lua"/>

ground_uh.lua
Code:
function onUse(cid, item, frompos, item2, topos)
        if frompos.x ~= CONTAINER_POSITION then
        doPlayerSendCancel(cid, "You cannot use this rune from the ground.")
        return true
        end
end
pos.z > 65000 something means it's in the inventory
pos.z <= 65000 something means that it's on the map
 
for example uh rune
new action?

Code:
function onUse(cid, item, frompos, item2, topos)
    if item.itemid == 2273 then
        if frompos.x ~= CONTAINER_POSITION then
        doPlayerSendCancel(cid, "You cannot use this rune from the ground.")
        else
        HOW TO RUN UH RUNE LUA SCRIPT FROM SPELLS HERE?
        end
    end
end

This way? or edit uh rune file an add there this:

if frompos.x ~= CONTAINER_POSITION then
doPlayerSendCancel(cid, "You cannot use this rune from the ground.")

but idk how to do that ;s
var is position in rune file, yes? and var or var.x not working in this way
 
try this: create a action on UH rune and check its position. if it is on the ground remove it
i just dont know if removing the rune, the spell will still be called
 
Last edited:
lol it was so easy... solved!

actions.xml
Code:
<action itemid="2273" script="ground_uh.lua"/>

ground_uh.lua
Code:
function onUse(cid, item, frompos, item2, topos)
        if frompos.x ~= CONTAINER_POSITION then
        doPlayerSendCancel(cid, "You cannot use this rune from the ground.")
        return true
        end
end
 
Solution
Back
Top