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

Action Staff only door!

ghettobird

LUA newbie
Joined
Aug 17, 2013
Messages
679
Reaction score
132
Location
OTland
Hello guys, it's me again anyway someone told me they wanted a door that only STAFF MEMBERS can enter so here you go :p

Lua:
function onUse(cid) -- other parameters like 'item' 'itemEx' are not needed in this script so we dont have to add them
if(getPlayerGroupId(cid) >= 2) then
  doTeleportThing(cid, {x=1000,y=1000,z=7}, true)
  doCreatureSay(cid, "Hello" .. getCreatureName(cid) .. ", you are a staff member, you can pass", TALKTYPE_ORANGE_1) 
else 
doPlayerSendCancel(cid, "Sorry, you are not a staff member!")
end
return true
end

now what you need to edit:-

the position where you go when you use the door (from script) AND you need to make an action id for the door FROM RME, and that action id you put it in actions.xml :)


i hope this is useful :peace:
 
Tab your scripts properly:

Lua:
function onUse(cid) -- other parameters like 'item' 'itemEx' are not needed in this script so we dont have to add them
	if(getPlayerGroupId(cid) >= 2) then
		doTeleportThing(cid, {x = 1000, y = 1000, z = 7}, true)
		doCreatureSay(cid, "Hello " .. getCreatureName(cid) .. ", you are a staff member, you can pass.", TALKTYPE_ORANGE_1) 
	else 
		doPlayerSendCancel(cid, "Sorry, you are not a staff member!")
	end
	return true
end
 
Ok Thank you

- - - Updated - - -

hey i need it on chair not door can you add it ?
 
i need one step in for all players but it take from players 100 cc to teleport them to the place
if players dont have money it teleport them to temple and it say you dont have enough money
thx
 
@ elking:
Lua:
function onStepIn(cid, item, position, fromPosition)
	if(getPlayerGroupId(cid) >= 2) then
	doTeleportThing (cid, (x=1000,y=1000,z=7)) -- this is position of chair, so when they go on a tile they get teleported to the chair only if they are tutor + :)
	doCreatureSay(cid, "Hello " .. getCreatureName(cid) .. ", you are a staff member, you can pass.", TALKTYPE_ORANGE_1)
	else
	doPlayerSendCancel (cid, "Sorry " .. getCreatureName(cid) .. ", sorry you are not a staff member.", TALKTYPE_GOLD)
	end
		return true
			end
-------------------------------------------------------------------------------------------------------------------
@megazx: check my thread http://otland.net/f81/go-through-teleport-you-pay-x-crystal-coins-198255/
 
@ elking:
Lua:
function onStepIn(cid, item, position, fromPosition)
	if(getPlayerGroupId(cid) >= 2) then
	doTeleportThing (cid, (x=1000,y=1000,z=7)) -- this is position of chair, so when they go on a tile they get teleported to the chair only if they are tutor + :)
	doCreatureSay(cid, "Hello " .. getCreatureName(cid) .. ", you are a staff member, you can pass.", TALKTYPE_ORANGE_1)
	else
	doPlayerSendCancel (cid, "Sorry " .. getCreatureName(cid) .. ", sorry you are not a staff member.", TALKTYPE_GOLD)
	end
		return true
			end

You really good with script but have bug

PHP:
[27/08/2013 13:46:09] [Warning - Weapons::registerEvent] Duplicate registered item with id: 7367
[27/08/2013 13:46:10] [Error - LuaScriptInterface::loadFile] data/actions/scripts/staff.lua:3: ')' expected near '='
[27/08/2013 13:46:10] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/staff.lua)
[27/08/2013 13:46:10] data/actions/scripts/staff.lua:3: ')' expected near '='

- - - Updated - - -

I fixed it ^_^

Lua:
function onStepIn(cid, item, position, fromPosition)
        if (not isPlayer(cid)) then return true end
	if(getPlayerGroupId(cid) > 2) then
	doTeleportThing (cid, {x=x,y=y,z=z}) -- this is position of chair, so when they go on a tile they get teleported to the chair only if they are tutor + :)
	doCreatureSay(cid, "Hello " .. getCreatureName(cid) .. ", you are a staff member, you can pass.", TALKTYPE_ORANGE_1)
	else
		doTeleportThing(cid, {x=1000,y=1000,z=7}, true)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Go away this chair for staff only ")
		setPlayerStorageValue(cid, 1000, 0)
	end
	return true
end
 
Back
Top