• 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 Check player battle status

Siegh

Thronar Developer
Joined
Mar 12, 2011
Messages
1,186
Solutions
1
Reaction score
510
Location
Brazil
Someone help me please on a simple issue with this script below \/

Code:
function onUse(cid, item, frompos, item2, topos)
local newpos = {x=1635, y=2568, z=4}
    if isPlayerPzLocked(cid) == false then
        doTeleportThing(cid, newpos)
        doSendMagicEffect(getPlayerPosition(cid), 10)
        doPlayerSendTextMessage(cid, 22, "You have been teleported to Thyrfing.")
    else
        doPlayerSendTextMessage(cid, 22, "You cant teleport while in battle.")
end
return true
end

This is a teleport scroll, it works almost fine... the problem is that I dont want player to teleport if they got the battle icon, be it from players or monsters. The function isPlayerPzLocked seems like checks only pvp batle, since I tested with monsters and I got teleported.

So, someone may help me on checking if the player is fighting monsters aswell?

Thanks in advance!
 
Last edited by a moderator:
Lua:
function onUse(cid, item, frompos, item2, topos)
local newpos = {x=1635, y=2568, z=4}
	if getCreatureCondition(cid, CONDITION_INFIGHT) == false then
		doTeleportThing(cid, newpos)
		doSendMagicEffect(getPlayerPosition(cid), 10)
		doPlayerSendTextMessage(cid, 22, "You have been teleported to Thyrfing.")
	else
		doPlayerSendTextMessage(cid, 22, "You cant teleport while in battle.")
end
return true
end
Also, this should be in the Support Board.
 
Thank you very much Bogart, that was the fastest reply I ever got.

And sorry for the wrong board, thought it would fit here.
Close thread please.
 
Back
Top