Grinch
www.loronia.se
Need some help with a script here. The script is teleporting free account players from preium are, to free account area when their premium time is over.
It works, but then my website shop stop work, and i want them both to work.
And i've tried to change the name to login3.lua and added it to creaturescripts to get this work.
In creatures.lua
login3.lua
global.lua
Thanks for the help!
It works, but then my website shop stop work, and i want them both to work.
And i've tried to change the name to login3.lua and added it to creaturescripts to get this work.
In creatures.lua
PHP:
<event type="login" name="PlayerLogin" script="login3.lua"/>
login3.lua
PHP:
PremDay = getPlayerPremiumDays(cid) -- Checks premium player days
ftemple = {x=438, y=503, z=8} -- This is the Free account temple position
Prem1 = {x=370, y=592, z=7} -- This is the top left Co-ord for checking the Premium area.
Prem2 = {x=403, y=645, z=7} -- This is the bottom right co-ord for checking the Premium area.
-- Top left, and bottom right co-ords exist because isInArea function checks a SQAURE area. from top left to bottom right
function onLogin(cid)
if isInArea(getPlayerPosition(cid), Prem1, Prem2) then
if PremDay < 1 then
doTeleportThing(cid, ftemple)
doPlayerSendTextMessage(cid,24,"You no longer have a premium account, Please renew your premium to gain access to the premium areas.")
end
end
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
global.lua
PHP:
-- Function isInaArea by Colandus!
function isInArea(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.x <= toPos.x then
if pos.y >= fromPos.y and pos.y <= toPos.y then
if pos.z >= fromPos.z and pos.z <= toPos.z then
return true
end
end
end
return false
end
Thanks for the help!