Lurk
Active Member
- Joined
- Dec 4, 2017
- Messages
- 336
- Reaction score
- 48
Hi, I want my players to be able to use a special weapon alongside their normal weapons, for that I'd need my second weapon to be dual wield and their normal weapons to also be dual wield
the thing is, making their normal weapons dual wield will allow them to use 2 normal weapons together which I don't want.
This is the beggining of a code I'm trying to make
edit: new code
it doesn't return errors in the console but also doesn't work, in game I'm receiving the PopupFYI but the player equips it anyway, I don't know how to prevent the player from equiping the item
tfs 0.4 rev 3777
the thing is, making their normal weapons dual wield will allow them to use 2 normal weapons together which I don't want.
This is the beggining of a code I'm trying to make
edit: new code
Lua:
function onEquip(cid, item, slot)
local slotitem = getPlayerSlotItem(cid, CONST_SLOT_LEFT) -- edite o slot
local itemid1 = 7391
local itemid2 = 7754
local itemid3 = 8849
if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid1 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid1 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid1 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid2 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid1 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid3 then
doPlayerPopupFYI(cid, "erro 1 if")
return false
elseif getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid2 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid1 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid2 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid2 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid2 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid3 then
doPlayerPopupFYI(cid, "erro 2 if")
return false
elseif getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid3 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid1 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid3 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid2 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == itemid3 and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == itemid3 then
doPlayerPopupFYI(cid, "erro 3 if")
return false
end
return true
end
tfs 0.4 rev 3777
Last edited: