Jump to content

help new radar


pepsi18

Recommended Posts

hola a todos no se halguien me podria ayudar

Estoy asiendo un radar cuadrado ya casi lo termino pero mi problema es como puedo

hacer que los nombres de los jugadores se puedan ver en mi miniradar

Esta es una parte del codigo :(

local screenx, screeny = guiGetScreenSize( ); 
local posX = 30; 
local posY = 157; 
  
local width = 145; 
local height = 145; 
-- 
local scale = 1.5; 
local texture = dxCreateTexture( 'radar.dds', 'dxt5', true, 'clamp', '3d' ); 
imageWidth, imageHeight = dxGetMaterialSize( texture ); 
  
showPlayerHudComponent( "radar", false )       
        
 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 ) ) 
        rotx = math.deg(rotx) 
        rotz = math.deg(rotz)       
        return rotz 
    end 
  
  
    function miniradar( ) 
    
        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();    
        dxDrawImageSection( posX, screeny - posY, width, height, mapX, mapY, width / scale, height / scale, texture, rotation, 0, 0, tocolor( 255, 255, 255, 220 ), false ); 
        
        end 
        addEventHandler("onClientRender",root, miniradar )     

Link to comment
  • Recently Browsing   0 members

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