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

Determine whetever a player is standing on a certain position

Raffe123

New Member
Joined
Nov 17, 2013
Messages
6
Reaction score
0
How do I achieve this? When someone pulls a lever I wanna check if a player is standing on a certain position on the map. I'm drawing a blank here.

I thought this would would work, but it dont.

Any ideas?


Code:
function onUse(cid, item)
    local playerCheck = getThingFromPos({x=32854, y=32326, z=8, stackpos=253})

        if item.itemid == 1945 and isPlayer(playerCheck) then
            doPlayerSendTextMessage(cid, 22, "Someone is standing on the tile :)")
        else
          doPlayerSendTextMessage(cid, 22, "Theres no one standing on the special tile :(")
        end
  
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local playerCheck = getTopCreature({x=32854, y=32326, z=8, stackpos=253}).uid
    if item.itemid == 1945 and isPlayer(playerCheck) then
        print("Someone is standing on the tile :)")
    else
        print("There is no one standing on the special tile :(")
    end
    return true
end
 
Code:
function onUse(cid, item, frompos, item2, topos)

    local pos = {x = 32854, y = 32326, z = 8, stackpos=253}

    if item.itemid == 1945 and getThingFromPos(pos).itemid > 0 then
        doPlayerSendTextMessage(cid, 22, "Someone is standing on the tile :)")
    else
        doPlayerSendTextMessage(cid, 22, "There is no one standing on the special tile :(")
    end
    return true
end
 
/\
This wont check if its a player standing on the tile. With that said, if a monster or npc stand on the the tile, it will count it also.
 
Back
Top