• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Kick none-vip/premium players out of vip/prem areas when their vip/prem runs out!

Rizz

Quited with Tibia/OT
Joined
Jun 16, 2007
Messages
573
Reaction score
4
Location
Stockholm, Sweden
Lua:
local vipZones = {
	{fromPos = {x=1800, y=150, z=0}, toPos = {x=2050, y=300, z=15}},
	{fromPos = {x=1000, y=1250, z=0}, toPos = {x=1500, y=1600, z=15}}
}

local vipTowns = {14,15}

local homeTown = 1

local homeCords = {x = 1060, y = 994, z = 7}

function onLogin(cid)
	if isPlayerVip(cid) == FALSE then
		for _, v in ipairs(vipZones) do
			if isInRange(getCreaturePosition(cid), v.fromPos, v.toPos) == TRUE then
				doTeleportThing(cid, homeCords, TRUE)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Your VIP has expired. The gods has therefore transported you to safety in "..getTownName(homeTown)..".")
			end
		end
		if isInArray(vipTowns, getPlayerTown(cid)) == TRUE then
			doPlayerSetTown(cid, homeTown)
		end
	end
	return TRUE
end

If you use premium instead of http://otland.net/f163/full-working-vip-system-shawak-44840/ change
Lua:
if isPlayerVip(cid) == FALSE then
to
Lua:
if isPremium(cid) == FALSE then
 
Great Job, :thumbup:.

:wub:

PS: Post 500!, Reputation Points = 295, please 5? :).

Just a little side note, I don't use your system, I use my own personal "system", but it's very similar to yours, but bit more effective.
 
buddys why u never add if (getPlayerVocation(cid) >= 1)? If you use home cords like that, remember that a rook player may be teleported with no vocation to the main land when his premium runs out.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Edit:
NVM, I see you pre-set towns.
 
buddys why u never add if (getPlayerVocation(cid) >= 1)? If you use home cords like that, remember that a rook player may be teleported with no vocation to the main land when his premium runs out.

Simply because I don't have a rook on my server ;)

Well... Unless you got a viparea in your rook + add it to vipcords, they cannot be teleported.

This script will onLogin check if:

if player does not have vip -> (if yes) is he in a vip area (if yes) teleport to homeCords (if no) do nothing... is he citizen in a vipTown (if yes) set his hometown to homeTown (if no) do nothing... (if not vip) do nothing...
 
Simply because I don't have a rook on my server ;)

Well... Unless you got a viparea in your rook + add it to vipcords, they cannot be teleported.

This script will onLogin check if:

if player does not have vip -> (if yes) is he in a vip area (if yes) teleport to homeCords (if no) do nothing... is he citizen in a vipTown (if yes) set his hometown to homeTown (if no) do nothing... (if not vip) do nothing...

Fine, but if you release something related to it, remember that people use rook system ;) so you should implant if rook then do nothing if not then teleport if not premium. That's simply, nothing bad to your server, but better for others that use it.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
it didn't work :(
what should i put into creaturescripts.xml ?
and should i add something to login.lua ?
 
Back
Top