Jump to content

[ASK] createRadarArea with restricted visibility


smw94

Recommended Posts

how to restrict visibility of createRadarArea ? i've try some code, but it didn't work

this is my code that didn't work

  
local visibilityAffect = {}  
for i,p in ipairs(getElementsByType("player")) do  
    if getElementData(getPlayerTeam(p), "type") > 1 then 
         table.insert(visibilityAffect,p) 
    end 
end 
local radArea = createRadarArea( x, y, sizeX, sizeY, red, green, blue, 130, visibilityAffect) 
  

this is not working too

  
local radArea = createRadarArea( x, y, sizeX, sizeY, red, green, blue, 130 ) 
for i, p in ipairs(getElementsByType("player")) do 
     if getElementData(getPlayerTeam(p), "type") > 1 then 
         setElementVisibleTo(radArea, p, false) 
     end 
end 
  

any help ? thanks before

Link to comment

Try to set it's visibility to 'true' and then to 'false' like this (I skipped some code before):

... 
if getElementData(getPlayerTeam(p), "type") > 1 then 
    setElementVisibleTo(radArea, p, true) 
    setElementVisibleTo(radArea, p, false)  
end 

Link to comment
Try to set it's visibility to 'true' and then to 'false' like this (I skipped some code before):
... 
if getElementData(getPlayerTeam(p), "type") > 1 then 
    setElementVisibleTo(radArea, p, true) 
    setElementVisibleTo(radArea, p, false)  
end 

thanks bro, it solved :D

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