Jump to content

RadarAreas in Radar


Recommended Posts

i try to make the radarareas in GTAV radar

but does not work appear in different positions

any help please?

local mx,my = 3000,3000 
local renderareas = dxCreateRenderTarget( 600, 600,true )  
local renderradar = dxCreateRenderTarget( 342, 264,true )  
  
local altura = 1500 
function doDrawAreas() 
local vehicle = getPedOccupiedVehicle (localPlayer) 
    if isPedInVehicle(localPlayer) then 
        local vx,vy,vz = getElementVelocity(vehicle) 
        velocidade = ( 1 + (vx^2 + vy^2 + vz^2)^(0.5)  ) / 3.5 
        end 
    local altd = altura * math.min(velocidade,2) - 80 
         
 dxSetRenderTarget( renderareas,true )     
    if getElementInterior(localPlayer) == 0 then 
        for i, v in ipairs( getElementsByType('radararea') ) do 
            local tick=abs(getTickCount()%1000-500) 
            local aFactor=tick/500 
            local r,g,b,a = getRadarAreaColor(v) 
            local w,h = getRadarAreaSize(v) 
            local ax,ay = getElementPosition(v)                      
            local x,y = (3000+(ax))/6000*mx, (3000-(ay))/6000*my 
            if isRadarAreaFlashing(v) then 
                a=a*aFactor 
                 end 
         
            dxDrawRectangle(x, (y-h) + 4 + (h/2), (w/2), (h/2), tocolor(r,g,b,a)) 
        end 
    end 
    dxSetRenderTarget()   
    local rot = getPedCameraRotation(localPlayer) 
    local px,py = getElementPosition(localPlayer) 
    local tx,ty = (3000+px)/6000*mx, (3000-py)/6000*my 
    dxDrawImageSection(0,0, 600, 600, tx-(altd/2),ty-(altd/2),altd,altd, renderareas,-rot,0,0,tocolor(255,255,255,255)) 
end 

Link to comment

try this

Meta.xml

    function="createRoundRadarArea" type="client"/> 
    function="roundRadarAreaDimensions" type="client"/> 
    function="roundRadarAreaFlashing" type="client"/> 
    function="roundRadarAreaColor" type="client"/> 
    function="isElementInRoundRadarArea" type="client"/> 
    function="getElementsInRoundRadarArea" type="client"/> 
    function="createRoundRadarArea" type="server"/> 
    function="roundRadarAreaDimensions" type="server"/> 
    function="roundRadarAreaFlashing" type="server"/> 
    function="roundRadarAreaColor" type="server"/> 
    function="isElementInRoundRadarArea" type="server"/> 
    function="getElementsInRoundRadarArea" type="server"/> 

Link to comment
try this

Meta.xml

    function="createRoundRadarArea" type="client"/> 
    function="roundRadarAreaDimensions" type="client"/> 
    function="roundRadarAreaFlashing" type="client"/> 
    function="roundRadarAreaColor" type="client"/> 
    function="isElementInRoundRadarArea" type="client"/> 
    function="getElementsInRoundRadarArea" type="client"/> 
    function="createRoundRadarArea" type="server"/> 
    function="roundRadarAreaDimensions" type="server"/> 
    function="roundRadarAreaFlashing" type="server"/> 
    function="roundRadarAreaColor" type="server"/> 
    function="isElementInRoundRadarArea" type="server"/> 
    function="getElementsInRoundRadarArea" type="server"/> 

What the f..?

Nigg@ are you high or what?

Link to comment

that's the part of script I use, this should help :wink:

    dxSetRenderTarget()  
    dxSetRenderTarget( areas,true )     
    if getElementInterior(localPlayer) == 0 then 
        for i, v in ipairs( getElementsByType('radararea') ) do 
            local r,g,b,a = getRadarAreaColor(v) 
            local w,h = getRadarAreaSize(v) 
            local ax,ay = getElementPosition(v)                  
            local x,y = (0+ax)/0*mx, (0-ay)/0*my 
            if isRadarAreaFlashing(v) then 
                a = a*math.abs(getTickCount()%1000-500)/500 
            end 
            dxDrawRectangle(x, (y-h) + 4 + (h/2), (w/2), (h/2), tocolor(r,g,b,a+100)) 
        end 
    end 

Link to comment

I was talking about this

    function="createRoundRadarArea" type="client"/> 
    function="roundRadarAreaDimensions" type="client"/> 
    function="roundRadarAreaFlashing" type="client"/> 
    function="roundRadarAreaColor" type="client"/> 
    function="isElementInRoundRadarArea" type="client"/> 
    function="getElementsInRoundRadarArea" type="client"/> 
    function="createRoundRadarArea" type="server"/> 
    function="roundRadarAreaDimensions" type="server"/> 
    function="roundRadarAreaFlashing" type="server"/> 
    function="roundRadarAreaColor" type="server"/> 
    function="isElementInRoundRadarArea" type="server"/> 
    function="getElementsInRoundRadarArea" type="server"/> 

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...