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

getPlayerSlotItem not working

mikeware

New Member
Joined
Jul 17, 2007
Messages
338
Reaction score
0
Location
Brazil
Hey, i made a script with the function getPlayerSlotItem but it's not working. using 2.9.

here's the script
Code:
function onCastSpell(cid, var)
if getPlayerSlotItem(cid, 2) == 2173 then
	doSendMagicEffect(getPlayerPosition(cid), 3)
else
	doPlayerSendCancel(cid, "blablabla")
	doSendMagicEffect(getPlayerPosition(cid), 2)
end
end

well, if the function was working, it would reproduce a magic effect of value 3 but is not, it's sending the cancel msg and the other magiceffect..

yea, im with a AOL equiped (id 2173) and the spells.xml is everything right
this is just a test script.
 
Try use getPlayerSlotItem(cid, 2).itemid

I think it must work, becouse this function wasnt changed long time, and is still working for me.
 
like...
function onCastSpell(cid, var)
if getPlayerSlotItem(cid, 2).2173 then
doSendMagicEffect(getPlayerPosition(cid), 3)
else
doPlayerSendCancel(cid, "blablabla")
doSendMagicEffect(getPlayerPosition(cid), 2)
end
end

??
 
Found a way to work, but the way that was suposed to work
Code:
getPlayerSlotItem(cid, 2) == itemid
is not workingo
 
if getPlayerSlotItem(cid, 2).itemid == 2173 then
 
You should also use
getCreaturePosition(cid)
and not getPlayerPosition(cid) because that function is going to be removed sometime in the future.
 
You should also use
getCreaturePosition(cid)
and not getPlayerPosition(cid) because that function is going to be removed sometime in the future.

that's bad cuz ill need to recheck all my scripts to see if there are a playerposition(cid) to change into creatureposition... would be better if was both of them.


@TALATUREN
ya, that could help, the way i made to work is similar.
 
Well, it's going to be removed sooner or later so you can just start fixing it :P
 
It'll be removed in 0.3.
 
Back
Top