Jump to content

Recommended Posts

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
) 

 

Link to comment

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 
) 

 

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