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

Timer help

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+ :p
 
Try this, under red line add what will happen when don't have the storage
Code:
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
I didn't tested it, so try..
 
Code:
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
 
Back
Top