• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Prem End go temple

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
I need creaturescript when one player enter in the OT (function OnLogin) this verify the player have premium or not. If don't have premium TP to the temple.
 
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
 
itsn tot really good, it will teleport every facc player, not only ones that pacc just ended, also you should change town id of this char too...
 
I need creaturescript when one player enter in the OT (function OnLogin) this verify the player have premium or not. If don't have premium TP to the TOWN_ID 1
 
LUA:
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
 
Hello!

Go to data/creaturescripts/scripts and make a file called tpfacc.lua. Place this into it:
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
Add in creaturescripts.xml:
PHP:
	<event type="login" name="TeleportFACC" event="script" value="tpfacc.lua"/>
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.
 
Last edited:
Hello!

Go to data/creaturescripts/scripts and make a file called tpfacc.lua. Place this into it:
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
Add in creaturescripts.xml:
PHP:
	<event type="login" name="TeleportFACC" event="script" value="tpfacc.lua"/>
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.


best so far, but it won't teleport a non-premium that is in a premium area if his town is non-premium
 
Yep, I know. But when he die, it will be teleported to such non-premium town, then he won't be able to go to the premium city another time.
Then, I must put isInArea function or something like that, but some people won't know how to do it, cause each map has different coordinates, etc...
 
Yes, you can stay in Premium Island having a Free Account if you were there before your account being free and if you are citizen of a free town temple.
If you want to check areas (pos: x,y,z), I think that that script was already released.
 
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

You has been teleported to the free temple because your premium time has ended. ?
what about
You have been teleported to the Non premium temple becouse ur premium time has been expired. :$
 
Back
Top