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

Radar pos

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
Hello, i need small help with the script below, i have a problem with position. I didnt tried to work with function in pairs/making table so i need small help here. What i need exacly is that the radar need to read more than just 1 position.

Code:
function onUse(cid, item, frompos)

kula1 = {x=2114, y=1157, z=7, stackpos=1} --- item position

getpiece1 = getThingfromPos(kula1)


player = getPlayerPosition(cid)

if item.itemid == 11382 and getpiece1.itemid == 2626 then --- 11382 id radar, 2626 item id Dragon ball.

if player.x > 700 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is on Earth.")
elseif player.z > kula1.z and (player.y - kula1.y) <= 3 and (player.y - kula1.y) > -3 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is above you.")
elseif player.z < kula1.z and (player.x - kula1.x) <= 3 and (player.x - kula1.x) > -3 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is below you.")
else
if player.x > kula1.x then
if player.y > kula1.y then
if (player.y - kula1.y) >= 3 then
if (player.x - kula1.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-west.")
else
if (player.y - kula1.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
end
end
else
if (player.x - kula1.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
end
end
elseif player.y < kula1.y then
if (kula1.y - player.y) >= 3 then
TextMessage(cid,22,"Dragon Ball is far to the south.")
end
end
else
if (player.x - kula1.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
end
end
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
end
elseif player.x < kula1.x then
if player.y > kula1.y then
if (player.y - kula1.y) >= 3 then
if (kula1.x - player.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-east.")
else
if (player.y - kula1.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
end
end
else
if (kula1.x - player.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
end
end
elseif player.y < kula1.y then
if (kula1.y - player.y) >= 3 then
if (kula1.x - player.x) >= 1 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-east.")
else
if (kula1.y - player.y) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
end
end
else
if (kula1.x - player.x) <= 10 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
end
end
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
end
else
if player.y > kula1.y then
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
end
end
end

else
doPlayerSendCancel(cid,"Radar Cant find the Dragon Ball.")
end
return 1
end

I have tried to make it:
kula1 = {
{x=2114, y=1157, z=7, stackpos=1},
{x=2113, y=1157, z=7, stackpos=1}
}
But then i got error that tile not found :(
TFS 0,4 rev 3777
Any help/explain/tips?


//Edit
I found something like this and edited a bit:
Code:
function onUse(cid, item, frompos, item2, topos)

kula = {
[1] = {x=99, y=189, z=7, stackpos=1},
[2] = {x=99, y=190, z=7, stackpos=1}
}


getpiece1 = getThingfromPos(kula[1]), getThingfromPos(kula[2])

player = getPlayerPosition(cid)

for wartosc = 1, 2 do

if item.itemid == 12749 and getpiece1.itemid == 13554  then

if player.x > 700 then
doPlayerSendTextMessage(cid,22,"Dragon Ball is on Earth.")
    elseif player.z > kula[wartosc].z and (player.y - kula[wartosc].y) <= 3 and (player.y - kula[wartosc].y) > -3 then
        doPlayerSendTextMessage(cid,22,"Dragon Ball is above you.")
    elseif player.z < kula[wartosc].z and (player.x - kula[wartosc].x) <= 3 and (player.x - kula[wartosc].x) > -3 then
        doPlayerSendTextMessage(cid,22,"Dragon Ball is below you.")
    else
        if player.x > kula[wartosc].x then  
            if player.y > kula[wartosc].y then      
                if (player.y - kula[wartosc].y) >= 3 then
                    if (player.x - kula[wartosc].x) >= 1 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-west.")
                    else
                        if (player.y - kula[wartosc].y) <= 10 then
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                        else
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                        end
                    end
                else
                    if (player.x - kula[wartosc].x) <= 10 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                    end
                end
            elseif player.y < kula[wartosc].y then
                if (kula[wartosc].y - player.y) >= 3 then
                    if (kula[wartosc].x - player.x) >= 1 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-west.")
                    else
if (kula[wartosc].y - player.y) <= 10 then
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                        else
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                        end
                    end
                else
                    if (player.x - kula[wartosc].x) <= 10 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                    end
                end
            else
                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
            end
        elseif player.x < kula[wartosc].x then
            if player.y > kula[wartosc].y then
                if (player.y - kula[wartosc].y) >= 3 then
                    if (kula[wartosc].x - player.x) >= 1 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-east.")
                    else
                        if (player.y - kula[wartosc].y) <= 10 then
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                        else
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                        end
                    end
                else
                    if (kula[wartosc].x - player.x) <= 10 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                    end
                end
            elseif player.y < kula[wartosc].y then
                if (kula[wartosc].y - player.y) >= 3 then
                    if (kula[wartosc].x - player.x) >= 1 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-east.")
                    else
                        if (kula[wartosc].y - player.y) <= 10 then
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                        else
                            doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                        end
                    end
                else
                    if (kula[wartosc].x - player.x) <= 10 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                    end
                end
            else
doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
            end
        else
            if player.y > kula[wartosc].y then  
                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
            else
                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
            end
        end
    end

else
doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
end

return 1
end
end
But it stills load only first position ;/
PS.
itemid == 13554 gives random ball from 1 to 7 thats why its same piece1 or maybe thats the mistake?
 
Last edited:
Solution
I don't really understand what you're saying, but from context I believe this might work:
Lua:
function onUse(cid, item, frompos, item2, topos)

    local kula = {
        [1] = {x=99, y=189, z=7, stackpos=1},
        [2] = {x=99, y=190, z=7, stackpos=1}
    }

    local missingPieces = false
    for i = 1, #kula do
        if(getThingfromPos(kula[i]).itemid ~= 13554) then
            missingPieces = true
            break
        end
    end
    local player = getPlayerPosition(cid)

    for wartosc = 1, 2 do

        if item.itemid == 12749 and not missingPieces then

            if player.x > 700 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball is on Earth.")
            elseif player.z > kula[wartosc].z and (player.y -...
I don't really understand what you're saying, but from context I believe this might work:
Lua:
function onUse(cid, item, frompos, item2, topos)

    local kula = {
        [1] = {x=99, y=189, z=7, stackpos=1},
        [2] = {x=99, y=190, z=7, stackpos=1}
    }

    local missingPieces = false
    for i = 1, #kula do
        if(getThingfromPos(kula[i]).itemid ~= 13554) then
            missingPieces = true
            break
        end
    end
    local player = getPlayerPosition(cid)

    for wartosc = 1, 2 do

        if item.itemid == 12749 and not missingPieces then

            if player.x > 700 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball is on Earth.")
            elseif player.z > kula[wartosc].z and (player.y - kula[wartosc].y) <= 3 and (player.y - kula[wartosc].y) > -3 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball is above you.")
            elseif player.z < kula[wartosc].z and (player.x - kula[wartosc].x) <= 3 and (player.x - kula[wartosc].x) > -3 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball is below you.")
            else
                if player.x > kula[wartosc].x then
                    if player.y > kula[wartosc].y then   
                        if (player.y - kula[wartosc].y) >= 3 then
                            if (player.x - kula[wartosc].x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-west.")
                            else
                                if (player.y - kula[wartosc].y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                                end
                            end
                        else
                            if (player.x - kula[wartosc].x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                            end
                        end
                    elseif player.y < kula[wartosc].y then
                        if (kula[wartosc].y - player.y) >= 3 then
                            if (kula[wartosc].x - player.x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-west.")
                            else
                                if (kula[wartosc].y - player.y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                                end
                            end
                        else
                            if (player.x - kula[wartosc].x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                            end
                        end
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                    end
                elseif player.x < kula[wartosc].x then
                    if player.y > kula[wartosc].y then
                        if (player.y - kula[wartosc].y) >= 3 then
                            if (kula[wartosc].x - player.x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-east.")
                            else
                                if (player.y - kula[wartosc].y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                                end
                            end
                        else
                            if (kula[wartosc].x - player.x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                            end
                        end
                    elseif player.y < kula[wartosc].y then
                        if (kula[wartosc].y - player.y) >= 3 then
                            if (kula[wartosc].x - player.x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-east.")
                            else
                                if (kula[wartosc].y - player.y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                                end
                            end
                        else
                            if (kula[wartosc].x - player.x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                            end
                        end
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    end
                else
                    if player.y > kula[wartosc].y then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                    end
                end
            end
        else
            doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
        end
    end
    return true
end

If that's not what you meant, maybe you meant this:
Code:
function onUse(cid, item, frompos, item2, topos)

    local kula = {
        [1] = {x=99, y=189, z=7, stackpos=1},
        [2] = {x=99, y=190, z=7, stackpos=1}
    }

    local player = getPlayerPosition(cid)

    for wartosc = 1, 2 do

        if item.itemid == 12749 and getThingfromPos(kula[wartosc]).itemid == 13554 then

            if player.x > 700 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is on Earth.")
            elseif player.z > kula[wartosc].z and (player.y - kula[wartosc].y) <= 3 and (player.y - kula[wartosc].y) > -3 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is above you.")
            elseif player.z < kula[wartosc].z and (player.x - kula[wartosc].x) <= 3 and (player.x - kula[wartosc].x) > -3 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is below you.")
            else
                if player.x > kula[wartosc].x then 
                    if player.y > kula[wartosc].y then     
                        if (player.y - kula[wartosc].y) >= 3 then
                            if (player.x - kula[wartosc].x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the north-west.")
                            else
                                if (player.y - kula[wartosc].y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the north.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the north.")
                                end
                            end
                        else
                            if (player.x - kula[wartosc].x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the west.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the west.")
                            end
                        end
                    elseif player.y < kula[wartosc].y then
                        if (kula[wartosc].y - player.y) >= 3 then
                            if (kula[wartosc].x - player.x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the south-west.")
                            else
                                if (kula[wartosc].y - player.y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the south.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the south.")
                                end
                            end
                        else
                            if (player.x - kula[wartosc].x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the west.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the west.")
                            end
                        end
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the west.")
                    end
                elseif player.x < kula[wartosc].x then
                    if player.y > kula[wartosc].y then
                        if (player.y - kula[wartosc].y) >= 3 then
                            if (kula[wartosc].x - player.x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the north-east.")
                            else
                                if (player.y - kula[wartosc].y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the north.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the north.")
                                end
                            end
                        else
                            if (kula[wartosc].x - player.x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the east.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the east.")
                            end
                        end
                    elseif player.y < kula[wartosc].y then
                        if (kula[wartosc].y - player.y) >= 3 then
                            if (kula[wartosc].x - player.x) >= 1 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the south-east.")
                            else
                                if (kula[wartosc].y - player.y) <= 10 then
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the south.")
                                else
                                    doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the south.")
                                end
                            end
                        else
                            if (kula[wartosc].x - player.x) <= 10 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the east.")
                            else
                                doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is far to the east.")
                            end
                        end
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the east.")
                    end
                else
                    if player.y > kula[wartosc].y then 
                        doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the north.")
                    else
                        doPlayerSendTextMessage(cid,22,"Dragon Ball #" .. wartosc .. " is to the south.")
                    end
                end
            end
        else
            doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball #" .. wartosc .. ".")
        end
    end
end
 
Last edited:
Solution
Ok i changed a script a lil, now all directions works fine (i hope so) but the problem is, that again they read only one, first place of dragon ball:
Code:
function onUse(cid, item, frompos, item2, topos)

    local kula = {
        [1] = {x=99, y=189, z=7, stackpos=1},
        [2] = {x=99, y=190, z=7, stackpos=1},
              [3] = {x=99, y=191, z=7, stackpos=1}
    }

    local player = getPlayerPosition(cid)

    for wartosc = 1, 3 do

        if item.itemid == 12749 and getThingfromPos(kula[wartosc]).itemid == 13554 then
                -- daleko --
            if player.x  > 700 then
               doPlayerSendTextMessage(cid,22,"Dragon Ball is somewhere on the ground.")
        -- nad --
            elseif player.z > kula[wartosc].z and (player.y - kula[wartosc].y) <= 20 and (player.y - kula[wartosc].y) > -20 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball is above you.")
        -- pod --
            elseif player.z < kula[wartosc].z and (player.x - kula[wartosc].x) <= 20 and (player.x - kula[wartosc].x) > -20 then
                doPlayerSendTextMessage(cid,22,"Dragon Ball is below you.")

                    
                    --north west --
  elseif player.x > kula[wartosc].x and player.y > kula[wartosc].y then   
                                    if (player.y - kula[wartosc].y) >= 3 and (player.y - kula[wartosc].y) <= 80 and (player.x - kula[wartosc].x) >= 1 and (player.x - kula[wartosc].x) <= 60 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-west.")
                        elseif (player.y - kula[wartosc].y) >= 101 and (player.y - kula[wartosc].y) <= 300 and (player.x - kula[wartosc].x) >= 101 and (player.x - kula[wartosc].x) <= 300 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north-west.")
                                elseif (player.y - kula[wartosc].y) >= 301 and (player.x - kula[wartosc].x) >= 303 then
                                         doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north-west.")
                                        
    
                            elseif (player.y - kula[wartosc].y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                        elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                                      elseif (player.y - kula[wartosc].y) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north.")
                                
                            
                            
                        elseif (player.x - kula[wartosc].x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                        elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                                      elseif (player.x - kula[wartosc].x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the west.")
                            
                        
end
                                        
                    
                        -- south west --
            elseif player.x > kula[wartosc].x and player.y < kula[wartosc].y then   
                                    if (kula[wartosc].y -player.y) >= 3 and (kula[wartosc].y -player.y) <= 80 and (player.x - kula[wartosc].x) >= 1 and (player.x - kula[wartosc].x) <= 60 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-west.")
                        elseif (kula[wartosc].y -player.y) >= 81 and (kula[wartosc].y -player.y) <= 230 and (player.x - kula[wartosc].x) >= 61 and (player.x - kula[wartosc].x) <= 200 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south-west.")
                                 elseif (kula[wartosc].y -player.y) >= 231 and (kula[wartosc].y -player.y) <= 699 and (player.x - kula[wartosc].x) >= 201 and (player.x - kula[wartosc].x) <= 699 then
                                         doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south-west.")
                                        
                                         -- south --
                            elseif (kula[wartosc].y - player.y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                        elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                                      elseif (kula[wartosc].y - player.y) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south.")
                                
                            
                            
                            -- west --
                        elseif (player.x - kula[wartosc].x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                        elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                                      elseif (player.x - kula[wartosc].x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the west.")
                                      end                                     
                        

                    -- north east --
elseif player.x < kula[wartosc].x and player.y > kula[wartosc].y then
                                    if (player.y - kula[wartosc].y) >= 3 and (player.y - kula[wartosc].y) <= 80 and (kula[wartosc].x - player.x) >= 1 and (kula[wartosc].x - player.x) <= 60 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-east.")
                        elseif (player.y - kula[wartosc].y) >= 81 and (player.y - kula[wartosc].y) <= 230 and (kula[wartosc].x - player.x) >= 61 and (kula[wartosc].x - player.x) <= 200 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north-east.")
                                 elseif (player.y - kula[wartosc].y) >= 231 and (player.y - kula[wartosc].y) <= 699 and (kula[wartosc].x - player.x) >= 201 and (kula[wartosc].x - player.x) <= 699 then
                                         doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north-east.")
                                
                                -- north --
                            elseif (player.y - kula[wartosc].y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                        elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                                      elseif (player.y - kula[wartosc].y) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north.")
                                
                            
                            
                            -- east --
                        elseif (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                        elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                                      elseif (kula[wartosc].x - player.x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                            
                        end
                        
                        -- south east --
                  elseif player.x < kula[wartosc].x and player.y < kula[wartosc].y then   
                                    if (kula[wartosc].y - player.y) >= 3 and (kula[wartosc].y - player.y) <= 80 and (kula[wartosc].x - player.x) >= 1 and (kula[wartosc].x - player.x) <= 60 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-east.")
                        elseif (kula[wartosc].y - player.y) >= 81 and (kula[wartosc].y - player.y) <= 230 and (kula[wartosc].x - player.x) >= 61 and (kula[wartosc].x - player.x) <= 200 then
                                doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south-east.")
                                 elseif (kula[wartosc].y - player.y) >= 231 and (kula[wartosc].y - player.y) <= 699 and (kula[wartosc].x - player.x) >= 201 and (kula[wartosc].x - player.x) <= 699 then
                                         doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south-east.")
                                
                                -- south --
                            elseif (kula[wartosc].y - player.y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                        elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                                      elseif (kula[wartosc].y - player.y) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south.")
                                
                            
                            
                            -- east --
                        elseif (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                        elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                                      elseif (kula[wartosc].x - player.x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                            
                        end
                        
                        -- east --
                     elseif player.x < kula[wartosc].x then
                      if (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                        elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                                      elseif (kula[wartosc].x - player.x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                                      
                    end
                    
                    -- north  --
                elseif player.y > kula[wartosc].y then
                      if (player.y - kula[wartosc].y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                        elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                                      elseif (player.y - kula[wartosc].y) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north.")
                                      end
                                      

                -- south --
                elseif player.y < kula[wartosc].y then
                      if (kula[wartosc].y - player.y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                        elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                                      elseif (kula[wartosc].y - player.y) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south.")
                                      end
                                                  
                -- west --
                    elseif player.x > kula[wartosc].x then
                      if (player.x - kula[wartosc].x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                        elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                                      elseif (player.x - kula[wartosc].x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the west.")
                                      end   
                                      
                  -- east --
            
                    elseif player.x < kula[wartosc].x then
                      if (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                        elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                                      elseif (kula[wartosc].x - player.x) > 200  then
                                      doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                                      end       
              
                              end               
                        
                
                
                
                
                                      else
            doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
        end
        
return true
end
end

and it reads only this position:
local kula = {
[1] = {x=99, y=189, z=7, stackpos=1},

What am i doing wrong? ;/
 
Last edited:
Lua:
function onUse(cid, item, frompos, item2, topos)

        local kula = {
            [1] = {x=99, y=189, z=7, stackpos=1},
            [2] = {x=99, y=190, z=7, stackpos=1},
            [3] = {x=99, y=191, z=7, stackpos=1}
        }
    
        local player = getPlayerPosition(cid)
    
        for wartosc = 1, 3 do
    
            if item.itemid == 12749 and getThingfromPos(kula[wartosc]).itemid == 13554 then
                -- daleko --
                if player.x    > 700 then
                    doPlayerSendTextMessage(cid,22,"Dragon Ball is somewhere on the ground.")
                    -- nad --
                elseif player.z > kula[wartosc].z and (player.y - kula[wartosc].y) <= 20 and (player.y - kula[wartosc].y) > -20 then
                    doPlayerSendTextMessage(cid,22,"Dragon Ball is above you.")
                    -- pod --
                elseif player.z < kula[wartosc].z and (player.x - kula[wartosc].x) <= 20 and (player.x - kula[wartosc].x) > -20 then
                    doPlayerSendTextMessage(cid,22,"Dragon Ball is below you.")
                    --north west --
                elseif player.x > kula[wartosc].x and player.y > kula[wartosc].y then
                    if (player.y - kula[wartosc].y) >= 3 and (player.y - kula[wartosc].y) <= 80 and (player.x - kula[wartosc].x) >= 1 and (player.x - kula[wartosc].x) <= 60 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-west.")
                    elseif (player.y - kula[wartosc].y) >= 101 and (player.y - kula[wartosc].y) <= 300 and (player.x - kula[wartosc].x) >= 101 and (player.x - kula[wartosc].x) <= 300 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north-west.")
                    elseif (player.y - kula[wartosc].y) >= 301 and (player.x - kula[wartosc].x) >= 303 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north-west.")
                    elseif (player.y - kula[wartosc].y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                    elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                    elseif (player.y - kula[wartosc].y) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north.")
                    elseif (player.x - kula[wartosc].x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                    elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                    elseif (player.x - kula[wartosc].x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the west.")
                    end
    
    
                    -- south west --
                elseif player.x > kula[wartosc].x and player.y < kula[wartosc].y then
                    if (kula[wartosc].y -player.y) >= 3 and (kula[wartosc].y -player.y) <= 80 and (player.x - kula[wartosc].x) >= 1 and (player.x - kula[wartosc].x) <= 60 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-west.")
                    elseif (kula[wartosc].y -player.y) >= 81 and (kula[wartosc].y -player.y) <= 230 and (player.x - kula[wartosc].x) >= 61 and (player.x - kula[wartosc].x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south-west.")
                    elseif (kula[wartosc].y -player.y) >= 231 and (kula[wartosc].y -player.y) <= 699 and (player.x - kula[wartosc].x) >= 201 and (player.x - kula[wartosc].x) <= 699 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south-west.")
                        -- south --
                    elseif (kula[wartosc].y - player.y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                    elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                    elseif (kula[wartosc].y - player.y) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south.")
                        -- west --
                    elseif (player.x - kula[wartosc].x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                    elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                    elseif (player.x - kula[wartosc].x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the west.")
                    end
                    -- north east --
                elseif player.x < kula[wartosc].x and player.y > kula[wartosc].y then
                    if (player.y - kula[wartosc].y) >= 3 and (player.y - kula[wartosc].y) <= 80 and (kula[wartosc].x - player.x) >= 1 and (kula[wartosc].x - player.x) <= 60 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north-east.")
                    elseif (player.y - kula[wartosc].y) >= 81 and (player.y - kula[wartosc].y) <= 230 and (kula[wartosc].x - player.x) >= 61 and (kula[wartosc].x - player.x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north-east.")
                    elseif (player.y - kula[wartosc].y) >= 231 and (player.y - kula[wartosc].y) <= 699 and (kula[wartosc].x - player.x) >= 201 and (kula[wartosc].x - player.x) <= 699 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north-east.")
                        -- north --
                    elseif (player.y - kula[wartosc].y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                    elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                    elseif (player.y - kula[wartosc].y) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north.")
                        -- east --
                    elseif (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                    elseif (kula[wartosc].x - player.x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                    end
                    -- south east --
                elseif player.x < kula[wartosc].x and player.y < kula[wartosc].y then
                    if (kula[wartosc].y - player.y) >= 3 and (kula[wartosc].y - player.y) <= 80 and (kula[wartosc].x - player.x) >= 1 and (kula[wartosc].x - player.x) <= 60 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south-east.")
                    elseif (kula[wartosc].y - player.y) >= 81 and (kula[wartosc].y - player.y) <= 230 and (kula[wartosc].x - player.x) >= 61 and (kula[wartosc].x - player.x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south-east.")
                    elseif (kula[wartosc].y - player.y) >= 231 and (kula[wartosc].y - player.y) <= 699 and (kula[wartosc].x - player.x) >= 201 and (kula[wartosc].x - player.x) <= 699 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south-east.")
                        -- south --
                    elseif (kula[wartosc].y - player.y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                    elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                    elseif (kula[wartosc].y - player.y) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south.")
                        -- east --
                    elseif (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                    elseif (kula[wartosc].x - player.x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                    end
                    -- east --
                elseif player.x < kula[wartosc].x then
                    if (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                    elseif (kula[wartosc].x - player.x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                    end
                    -- north    --
                elseif player.y > kula[wartosc].y then
                    if (player.y - kula[wartosc].y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the north.")
                    elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the north.")
                    elseif (player.y - kula[wartosc].y) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the north.")
                    end
                    -- south --
                elseif player.y < kula[wartosc].y then
                    if (kula[wartosc].y - player.y) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the south.")
                    elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the south.")
                    elseif (kula[wartosc].y - player.y) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the south.")
                    end
                    -- west --
                elseif player.x > kula[wartosc].x then
                    if (player.x - kula[wartosc].x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the west.")
                    elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the west.")
                    elseif (player.x - kula[wartosc].x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the west.")
                    end
    
                    -- east --
    
                elseif player.x < kula[wartosc].x then
                    if (kula[wartosc].x - player.x) <= 50 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is to the east.")
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is far to the east.")
                    elseif (kula[wartosc].x - player.x) > 200    then
                        doPlayerSendTextMessage(cid,22,"Dragon Ball is very far to the east.")
                    end
    
                end
    
            else
                doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
            end
        end
        return true
    end
 
Yeah i forgot to mention that i had and tried to use script that u gave (as i said before i tried many edits with end/else/elseif) :p, positions works fine but it shows position together with
Code:
else
                doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
so its looks like:

14:52 Dragon Ball is to the south.
14:52 Radar Cannot find the Dragon Ball.

When i try making it like that:

Code:
            else
                doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
        
        end
        return true
    end
    end
Then it reads only 1st position as in my script

With:
Code:
                    end

            

            else
                doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
            end
        end
        end
        return true
    end
It read pos of bal,ls but then
else
doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
doesnt work XD

Also the 15th line:
Code:
if player.x    > 700 then
                    doPlayerSendTextMessage(cid,22,"Dragon Ball is somewhere on the ground.")
Is it only me or its wrong? Shouldnt it also read ball pos? :D



after i switched else msg to:
doPlayerSendTextMessage (cid,22,"Radar Cannot find the Dragon Ball.")

It shows it reads pos of "all" 3 balls, but it had to load only 1 of them, as i said all balls have same id, [wartosc] in this script is like [pos]
Only that else is left to finish it... I hope ;x and that line 15..... i guess XD
 
Last edited:
So you say there's three balls, how do you want to show the position of all the balls?
The script checks all the balls and sends a message for each one of them, do you want to show only the first ball found?
 
No no, u understand me wrong, its all working fine, but- there are no three balls , there is 1 item with 3 positions. Dunno how to explain it better... so i just give u an example:

There's event that drop the ball (item 13554), with random pos (kula) = { 1}, {2,} etc

Then this script load pos from event drop added to the kula[wartosc] (wartosc here works as pos i think...)
and shows where the ball is, as i said it all works fine but last ELSE loads all 3 pos so it take info from
Code:
        for wartosc = 1, 3 do
to show the missing ball msg
Code:
  else
                doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
The thing is it load all [wartosc] (so pos in this table i hope) and i want it to load one of them, or just simply switch it to:

Code:
elseif <script to check if ball is on ground>

                doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")
but when i try:

elseif not getThingfromPos(kula[wartosc]).itemid == 13554 then
doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball.")

Its same as i would just Delete the lines #165 and 166... so when no ball on the ground i dont have any info its not there.
 
Okay, I think I understand now.

Lua:
function onUse(cid, item, frompos, item2, topos)

        local kula = {
            [1] = {x=99, y=189, z=7, stackpos=1},
            [2] = {x=99, y=190, z=7, stackpos=1},
            [3] = {x=99, y=191, z=7, stackpos=1}
        }
    
        local player = getPlayerPosition(cid)
        local msg = "Radar Cannot find the Dragon Ball."
        local found = false
        for wartosc = 1, 3 do
    
            if item.itemid == 12749 and getThingfromPos(kula[wartosc]).itemid == 13554 then
                -- daleko --
                if player.x  > 700 then
                    msg = "Dragon Ball is somewhere on the ground"
                    -- nad --
                elseif player.z > kula[wartosc].z and (player.y - kula[wartosc].y) <= 20 and (player.y - kula[wartosc].y) > -20 then
                    msg = "Dragon Ball is above you"
                    -- pod --
                elseif player.z < kula[wartosc].z and (player.x - kula[wartosc].x) <= 20 and (player.x - kula[wartosc].x) > -20 then
                    msg = "Dragon Ball is below you"
                    --north west --
                elseif player.x > kula[wartosc].x and player.y > kula[wartosc].y then
                    if (player.y - kula[wartosc].y) >= 3 and (player.y - kula[wartosc].y) <= 80 and (player.x - kula[wartosc].x) >= 1 and (player.x - kula[wartosc].x) <= 60 then
                        msg = "Dragon Ball is to the north-west"
                    elseif (player.y - kula[wartosc].y) >= 101 and (player.y - kula[wartosc].y) <= 300 and (player.x - kula[wartosc].x) >= 101 and (player.x - kula[wartosc].x) <= 300 then
                        msg = "Dragon Ball is far to the north-west"
                    elseif (player.y - kula[wartosc].y) >= 301 and (player.x - kula[wartosc].x) >= 303 then
                        msg = "Dragon Ball is very far to the north-west"
                    elseif (player.y - kula[wartosc].y) <= 50 then
                        msg = "Dragon Ball is to the north"
                    elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                        msg = "Dragon Ball is far to the north"
                    elseif (player.y - kula[wartosc].y) > 200    then
                        msg = "Dragon Ball is very far to the north"
                    elseif (player.x - kula[wartosc].x) <= 50 then
                        msg = "Dragon Ball is to the west"
                    elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                        msg = "Dragon Ball is far to the west"
                    elseif (player.x - kula[wartosc].x) > 200    then
                        msg = "Dragon Ball is very far to the west"
                    end
    
    
                    -- south west --
                elseif player.x > kula[wartosc].x and player.y < kula[wartosc].y then
                    if (kula[wartosc].y -player.y) >= 3 and (kula[wartosc].y -player.y) <= 80 and (player.x - kula[wartosc].x) >= 1 and (player.x - kula[wartosc].x) <= 60 then
                        msg = "Dragon Ball is to the south-west"
                    elseif (kula[wartosc].y -player.y) >= 81 and (kula[wartosc].y -player.y) <= 230 and (player.x - kula[wartosc].x) >= 61 and (player.x - kula[wartosc].x) <= 200 then
                        msg = "Dragon Ball is far to the south-west"
                    elseif (kula[wartosc].y -player.y) >= 231 and (kula[wartosc].y -player.y) <= 699 and (player.x - kula[wartosc].x) >= 201 and (player.x - kula[wartosc].x) <= 699 then
                        msg = "Dragon Ball is very far to the south-west"
                        -- south --
                    elseif (kula[wartosc].y - player.y) <= 50 then
                        msg = "Dragon Ball is to the south"
                    elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                        msg = "Dragon Ball is far to the south"
                    elseif (kula[wartosc].y - player.y) > 200    then
                        msg = "Dragon Ball is very far to the south"
                        -- west --
                    elseif (player.x - kula[wartosc].x) <= 50 then
                        msg = "Dragon Ball is to the west"
                    elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                        msg = "Dragon Ball is far to the west"
                    elseif (player.x - kula[wartosc].x) > 200    then
                        msg = "Dragon Ball is very far to the west"
                    end
                    -- north east --
                elseif player.x < kula[wartosc].x and player.y > kula[wartosc].y then
                    if (player.y - kula[wartosc].y) >= 3 and (player.y - kula[wartosc].y) <= 80 and (kula[wartosc].x - player.x) >= 1 and (kula[wartosc].x - player.x) <= 60 then
                        msg = "Dragon Ball is to the north-east"
                    elseif (player.y - kula[wartosc].y) >= 81 and (player.y - kula[wartosc].y) <= 230 and (kula[wartosc].x - player.x) >= 61 and (kula[wartosc].x - player.x) <= 200 then
                        msg = "Dragon Ball is far to the north-east"
                    elseif (player.y - kula[wartosc].y) >= 231 and (player.y - kula[wartosc].y) <= 699 and (kula[wartosc].x - player.x) >= 201 and (kula[wartosc].x - player.x) <= 699 then
                        msg = "Dragon Ball is very far to the north-east"
                        -- north --
                    elseif (player.y - kula[wartosc].y) <= 50 then
                        msg = "Dragon Ball is to the north"
                    elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                        msg = "Dragon Ball is far to the north"
                    elseif (player.y - kula[wartosc].y) > 200    then
                        msg = "Dragon Ball is very far to the north"
                        -- east --
                    elseif (kula[wartosc].x - player.x) <= 50 then
                        msg = "Dragon Ball is to the east"
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        msg = "Dragon Ball is far to the east"
                    elseif (kula[wartosc].x - player.x) > 200    then
                        msg = "Dragon Ball is very far to the east"
                    end
                    -- south east --
                elseif player.x < kula[wartosc].x and player.y < kula[wartosc].y then
                    if (kula[wartosc].y - player.y) >= 3 and (kula[wartosc].y - player.y) <= 80 and (kula[wartosc].x - player.x) >= 1 and (kula[wartosc].x - player.x) <= 60 then
                        msg = "Dragon Ball is to the south-east"
                    elseif (kula[wartosc].y - player.y) >= 81 and (kula[wartosc].y - player.y) <= 230 and (kula[wartosc].x - player.x) >= 61 and (kula[wartosc].x - player.x) <= 200 then
                        msg = "Dragon Ball is far to the south-east"
                    elseif (kula[wartosc].y - player.y) >= 231 and (kula[wartosc].y - player.y) <= 699 and (kula[wartosc].x - player.x) >= 201 and (kula[wartosc].x - player.x) <= 699 then
                        msg = "Dragon Ball is very far to the south-east"
                        -- south --
                    elseif (kula[wartosc].y - player.y) <= 50 then
                        msg = "Dragon Ball is to the south"
                    elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                        msg = "Dragon Ball is far to the south"
                    elseif (kula[wartosc].y - player.y) > 200    then
                        msg = "Dragon Ball is very far to the south"
                        -- east --
                    elseif (kula[wartosc].x - player.x) <= 50 then
                        msg = "Dragon Ball is to the east"
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        msg = "Dragon Ball is far to the east"
                    elseif (kula[wartosc].x - player.x) > 200    then
                        msg = "Dragon Ball is very far to the east"
                    end
                    -- east --
                elseif player.x < kula[wartosc].x then
                    if (kula[wartosc].x - player.x) <= 50 then
                        msg = "Dragon Ball is to the east"
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        msg = "Dragon Ball is far to the east"
                    elseif (kula[wartosc].x - player.x) > 200    then
                        msg = "Dragon Ball is very far to the east"
                    end
                    -- north    --
                elseif player.y > kula[wartosc].y then
                    if (player.y - kula[wartosc].y) <= 50 then
                        msg = "Dragon Ball is to the north"
                    elseif (player.y - kula[wartosc].y) > 50 and (player.y - kula[wartosc].y) <= 200 then
                        msg = "Dragon Ball is far to the north"
                    elseif (player.y - kula[wartosc].y) > 200    then
                        msg = "Dragon Ball is very far to the north"
                    end
                    -- south --
                elseif player.y < kula[wartosc].y then
                    if (kula[wartosc].y - player.y) <= 50 then
                        msg = "Dragon Ball is to the south"
                    elseif (kula[wartosc].y - player.y) > 50 and (kula[wartosc].y - player.y) <= 200 then
                        msg = "Dragon Ball is far to the south"
                    elseif (kula[wartosc].y - player.y) > 200    then
                        msg = "Dragon Ball is very far to the south"
                    end
                    -- west --
                elseif player.x > kula[wartosc].x then
                    if (player.x - kula[wartosc].x) <= 50 then
                        msg = "Dragon Ball is to the west"
                    elseif (player.x - kula[wartosc].x) > 50 and (player.x - kula[wartosc].x) <= 200 then
                        msg = "Dragon Ball is far to the west"
                    elseif (player.x - kula[wartosc].x) > 200    then
                        msg = "Dragon Ball is very far to the west"
                    end
    
                    -- east --
    
                elseif player.x < kula[wartosc].x then
                    if (kula[wartosc].x - player.x) <= 50 then
                        msg = "Dragon Ball is to the east"
                    elseif (kula[wartosc].x - player.x) > 50 and (kula[wartosc].x - player.x) <= 200 then
                        msg = "Dragon Ball is far to the east"
                    elseif (kula[wartosc].x - player.x) > 200    then
                        msg = "Dragon Ball is very far to the east"
                    end
    
                end
                if msg ~= "Radar Cannot find the Dragon Ball." then
                    found = true
                    break
                end
            --else
                --doPlayerSendCancel(cid,"Radar Cannot find the Dragon Ball"
            end
        end
        if found then
            doPlayerSendTextMessage(cid, 22, msg)
        else
            doPlayerSendCancel(cid, msg)
        end
        return true
    end
As for line ~16 player.x > 700 I am not sure how your event works so I cannot say if that's wrong.
 
Okay now its work perfect (i think so cuz that line ~16) ! THANKS BRO! I see i had to add 2 locals, one replace else msg and 2nd one to read it as true, some new infos for me cuz im fresh, once again thanks
 
Back
Top