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

TFS 0.X slot system

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
hello guys i use 0.4
and i use slot system for mock
and work good but have one problem don't work with soft boots and boots of haste and all boots no have armor
don't work with rings no have armor and charges

i want edit this cod to work with boots and rings don't have armor and charges like ( gold ring , boots of haste, soft boots, etc)

Lua:
local function isArmor(uid) -- Function by Mock the bear.
    if (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
        return true
    end
    return false
end
Lua:
    if isInArray(conf.ignoredIds, itemEx.itemid)
        or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
        or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
        or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then
        doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
        return TRUE
    end
r
 
Last edited:
Solution
Eh.. it doesn't even matter, but if you want xd

Code:
local function isArmor(uid) -- Function by Mock the bear.
    if isInArray(conf.byPass, uid.itemid) or (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
        return true
    end
    return false
end

Ofc remove first change xd

This should work, but first change should work too.

First you can check if you copy good code from my first post, because i edit this, because of fuk up xd
Add new table to conf.. for example "byPass"
byPass = {idBoots,otherid,etc}
And change this:

Code:
if isInArray(conf.ignoredIds, itemEx.itemid)
        or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
        or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
        or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then
        doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
        return TRUE
    end

To

Code:
if not isInArray(conf.byPass, itemEx.itemid) and (isInArray(conf.ignoredIds, itemEx.itemid)
        or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
        or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
        or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid)) then
        doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
        return TRUE
    end

Better option use
Code:
conf.byPass[itemEx.itemid] == nil
but like you want.
 
Last edited:
Add new table to conf.. for example "byPass"
byPass = {idBoots,otherid,etc}
And change this:

Code:
if isInArray(conf.ignoredIds, itemEx.itemid)
        or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
        or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
        or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid) then
        doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
        return TRUE
    end

To

Code:
if not isInArray(conf.byPass, itemEx.itemid) and (isInArray(conf.ignoredIds, itemEx.itemid)
        or (not getItemWeaponType(itemEx.uid) or getItemWeaponType(itemEx.uid) > 5)
        or (getItemWeaponType(itemEx.uid) == 0 and not isArmor(itemEx))
        or itemEx.itemid == 0 or itemEx.type > 1 or isItemStackable(itemEx.uid)) then
        doPlayerSendTextMessage(cid, 24,"You cant open a slot on this item.")
        return TRUE
    end

Better option use
Code:
conf.byPass[itemEx.itemid] == nil
but like you want.
not work the problem is here isArmor(itemEx)
 
Code:
if not isInArray(conf.byPass, itemEx.itemid)[...]

This part of code skip "isArmor" function if you type id in byPass table, because this check if table is not empty then return false, else.. go check other shit, BUT if you type id your boots in byPass it return false and dont check other requirement, so... No, "isArmor" is not a problem.

probably you don't add this boots in movement.xml, if you have error just post this. xd
 
Last edited:
Code:
if not isInArray(conf.byPass, itemEx.itemid)[...]

This part of code skip "isArmor" function if you type id in byPass table, because this check if table is empty then return false, else.. go check other shit, BUT if you type id your boots in byPass it return false and dont check other requirement, so... No, "isArmor" is not a problem.

probably you don't add this boots in movement.xml, if you have error just post this. xd
no have error when add boots id in byPass always say You cant open a slot on this item and other items work like be4
isArmor is problem because this function check if items have armor >= 1 or no
 
Eh.. it doesn't even matter, but if you want xd

Code:
local function isArmor(uid) -- Function by Mock the bear.
    if isInArray(conf.byPass, uid.itemid) or (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
        return true
    end
    return false
end

Ofc remove first change xd

This should work, but first change should work too.

First you can check if you copy good code from my first post, because i edit this, because of fuk up xd
 
Solution
Eh.. it doesn't even matter, but if you want xd

Code:
local function isArmor(uid) -- Function by Mock the bear.
    if isInArray(conf.byPass, uid.itemid) or (getItemInfo(uid.itemid).armor ~= 0) and (getItemWeaponType(uid.uid) == 0) then
        return true
    end
    return false
end

Ofc remove first change xd

This should work, but first change should work too.

First you can check if you copy good code from my first post, because i edit this, because of fuk up xd
yes this one work but first one no :D
 
Back
Top