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

Problem with storage

mahant

Banned User
Joined
May 15, 2010
Messages
111
Reaction score
1
Hey, i made quest but it works like GlobalStorage, if one guy will use quest, he gain reward, but after him, no1 doesnt gain reward.

Code:
function onUse(cid, item, frompos, item2, topos)


	if item.uid == 8452 then
		if getPlayerStorageValue(cid,7363) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a Glacier Mask.")
			doPlayerAddItem(cid,7902,1)
			setPlayerStorageValue(cid,7363,1)
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty.")
		end
	
	end
	return TRUE
end
 
I want, that it would be normal quest, one player = one time done. But now, if one player will make this quest, other players just cant do it.
 
I will check that in a few moments, now i have to go but if you can, post me one other good script for quests maybe.. :) Thankful. :d
 
Try this:
LUA:
local storage = {
7363 = 1,
}
function onUse(cid, item, frompos, item2, topos)


	if item.uid == 8452 then
		if getPlayerStorageValue(cid,storage.7363) == 1 then
			doPlayerSendTextMessage(cid,25,"You have found a Glacier Mask.")
			doPlayerAddItem(cid,7902,1)
			setPlayerStorageValue(cid,storage.7363,0)
		elseif getPlayerStorageValue(cid,storage.7363) == 0 then
			doPlayerSendTextMessage(cid,25,"This chest is empty.")
		end
	
	end
	return TRUE
end
 
Here you go

Code:
function onUse(cid, item, frompos, item2, topos)

		if getPlayerStorageValue(cid, 7363) < 0 then
			doPlayerSendTextMessage(cid,25,"You have found a Glacier Mask.")
			doPlayerAddItem(cid,7902,1)
			setPlayerStorageValue(cid, 7363, 69)
		elseif getPlayerStorageValue(cid, 7363) > 0 then
			doPlayerSendTextMessage(cid,25,"This chest is empty.")
		end
	return true
end
 
Back
Top