Is it possible to make my boat/carpet man to check if the player is pz locked before he lets him travel?
Code:
<?xml version="1.0"?>
<npc name="Mohammed" script="data/npc/scripts/carpet.lua" autowalk="0" floorchange="0" access="5">
<health now="150" max="150"/>
<look type="133" head="20" body="120" legs="75" feet="13" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, I can send you to Malmoe for a small fee." />
<parameter key="message_farewell" value="Good bye |PLAYERNAME|, May the spirits of Warberg be with you!" />
<parameter key="module_travel" value="1" />
<parameter key="travel_destinations" value="malmoe,238,564,6,50,true" />
</parameters>
</npc>
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())