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

One problem key paradox

Nacke

New Member
Joined
Feb 13, 2008
Messages
79
Reaction score
0
Hello,gives the key but not the action and does not give the quest as done

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

	if item.uid == 10004 and getPlayerStorageValue(cid, 10004) == -1 then
      doPlayerSendTextMessage(cid,22,"You have found a key.")
	  key = doPlayerAddItem(cid, 2089, 1)
      doSetItemActionId(key,3899)
	  setPlayerStorageValue(cid, 10004,1)
    else
      doPlayerSendTextMessage(cid,22,"It is empty.")
	 end
  return 1
end

You see a copper key (Key:0).
It weighs 1.00 oz.
ItemID: [2089].

im using tfs 0.3.6 thz for all


Sorry for my bad English.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 10004) < 1 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a key.")
		doItemSetAttribute(doPlayerAddItem(cid, 2089, 1), "aid", 3899)
		setPlayerStorageValue(cid, 10004,1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The " .. getItemName(item.uid) .. " is empty.")
	end
	return true
end
mor cip:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 10004) < 1 then
		local key = doCreateItemEx(2089, 1)
		doItemSetAttribute(key, "aid", 3899)
		if getPlayerFreeCap(cid) >= getItemWeight(key) then
			if doPlayerAddItemEx(cid, key, false) == RETURNVALUE_NOERROR then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a key.")
				setPlayerStorageValue(cid, 10004, 1)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a key, but you have no room to take it.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a key. Weighing " .. getItemWeight(key, 1) .." oz it is too heavy.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The " .. getItemName(item.uid) .. " is empty.")
	end
	return true
end
 
Last edited:
gratzz

thz,works perfect are a god


ItemID: [2089], ActionID: [3899].
Position: [X: 32497] [Y: 31888] [Z: 7].
19:01 The is empty.
 
Back
Top