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

getItem..() functions

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hi there!

I noticed that scripts using getItemAttack(uid), getItemDefense(uid) etc. stopped working as usual.

Function:
Code:
function isArmor(uid)
	uid = uid or 0
	if getItemArmor(uid) > 0 and getItemAttack(uid) == 0 and getItemDefense(uid) == 0 and getItemWeaponType(uid) == 0 then
		return true
	end
	return false
end

returns an error, where getItemArmor(uid) is nil. Where uid is itemEx.uid, and shouldn't be nil.

I have made second test. Using executeLua script (by Colandus):
15:27 Running: doPlayerSendCancel(cid, getItemArmor(getPlayerSlotItem(cid, CONST_SLOT_ARMOR))):end:
15:27 [string "doPlayerSendCancel(cid, getItemArmor(getPla..."]:1: attempt to call global 'getItemArmor' (a nil value)

it really returned nil. Let's make second test. getItemWeight(uid[, precise]) always worked.

15:30 Running: doPlayerSendCancel(cid, tostring(getItemWeight(getPlayerSlotItem(cid, CONST_SLOT_ARMOR)))):end:
--player receives cancel message: false

Then really something is wrong. Maybe it's a bug? : p

PS. I am using 3493 revision, from privateSVN.
 
Lua:
//getItemAttribute(uid, key)

getItemAttribute(uid, "attack")
getItemAttribute(uid, "defense")
getItemAttribute(uid, "armor")

#weight

Lua:
item = getPlayerSlotItem(cid, CONST_SLOT_ARMOR).uid
weight = getItemWeight(item)
doPlayerSendCancel(cid, tostring(weight))
or
doPlayerSendCancel(cid, tostring(getItemWeight(getPlayerSlotItem(cid, CONST_SLOT_ARMOR).uid)))
 
Well, I tried again.
16:58 Running: doPlayerSendCancel(cid, tostring(getItemAttribute(getPlayerSlotItem(CONST_SLOT_ARMOR).uid, "armor"))):end:

It returned nil :/
 
Back
Top