Jump to content

[Ayuda] Blips con NighVision (Otra Idea)


Recommended Posts

Hola bueno lo que pasa es que en el anterior tema pregunte como hacer que al tener las gafas puestas se vean los blips en el mapa, pero esto es lo contrario, quiero que al tener las gafas puestas tu blip ya no sea visible para los demas.

Intwente de esta forma:

addEventHandler( "onClientResourceStart", resourceRoot, 
function() 
bindKey("fire", "down", theGoggle) 
for _,blip in ipairs(getElementsByType("blip")) do 
  
setBlipColor(blip,0,0,0,0) 
end 
end 
) 
      
function theGoggle() 
local weaponID = getPedWeapon (getLocalPlayer ()) 
if weaponID == 44 then 
setTimer (playerGoggles, 50, 0 ) 
end 
end 
      
function playerGoggles() 
      
if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_ON" ) then 
for _,blip in ipairs(getElementsByType("blip")) do 
  
setBlipColor(blip,255,0,0,255) 
end 
end 
            
if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_OFF" ) then 
for _,blip in ipairs(getElementsByType("blip")) do 
  
setBlipColor(blip,0,0,0,0) 
end 
end 
                    
end 
  
addEventHandler( "onClientResourceStop", resourceRoot, 
function() 
unbindKey("fire", "down", theGoggle) 
end 
) 
  
  
addEventHandler("onClientPlayerWasted",resourceRoot, 
function() 
for _,blip in ipairs(getElementsByType("blip")) do 
setPlayerNametagShowing ( source, false ) 
             
            local attachedElements = getAttachedElements ( source ) 
            for ElementKey, ElementValue in ipairs ( attachedElements ) do 
                if ( getElementType ( ElementValue ) == "blip" ) then 
                    destroyElement ( ElementValue ) 
                end 
            end 
end 
end 
) 
  
addEventHandler("onClientPlayerSpawn",resourceRoot, 
function() 
for _,blip in ipairs(getElementsByType("blip")) do 
setPlayerNametagShowing ( source, true ) 
             
            local nameTag = getPlayerName ( source ) 
            local r, g, b = getPlayerNametagColor ( source ) 
            blip [ source ] = createBlipAttachedTo ( source, 0, 2, r, g, b, 255 ) 
end 
end 
) 

Pero no Funciono.

Link to comment
LOL,... pero entonces, si todos tienen puestos las gafas, ninguno va a ver a los demás xD,... creo que esta nueva idea no es necesario, es solo mi opinión.

Podrías intentar borrar el blip desde server side usando un trigger cuando se cumpla la función luego de la animación,...

Pero sigo pensando que no es necesario.

Se supone tendran un alto costo como 3 millones :3

Link to comment
Para ocultar los blips, intenta cambiando su dimension.

La dimencion del blip o la Persona o.O?

Esque mira, es un Server survival... de zombis y canseria de usuarios... yno era muy bonito anda de camper con sniper y que tu nombre y blip se vean a 100metros.... lo que quiero es que al comprar las gafas en unos 3 milllones al ponerselas su blip desaparesca... en la idea anterior no se veia ningun blip pero los usuarios se quejaban que no se encontraban entre si :3

Link to comment
Obtene los elementos y usa:
setElementDimension 

Asi?

function playerGoggles() 
      
if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_ON" ) then 
for _,blip in ipairs(getElementsByType("blip")) do 
setElementDimension ( blip, 5 )   
  
end 
end 
            
if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_OFF" ) then 
for _,blip in ipairs(getElementsByType("blip")) do 
  
setElementDimension ( blip, 0 )  
end 
end 
                    
end 

Link to comment
  • 4 months later...
Si, fijate si funciona.

Bueno lo intente asi pero no funciono :/

addEventHandler( "onClientResourceStart", resourceRoot, 
    function() 
    bindKey("fire", "down", theGoggle) 
    for _,blip in ipairs(getElementsByType("blip")) do 
    local r,g,b,a = getBlipColor(blip) 
    setElementDimension ( blip, 0 )  
    end 
    end 
    ) 
          
    function theGoggle() 
    local weaponID = getPedWeapon (getLocalPlayer ()) 
    if weaponID == 44 then 
    setTimer (playerGoggles, 50, 0 ) 
    end 
    end 
          
    function playerGoggles() 
          
    if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_ON" ) then 
    for _,blip in ipairs(getElementsByType("blip")) do 
    local r,g,b,a = getBlipColor(blip) 
    setElementDimension ( blip, 2 )  
    end 
    end 
                
    if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_OFF" ) then 
    for _,blip in ipairs(getElementsByType("blip")) do 
    local r,g,b,a = getBlipColor(blip) 
    setElementDimension ( blip, 0 )  
    end 
    end 
                        
    end 
      
    addEventHandler( "onClientResourceStop", resourceRoot, 
    function() 
    unbindKey("fire", "down", theGoggle) 
    end 
    ) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
for _,blip in ipairs(getElementsByType("blip")) do 
local r,g,b,a = getBlipColor(blip) 
setElementDimension ( blip, 0 )  
end 
end 
) 
  
addEventHandler("onClientPlayerSpawn", localPlayer, 
function () 
for _,blip in ipairs(getElementsByType("blip")) do 
local r,g,b,a = getBlipColor(blip) 
setElementDimension ( blip, 0 )  
end 
end 
) 

Link to comment
  • Recently Browsing   0 members

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