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

Lua compare getPlayerSlotItem AID not working

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Can someone please tell me why my script is not respecting if getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid).aid ~= getPlayerGUID(cid)+20000 then?

SOLVED
 
Last edited:
I don't think you can do SOMETHING.itemid.aid

from:
LUA:
getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid).aid
to:
LUA:
getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_AMMO).aid

I may be wrong though.
 
It shows errors doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid, "magic", (getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid).magic) + magic)

LUA:
local magic = 2
local points = 2

function onSay(cid, words, param)

if isPlayer(cid) then
	if words == "!book" then
		if param == "magic" then
			if (getAccountPoints(cid) >= points) then
				if (getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == 8983) then
					if(getPlayerSlotItem(cid, CONST_SLOT_AMMO).actionid) ~= getPlayerGUID(cid)+20000 then
						doRemovePoints(cid, points)
						doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid, "magic", (getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid).magic) + magic)
						doSendMagicEffect(getCreaturePosition(cid), 12)
						doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid, "aid", getPlayerGUID(cid)+20000)
					else
						doPlayerSendCancel(cid, "Your book is already modified.")
						doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
					end
				else
					doPlayerSendCancel(cid, "You must place your vip book in arrow slot.")
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				end
			else
				doPlayerSendCancel(cid, "You do not have enough premium points.")
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			end
		end
	end	
end
return true
end
 
I think it's the same problem as before:

LUA:
doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid, "magic", (getItemInfo(getPlayerSlotItem(cid, CONST_SLOT_AMMO).magic) + magic)

You're just getting a specific item's information, therefore the .itemid portion before the .magic is irrelevant.
 
I guess you should use:
getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_AMMO), "magic") + magic
 
Back
Top