zexus
Member
- Joined
- Oct 1, 2016
- Messages
- 133
- Reaction score
- 18
I wanna make something different in my pvp, i wanna check the ladders before player can get up.
For example, if have fire field, mw the player can not get up on ladders
I've tried it:
But using that the players are not upping
What should i change?
For example, if have fire field, mw the player can not get up on ladders
I've tried it:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- there is MW or ELEMENTAL FIELDS in pos?
local tmp = getTileThingByPos({x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = 1})
if ((isPlayer(tmp.uid) and tmp.uid ~= cid)) or (tmp.itemid == 1497 or tmp.itemid == 1499 or tmp.itemid == 1496 or tmp.itemid == 1495 or tmp.itemid == 1492 or tmp.itemid == 1493 or tmp.itemid == 1494) then
return false
end
-- get UP
fromPosition.z = fromPosition.z - 1
fromPosition.y = fromPosition.y + 1
if(doTileQueryAdd(cid, fromPosition, 38, false) ~= RETURNVALUE_NOERROR) then
local field = getTileItemByType(fromPosition, ITEM_TYPE_MAGICFIELD)
if(field.uid == 0 or not isInArray(FIELDS, field.itemid)) then
fromPosition.y = fromPosition.y - 2
else
check = true
end
end
return true
end
But using that the players are not upping
What should i change?