Hello, there is a small problem: the code does not break out of the cycle when I write the word break, here is the code (But what is before the break is executed, only after the break does not end the cycle)
function gethere(player, cmd, ID)
if getElementData(player, "Player.AdminLevel") > 1 then
local players = getElementsByType ( "player" )
if tonumber(ID) then
for i, p in ipairs(players) do
if getElementData(p, "Player.ID") == tonumber(ID) then
local x, y, z = getElementPosition(player)
setElementPosition(p, x, y, z)
break
else
outputChatBox("#000000<#910e07Wise#ffffffRolePlay#000000> #ffffff Rossz ID-t adtál meg.", player, 255, 255, 255, true)
end
end
else
outputChatBox("#000000<#910e07Wise#ffffffRolePlay#000000> #ffffff /gethere [ID]", player, 255, 255, 255, true)
end
end
end
addCommandHandler("gethere", gethere, false, false)