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

function disarmPlayer(cid)

Status
Not open for further replies.

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
next one..
is this correct?

Lua:
function disarmPlayer(cid)
    SLOTS = {1,2,3,4,5,6,7,8,9,10}
        for i = 1, #SLOTS do
            local itam = getPlayerSlotItem(cid, SLOTS[i])
            if itam ~= 0 then
                doPlayerRemoveItem(cid, itam.itemid, getPlayerItemCount(cid, itam.itemid))
            end
            return true
        end
    end
I need it so it removes any item the player has, either all slots or specified :S disarm him!!
 
Last edited:
Code:
for i = CONST_SLOT_FIRST, CONST_SLOT_LAST do
	local item = getPlayerSlotItem(cid, i)
	if (item.uid) then
		doRemoveItem(item.uid, item.type and item.type or 1)
	end
end
 
that will work? even if he doesnt have an/some item in his slots?
 
Lua:
for i = CONST_SLOT_FIRST, CONST_SLOT_LAST do
	local item = getPlayerSlotItem(cid, i).uid
	if (item ~= 0) then
		doRemoveItem(item)
	end
end

yes work even if he havent
 
Status
Not open for further replies.
Back
Top