I have added a creaturescript that should teleport a player to his/her temple when premium runs out.
Problem is that it teleports anyone without premium to their temple.
I know that I am missing a few lines, but I dont know which ones..
Here is my code, premend.lua
login.lua (incase you want to see it)
and creaturescripts.xml (incase you want it too)
Thanks in advance.
/Zeeb
SOLVED
Problem is that it teleports anyone without premium to their temple.
I know that I am missing a few lines, but I dont know which ones..
Here is my code, premend.lua
Code:
function onLogin(cid)
if getPlayerPremiumDays(cid) < 1 then
doTeleportThing(cid,getPlayerMasterPos(cid))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got teleported to the temple, as your premium has expired.")
doSendMagicEffect(getThingPos(cid),CONST_ME_TELEPORT)
end
return true
end
login.lua (incase you want to see it)
Code:
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "FirstItems")
registerCreatureEvent(cid, "PremEnd")
return TRUE
end
and creaturescripts.xml (incase you want it too)
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<!--CUSTOM -->
<event type="login" name="FirstItems" script="firstitems.lua"/>
<event type="login" name="PremEnd" script="premend.lua"/>
</creaturescripts>
Thanks in advance.
/Zeeb
SOLVED
see how simple the script can be: http://otland.net/threads/teleport-...ium-to-free-account-temple.10510/#post-114438
Last edited: