• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Request Functions

zednem

New Member
Joined
Nov 15, 2008
Messages
108
Reaction score
0
function doResetSwitches(), doReplaceStones() and doSetPlayerAccess

I am very interessed in this 3 functions so if anyone have it or know how to make i would be very grateful,

doResetSwitches will transform de levers with y uniqueid with id 1946 to id 1945 after x time

ex:
PHP:
local UIDS = {5100, 5101, 5102}
levers with that uniqueid transform in id 1945 after x time

doReplaceStones will replace the stones im z position after x time

ex:
PHP:
local STONE_POSITIONS = {x = 1148, y = 1243, z = 8, stackpos = 1}

will create a stone in this position with my choice of id in x time

and

doSetPlayerAccess would set the access of player to what i choose
ex: doSetPlayerAccess(getPlayerByName(param), 1)

Thank anyway, sorry for bad english
 
After player is using the lever with UID 5100, 5101, 510X add:
Code:
    addEvent(doTransformItem, delay, itemEx.uid, 1945)

Same with stones.
 
humm got it
just i use doCreateItem with stones
i just don't understant that itemEx.uid i will replace that with what??
with the uniqueid???
 
Sorxxxxx, should be item.uid.

With the stone use addEvent too, but:
Code:
    addEvent(doRemoveItem, delay, getThingfromPos(position).uid, 1)

Use stackpos = 1.
 
Code:
local UIDS = {5100, 5101, 5102}
local MISSION_STORE = 5795
local STONE_POSITIONS = {x = 1148, y = 1243, z = 8, stackpos = 1}
local TIME = 5   ---time in minutes the stones stay away for
local STONE_ID = 1497   --- the ID of the stones
local nice_done = "Nice! Keep that way."
local done = "You may proceed now!" 
 
function onUse(cid, item, frompos, item2, topos)
local MISSION_STATUS = math.max(getGlobalStorageValue(MISSION_STORE),0)

 
if item.itemid == 1945 and MISSION_STATUS < 0 then
setGlobalStorageValue(MISSION_STORE, 0)
end
if item.itemid == 1945 and MISSION_STATUS >= 0 then 
doTransformItem(item.uid, 1946, 1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS + 1)
MISSION_STATUS = getGlobalStorageValue(MISSION_STORE)
doCreatureSay(cid, nice_done, TALKTYPE_ORANGE_1)

else
doTransformItem(item.uid, 1945, 1)
setGlobalStorageValue(MISSION_STORE, MISSION_STATUS - 1)
MISSION_STATUS = getGlobalStorageValue(MISSION_STORE)
doCreatureSay(cid, "Bad Move!", TALKTYPE_ORANGE_1)
end

 
if MISSION_STATUS == 3 then
doCreatureSay(cid, done, TALKTYPE_ORANGE_1)
local STONE1 = getThingfromPos(STONE_POSITIONS)
doRemoveItem(STONE1.uid, 1)
addEvent(doTransformItem, 3600000, item.uid, 1945)
addEvent(doCreateItem, 3600000, STONE_ID, 1, STONE_POSITIONS)
setGlobalStorageValue(MISSION_STORE, 0)
end
return 1
end
Look that script, in this part
Code:
addEvent(doTransformItem, 3600000, item.uid, 1945)
i don't have to change item.uid??
 
SOrry for the double post, but the lever still not transform and i am desesperated for the function doSetPlayerAccess, so please someone post here T.T
 
Back
Top