function onLogin(cid)
if not isPremium(cid) then
doTeleportThing(cid, TEMPLE_POSITION)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been teleported to the free temple because your premium time has ended.")
end
return true
end
TFS version?Bump... Doesn't work.
function onLogin(cid)
if not isPremium(cid) then
doTeleportThing(cid, getTownTemplePosition(1))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been teleported to the free temple because your premium time has ended.")
end
return true
end
-- Teleport Free Account Players when they lose their Premium Account // by Xampy --
function onLogin(cid)
local config = {
freeTown = 1, -- place here one townID for free account
premiumTowns = {2, 3, 4, 5, 6} -- add all your townIDs that are for premium player
}
local POS = getCreaturePosition(cid)
local templePOS = getTownTemplePosition(config.freeTown)
if(isInArray(config.premiumTowns, getPlayerTown(cid))) then
if not isPremium(cid) then
doTeleportThing(cid, templePOS)
doSendMagicEffect(POS, 2)
doSendMagicEffect(templePOS, 10)
doPlayerSetTown(cid, config.freeTown)
doPlayerSendTextMessage(cid, 25, "You have been teleported to main temple because your Premium Account has expired.")
end
end
return TRUE
end
<event type="login" name="TeleportFACC" event="script" value="tpfacc.lua"/>
Hello!
Go to data/creaturescripts/scripts and make a file called tpfacc.lua. Place this into it:
Add in creaturescripts.xml:LUA:-- Teleport Free Account Players when they lose their Premium Account // by Xampy -- function onLogin(cid) local config = { freeTown = 1, -- place here one townID for free account premiumTowns = {2, 3, 4, 5, 6} -- add all your townIDs that are for premium player } local POS = getCreaturePosition(cid) local templePOS = getTownTemplePosition(config.freeTown) if(isInArray(config.premiumTowns, getPlayerTown(cid))) then if not isPremium(cid) then doTeleportThing(cid, templePOS) doSendMagicEffect(POS, 2) doSendMagicEffect(templePOS, 10) doPlayerSetTown(cid, config.freeTown) doPlayerSendTextMessage(cid, 25, "You have been teleported to main temple because your Premium Account has expired.") end end return TRUE end
You don't have to add nothing into login.lua, cause this script is already an onLogin function, so you don't must register nothing.PHP:<event type="login" name="TeleportFACC" event="script" value="tpfacc.lua"/>
LUA:function onLogin(cid) if not isPremium(cid) then doTeleportThing(cid, TEMPLE_POSITION) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been teleported to the free temple because your premium time has ended.") end return true end
Hmmm, it works mate... I tested it ! (mine script)I think what the script doesn't work bro ;p