Well, you will need to use tables when it comes to more elements (jobs).
I don't know maybe something like this ?
function duty(thePlayer)
local jobsCount = 10
local foundJob = false
for i=1, jobsCount do
local checkjob = getElementByID(tostring(i))
if type(checkjob) == "marker" then
if isElementWithinMarker(thePlayer, checkjob) then
outputChatBox("this marker is for job number "..i, thePlayer, 255, 0, 0)
foundJob = true
break -- if it finds the marker the player is in => stop the loop
end
end
end
if not foundJob then
outputChatBox("not within a marker", thePlayer, 255, 0, 0)
end
end
addCommandHandler("duty", duty)