Ninja Bodil
New Member
- Joined
- Mar 7, 2009
- Messages
- 116
- Reaction score
- 0
Can someone help me with if you use a switch you can not use it in the next 10 minutes?
I REP+
I REP+
function onUse(cid, item, item2, frompos, topos)
if getPlayerStorageValue(cid, 15515) >= 1 then
return 0
end
else
[COLOR="Red"]doSetPlayerStorageValue(cid, 15515, 1)[/COLOR]
local timed = 10
local czas = 0
local function timer(i)
if(getPlayerStorageValue(cid, 11555)==1)then
end
doSetPlayerStorageValue(cid, 15515, -1)
end
if(czas == 0)then
addEvent(timer, (timed*60000), {cid=cid, npos=getThingfromPos(getPlayerPosition(cid))})
czas = os.time()
end
if(os.time() <= (czas+timed*30))then
stopEvent(timer)
end
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 or item.itemid == 1946 then
if getPlayerStorageValue(cid, 5003) <= os.time() then
//* ur script *//
setPlayerStorageValue(cid, 5003, os.time() + 600)
else
doPlayerSendCancel(cid, "You must wait " .. getPlayerStorageValue(cid, 5003) - os.time() .. ".")
end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end