Как проверить равны ли углы направлений моего и другого игрока

JSamp

Новичок
Автор темы
18
3
ЛУА:
lua_thread.create(function()
while true do
        wait(0)
        local myPosX, myPosY, myPosZ = getCharCoordinates(PLAYER_PED)
        local allChars = getAllChars()
        for _, ped in ipairs(allChars) do
        if not ped then return end
        local result, id = sampGetPlayerIdByCharHandle(ped)
        if result and ped ~= PLAYER_PED then
        local distance = getDistanceBetweenCoords3d(myPosX, myPosY, myPosZ, getCharCoordinates(ped))
        if distance <= 5 then
        local myangel = math.ceil(getCharHeading(PLAYER_PED))
        local angel = math.ceil(getCharHeading(ped))
        if (myangel > angel and (myangel - angel) <= 20) or (myangel > angel and (myangel - angel) <= -20) then
                    dontkiss = true
            else dontkiss = false
    end
    else dontkiss = false
end
end
end
end
end)
Вот такая тема, но работает через жопу через 2