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

ViP

Nashalito

New Member
Joined
May 21, 2009
Messages
273
Reaction score
0
Hello!

I want that as fast anyone right click at the door and he is ViP he will go to that X Y Z

How i do that. I am using tfs 3.0.6
 
Open up your map editor, put any unique id you want on the door.

Put this in actions.xml
Lua:
<action uniqueid="TheUniqueIDofDoor" script="VIP Door.lua"/>

Make a LUA file in actions>scripts named VIP Door.lua, put this in it:
Lua:
local vipstorage = 11551 --your storage value for VIP

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid,vipstorage) >= 1 then
                if getCreaturePosition(cid).y < toPosition.y then
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y+1,z=toPosition.z}, TRUE)
                else
                        doTeleportThing(cid, {x=toPosition.x,y=toPosition.y-1,z=toPosition.z}, TRUE)
                end
				 doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 30)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you must be a VIP to enter this area.")
        end
        return TRUE
end

REP++ If I helped.:)
 
Here,
Lua:
  local vipstorage = 11551 --your storage value for VIP
  local pos = {x=947, y=9025, z=7, stackpos=1} --positon of where you want them to get tped to
  local cancelpos = {x=947, y=9025, z=7, stackpos=1} --position where you want them to get tped if there NOT vip

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid,vipstorage) >= 1 then
                        doTeleportThing(cid, pos)
                else
                        doTeleportThing(cid, cancelpos)
                end
                                 doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), 30)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you must be a VIP to enter this area.")
        end
        return TRUE
end

Haven't tested it, tell me how it goes.
 
00:22 Only the worthy may pass. and i am a donator

[06/07/2010 00:27:14] [Error - LuaScriptInterface::loadFile] data/actions/scripts/VIP Door.lua:13: 'end' expected (to close 'function' at line 5) near 'else'
[06/07/2010 00:27:14] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/VIP Door.lua)
[06/07/2010 00:27:14] data/actions/scripts/VIP Door.lua:13: 'end' expected (to close 'function' at line 5) near 'else'
[06/07/2010 00:27:14] Reloaded actions.
 
Lua:
  local vipstorage =  11551 --your storage value for VIP
  local pos = {x=1000, y=1000, z=7, stackpos=1} --positon of where you want them to get tped to
  local cancelpos = {x=941, y=1025, z=7, stackpos=1} --position where you want them to get tped if there NOT vip

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid,vipstorage) >= 1 then
                        doTeleportThing(cid, pos)
                        doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
						doSendMagicEffect(getCreaturePosition(cid), 30)
        else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but you must be a VIP to enter this area.")
				doTeleportThing(cid, cancelpos)
        end
return true
end

Should work perfectly fine now, if not tell me. And sorry that it looks all ugly and smashed up, I'm just a beginner :)
 
Back
Top