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

Solved Checking if a player has got an item

tokenzz

:thinking:
Joined
Feb 2, 2013
Messages
778
Solutions
2
Reaction score
345
Hiho,

I've been looking around on OTLand to see if there's a way function check if a player has an item in their inventory. However, I've mainly just found search results that are for tfs 1.x+ and I'm using OTHire (Similar to OTServ SVN 0.6.3 or tfs 0.3.6, 0.3.7)

Situation: e.g someone steps on a tile, it checks if you have the item etc.... (Not requesting a full script, just asking how I'd do this in a script/if there are any existing functions for this specific type of event.)

Thanks in advance!

Kind regards,

t0kenz
 
Code:
local itemid = 12345
local count = 1
function onStepIn(cid, item, position, fromPosition)
    if getPlayerItemCount(cid, itemid) >= count then
        -- do something
    end
    return true
end
 
Back
Top