GrubaS Posted May 24, 2017 Posted May 24, 2017 Hello, guys i want to make a delete blips only whos in "Spectators" team i just tried to delete all blips by command but i did only for 1 player who write this command his blop will be deleted addCommandHandler ( "blip", function ( thePlayer ) local theTeam = getTeamFromName ( "Spectators" ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) for index, element in ipairs ( getAttachedElements ( players ) ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end end )
pa3ck Posted May 24, 2017 Posted May 24, 2017 You're kind of skipping a step there, try this: addCommandHandler ( "blip", function ( thePlayer ) local theTeam = getTeamFromName ( "Spectators" ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) for index, plr in ipairs ( players ) do for k, el in ipairs(getAttachedElements ( plr )) do if ( getElementType ( el ) == "blip" ) then destroyElement ( el ) end end end end end )
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