Jump to content

help radar .


Jacobob14

Recommended Posts

someone help me as I can make them visible

blips and radar area on my radar

[lua] local function getCameraRotation () 
        px, py, pz, lx, ly, lz = getCameraMatrix() 
        local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) ) % 6.2831853071796 
        local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly, px, py ) ) 
        --Convert to degrees 
        rotx = math.deg(rotx) 
        rotz = math.deg(rotz)       
        return rotz 
    end 
  
local screenx, screeny = guiGetScreenSize( ); 
local posX = 30; 
local posY = 157; 
-- Make sure it's the right values 
local width = 135; 
local height = 135; 
-- 
local scale = 0.67; 
local texture = dxCreateTexture( 'sattelite.png', 'dxt5', true, 'clamp' ); 
imageWidth, imageHeight = dxGetMaterialSize( texture ); 
  
showPlayerHudComponent( "radar", false ) 
  
addEventHandler("onClientRender",root, 
    function( ) 
    
        local px ,py, pz = getElementPosition( localPlayer ) 
        local mapX = px / ( 6000 / imageWidth ) + ( imageWidth / 2 ) - ( width / scale / 2 ); 
        local mapY = py / ( -6000 / imageHeight ) + ( imageHeight / 2 ) - ( height / scale / 2 ); 
        local cx,cy,cz,tx,ty,tz = getCameraMatrix( ); 
        local rotation = getCameraRotation(); 
       local mx, my, mz = getElementPosition(localPlayer); 
       local zone = getZoneName (mx, my, mz, true ) 
       local vl = getElementVelocity ( localPlayer )  
       local playerTeam = getPlayerTeam ( localPlayer )          
        local team = getTeamName ( playerTeam ) 
  
        dxDrawImageSection( posX, screeny - posY, width, height, mapX, mapY, width / scale, height / scale, texture, rotation, 0, 0, tocolor( 255, 255, 255, 230 ), false ); 
        dxDrawText ( "Posición: " .. math.floor(mx) .. " , " .. math.floor(my) .."\nZona: " ..zone.."\nAltura: " .. math.floor(mz) .." metros\nEquipo: "..team,  30, 439, 166, 570,tocolor(255, 255, 255, 255), 0.87, "sans", "left", "top", false, false, true, false, false, rotation ); 
       

Edited by Guest
Link to comment
  • Moderators
Replace this in Line 22
  
showPlayerHudComponent( "radar", true ) 

No ... It's a custom radar, so it's obvious the original has to be hidden.

By the way, this guy just want us to write the code to add blips and radar areas on this custom radar he stolen/copied from somewhere.

But it's not gonna happen since it requires too much time and he isn't alone on this forum. Also I aready helped someone to do the exact same thing:

viewtopic.php?f=91&t=71784

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