Jump to content

Blips


mgdmgd

Recommended Posts

function createCustomBlip ( x, y, width, height, path, fRadius )
    if     not tonumber(x) or
        not tonumber(y) or
        not type(path) == "string" then
            outputDebugString("createCustomBlip - Bad argument",0)
            return false
    end
    sourceResource = sourceResource or getThisResource()
    local resourceName = getResourceName(sourceResource)
 
    fRadius = fRadius or DEFAULT_STREAM_DISTANCE
    if not tonumber(fRadius) then
        outputDebugString("createCustomBlip - Bad argument",0)
        return false
    end
    local image = dxImage:create( ":"..resourceName.."/"..path, 0, 0, width, height, false )
 
    streamedBlips[image] = streamedBlips[image] or {}
    streamedBlips[image].radius = fRadius
    streamedBlips[image].x = x
    streamedBlips[image].y = y
    streamedBlips[image].width = width
    streamedBlips[image].height = height
    streamedBlips[image].visible = true
 
    VISIBLE_BLIP_COUNT = VISIBLE_BLIP_COUNT + 1
 
    addEventHandler ( "onClientResourceStop", getResourceRootElement(sourceResource),
        function()
            streamedBlips[image] = nil
            VISIBLE_BLIP_COUNT = VISIBLE_BLIP_COUNT - 1
            destroyWidget ( image )
        end
    )
 
    return image.id
end

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...