• 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.

MoveEvent VIP Tiles & Teleports

Frankit0

Surf Power
Joined
Feb 22, 2010
Messages
102
Reaction score
0
Location
Argentina
Hi there!

I'll explain how to create a move event for VIP players only.
The vip system should be the one made by Empty: http://otland.net/f82/vip-system-19426/

Ok, let's go:

first of all, go to data/movements/scripts and create something like "viptrolls.lua" or whatever the zone will be related to.
Now copy this:

PHP:
		--Function by Frankit0--

function onStepIn(cid, item, frompos, item2, topos)

	local vip = getPlayerStorageValue(cid,11551) >= 1 --The storage that the vip system uses.
	local kickposition = {x=32500, y=32275, z=6} --Place where the Player will be teleported if NOT VIP, change it


	if(vip) then
		doPlayerSendTextMessage(cid, 19, "You are VIP, you are allowed to pass.")
	else
		doPlayerSendTextMessage(cid, 19, "You are not VIP, you can't pass.")
                doTeleportThing(cid, kickposition, FALSE)
	end
end

now go to movements.xml and add it.
example:
PHP:
  	<movevent type="StepIn" uniqueid="30000" event="script" value="viptrolls.lua"/>


Now, when a player that is NOT vip tries to step on that tile, he'll be kicked back.


Now, let's create a VIP Teleport.

Again, go to data/movements/scripts and create a file called "TrollsVipTP.lua" or wathever you want and copy this:

PHP:
		--function by Frankit0--

function onStepIn(cid, item, frompos, item2, topos)

	local vip = getPlayerStorageValue(cid,11551) >= 1 --The storage that the vip system uses.
	local kickposition = {x=32500, y=32275, z=6} --Place where the Player will be teleported if not vip, change it
        local newposition = {x=9999, y=9999, z=99} --Place where the player will be teleported IF VIP, change it.


	if(vip) then
		doPlayerSendTextMessage(cid, 19, "You are VIP, you are allowed to pass.")
                doSendMagicEffect(getPlayerPosition(cid),2) 
                doTeleportThing(cid, newposition) 
                doSendMagicEffect(newposition,10)
	else
		doPlayerSendTextMessage(cid, 19, "You are not VIP, you can't pass.")
                doTeleportThing(cid, kickposition)
	end
end


and again, add it to movements.xml

remember to add to the map tile/TP the unique ID we add on the movements.xml!!! (on the example I used 30000, you can change it if you want.)



I hope someone finds this useful :)

Rep+ me if I helped you, or if you think that my job was good :)
 
Shorter, some bugs fixed.

1.
Lua:
--Function by Frankit0--
function onStepIn(cid, item, frompos, item2, topos)
	if(getCreatureStorage(cid,11551) >= 1) then
		doPlayerSendTextMessage(cid, 19, "You are VIP, you are allowed to pass.")
	else
		doPlayerSendTextMessage(cid, 19, "You are not VIP, you can't pass.")
		doTeleportThing(cid, frompos, true)
	end
	return true
end
2.
Lua:
--function by Frankit0--
local newposition = {x=9999, y=9999, z=9} --Place where the player will be teleported IF VIP, change it.

function onStepIn(cid, item, frompos, item2, topos)
	if(getCreatureStorage(cid,11551) >= 1) then
		doPlayerSendTextMessage(cid, 19, "You are VIP, you are allowed to pass.")
		doSendMagicEffect(getThingPosition(cid),2) 
		doTeleportThing(cid, newposition, true) 
		doSendMagicEffect(newposition,10)
	else
		doPlayerSendTextMessage(cid, 19, "You are not VIP, you can't pass.")
		doTeleportThing(cid, frompos, true)
	end
	return true
end
 
Back
Top