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

Chest Reward for Frees and Different for Premiums

megachock

Member
Joined
Mar 12, 2009
Messages
115
Reaction score
7
Well i want a chest when you click it and youre not premium it will give you a prize and then an storage so you can do it only 1 time, also a different prize for premiums and whit a different storage.
 
Lua:
local config ={
	storage = {1234, 4321}, -- {storage for premium, storage for free}
	items = {1234, 4321}	-- {item for premium, item for free}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPremium(cid) then
		if getPlayerStorageValue(cid, config.storage[1]) == -1 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[1]))
			doPlayerAddItem(cid, config.items[1], 1)
			setPlayerStorageValue(cid, config.storage[1], 1)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end
	else
		if getPlayerStorageValue(cid, config.storage[2]) == -1 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[2]))
			doPlayerAddItem(cid, config.items[2], 1)
			setPlayerStorageValue(cid, config.storage[2], 1)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end	
	end
	return TRUE
end
 
Lua:
local config ={
	storage = {1234, 4321}, -- {storage for premium, storage for free}
	items = {1234, 4321}	-- {item for premium, item for free}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPremium(cid) then
		if getPlayerStorageValue(cid, config.storage[1]) == -1 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[1]))
			doPlayerAddItem(cid, config.items[1], 1)
			setPlayerStorageValue(cid, config.storage[1], 1)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end
	else
		if getPlayerStorageValue(cid, config.storage[2]) == -1 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[2]))
			doPlayerAddItem(cid, config.items[2], 1)
			setPlayerStorageValue(cid, config.storage[2], 1)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end	
	end
	return TRUE
end

Thanks perro, REP+ y soy de iquique :D
 
Back
Top