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

Lamp Quest

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
My lamp quest don't are working:
Code:
 local timeSec = 5

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if ((getPlayerAccess(cid) == 0) or (getPlayerAccess(cid) == 1)) then
	if getPlayerStorageValue(cid, 2044) == FALSE then
	   doPlayerAddItem(cid, 2044, 1)
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have found a Lamp.")
	   addEvent(autoMsg, timeSec*1000, cid)
	   setPlayerStorageValue(cid, 2044, TRUE)
	 elseif getPlayerStorageValue(cid, 2044) == TRUE then
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "It is empty.")
  end
 end
  return TRUE
end

function autoMsg(cid)
	   doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You now have a lamp. Try leaving your house again.")
 return TRUE
end
 
Last edited:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local timeSec = 5
	local access = 1
	if getPlayerGroupId(cid) <= access then
		if getPlayerStorageValue(cid, 2044) == FALSE then
			doPlayerAddItem(cid, 2044, 1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have found a Lamp.")
			addEvent(autoMsg, timeSec * 1000, cid)
			setPlayerStorageValue(cid, 2044, TRUE)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "It is empty.")
		end
	end
  return TRUE
end

function autoMsg(cid)
	return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You now have a lamp. Try leaving your house again.")
end
 
I use sqlite:
Code:
	-- Database
	-- NOTE: sqlFile is used only by sqlite database, and sqlKeepAlive by mysql database.
	-- To disable sqlKeepAlive use 0 value.
	sqlType = "sqlite"
	sqlHost = "localhost"
	sqlPort = 3306
	sqlUser = "root"
	sqlPass = ""
	sqlDatabase = "theforgottenserver"
	sqlFile = "forgottenserver.s3db"
	sqlKeepAlive = 60
	passwordType = "plain"
 
I use sqlite:
Code:
	-- Database
	-- NOTE: sqlFile is used only by sqlite database, and sqlKeepAlive by mysql database.
	-- To disable sqlKeepAlive use 0 value.
	sqlType = "sqlite"
	sqlHost = "localhost"
	sqlPort = 3306
	sqlUser = "root"
	sqlPass = ""
	sqlDatabase = "theforgottenserver"
	sqlFile = "forgottenserver.s3db"
	sqlKeepAlive = 60
	passwordType = "plain"

Then use sqlitemanager to delete from player_storage records with key 2044, or set it in the script to another one, 2045.
 
Back
Top