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

how i use this function getTileItemById?

Ralfegor

New Member
Joined
Apr 6, 2008
Messages
297
Reaction score
1
i have to use this like this?
Code:
function onLook(cid, position)
if getTileItemById(position, 4608) then
doSendCancel(cid, "You can not teleport into water.")

when i use it like this it say the error("You can not teleport into water.") anywhere i click and i want to say the error("You can not teleport into water.") only when i click on item id 4608
 
i have to use this like this?
Code:
function onLook(cid, position)
if getTileItemById(position, 4608) then
doSendCancel(cid, "You can not teleport into water.")

when i use it like this it say the error("You can not teleport into water.") anywhere i click and i want to say the error("You can not teleport into water.") only when i click on item id 4608

if getTileItemById(position, 4608).uid > 0 then
 
0.0 tnxx ++rep 1 more question if i want all water ids gimme just an example

Code:
function onLook(cid, position)
local water = {4608, 4609, 4610, 4611, 4612}
if getTileItemById(position, water).uid > 0 then 
doSendCancel(cid, "You can not teleport into water.")

this is okay? will it work?

nop i tried :(
 
Last edited:
Lua:
function onLook(cid, position)
 local water = {4608, 4609, 4610, 4611, 4612}
 for i = 1, 5 do
  if getTileItemById(position, water[i]).uid > 0 then 
  doSendCancel(cid, "You can not teleport into water.")
 
ok tnx :D, gonna check if work

nop doesn't work i can teleport to waters ids local water = {4608, 4609, 4610, 4611, 4612}
 
Last edited:
After this add return true.
Lua:
function onLook(cid, position)
 local water = {4608, 4609, 4610, 4611, 4612}
 for i = 1, 5 do
  if getTileItemById(position, water[i]).uid > 0 then 
    doSendCancel(cid, "You can not teleport into water.")
    return TRUE
  end
end
 
Back
Top