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

Why can a player take all 4 anni rewards?

zedo99

New Member
Joined
Jun 26, 2009
Messages
34
Reaction score
0
Location
Cincinnati, OH
On my sever you can take all 4 rewards once. How can i make it only 1?


My code is

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 2000 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a demon armor.")
doPlayerAddItem(cid,2494,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 2001 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a magic sword.")
doPlayerAddItem(cid,2400,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 2002 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a stonecutter axe.")
doPlayerAddItem(cid,2431,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
elseif item.uid == 2003 then
queststatus = getPlayerStorageValue(cid,6076)
if queststatus == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a present.")
doPlayerAddItem(cid,2326,1)
setPlayerStorageValue(cid,6076,1)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
end
end
return 1
end
 
Messiest script ever.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

status = getPlayerStorageValue(cid,6076)

if status < 1 then

	if item.uid == 2000 then
		reward = 2494
		text = "You have found a demon armor."

	elseif item.uid == 2001 then
		reward = 2400
		text = "You have found a magic sword."

	elseif item.uid == 2002 then
		reward = 2431
		text = "You have found a stonecutter axe.")

	elseif item.uid == 2003 then
		reward = 2326
		text = "You have found a present.")
	end

if reward ~= nil then
	setPlayerStorageValue(cid,6076,1)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text)
		doPlayerAddItem(cid, reward, 1)
	else
		doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
			end
		end
	return 1
end
 
Back
Top