Serp
/* No comment */
- Joined
- Mar 23, 2008
- Messages
- 249
- Reaction score
- 1
Just a small script someone wanted me to make. apparnatly other people want the same i'm throwing it up here.
Hope this is of some use to people. my first release =\
Login.lua
And this anywhere in Global.lua
Hope this is of some use to people. my first release =\
Login.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
And this anywhere in 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
Last edited: