Tete omar Posted December 1, 2012 Share Posted December 1, 2012 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 ? Link to comment
Castillo Posted December 1, 2012 Share Posted December 1, 2012 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. Link to comment
Tete omar Posted December 2, 2012 Author Share Posted December 2, 2012 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 Link to comment
Tete omar Posted December 2, 2012 Author Share Posted December 2, 2012 I wanna trigger to the players whose into the team Link to comment
Castillo Posted December 2, 2012 Share Posted December 2, 2012 Your script should work, what is the exact problem? Link to comment
Tete omar Posted December 2, 2012 Author Share Posted December 2, 2012 Sorry i deeply checked the code , and i found it's my mistake, thanks anyway Link to comment
50p Posted December 2, 2012 Share Posted December 2, 2012 This is when element tree is very useful. When player joins a team set their parent as the team. Then you can use team element as visibleTo parameter and only players in that team will see the blips. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now