Jump to content

'visibleto' problem


Tete omar

Recommended Posts

Posted

Hi , i've tried to make a blip visible to some team , and it's not working , here's the code

local playersInTeam=getPlayersInTeam(team) 
for i,v in ipairs(playersInTeam) do 
    blips[player]=createBlipAttachedTo(player,19,2,255,0,0,0,99999.0,v) 
end 

blips is a table and player is the (hitElement) of a timer in 'onColShapeHit' , i passed 'hitElement' to the timer, and team is defined as a team , but my problem is , when that blip is being to appear , it appears to all players , not just the players whose is into the 'team' , and if no player is in 'team' then the blip won't appears , any idea how to make that blip appears to the players whose is into the 'specific' team ?

F4MZM4.gif

Posted
local playersInTeam = getPlayersInTeam ( team ) 
blips [ player ] = createBlipAttachedTo ( player, 19, 2, 255, 0, 0, 0, 99999.0 ) 
setElementVisibleTo ( blips [ player ], root, false ) 
for _, player_ in ipairs ( playersInTeam ) do 
   setElementVisibleTo ( blips [ player ], player_, true ) 
end 

Try it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thanks , i tried to do the same with triggering to client , but didn't work

Here's the code

local daTeam=getPlayersInTeam(armyTeam) 
for i, v in ipairs(daTeam) do 
    triggerClientEvent(v,"alert!",v) 
end 

F4MZM4.gif

Posted

Your script should work, what is the exact problem?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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