Jump to content

Hola que tal


Arsilex

Recommended Posts

Bueno estoy haciendo un radar no el radar que es el minimapa un radar de policia y lo que no se me ocurre como hacer es

createColCuboid(x, y, z, 1.75, 9.25, 3.25)

que ese col siempre aparezca delante del auto y que siempre sea igual en tamaño osea

alguna idea ._.?

Link to comment

En realidad si se puede haciendo unos pares de calculos. Lo se porque en el resource 'zombies' , al iniciar el recurso se crea un col atras del ped del jugador y usa onClientRender para posicionarlo siempre detras. Esto es de lo que te hablo:

throatcol = createColSphere ( 0, 0, 0, .3) 
  
function movethroatcol () 
    --[[local screenWidth, screenHeight = guiGetScreenSize() 
    local dcount = tostring(table.getn( myZombies )) 
    dxDrawText( dcount, screenWidth-40, screenHeight -50, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 0, "pricedown" ) 
    dxDrawText( dcount, screenWidth-42, screenHeight -52, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 0, "pricedown" )]]--Ignora esto. 
  
    if isElement(throatcol) then 
        local playerrot = getPedRotation ( getLocalPlayer () ) 
        local radRot = math.rad ( playerrot ) 
        local radius = 1 
        local px,py,pz = getElementPosition( getLocalPlayer () ) 
        local tx = px + radius * math.sin(radRot) 
        local ty = py + -(radius) * math.cos(radRot) 
        local tz = pz 
        setElementPosition ( throatcol, tx, ty, tz ) 
    end 
end 
addEventHandler ( "onClientRender", getRootElement(), movethroatcol ) 

Link to comment
  • Recently Browsing   0 members

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