Jump to content

[HELP] Show blip to a team


itsMatheus

Recommended Posts

Hey guys. I'm new to scripting, only learning from the wiki, but I couldn't figure out how to create a blip that only appears for a certain team.

local playersinteam = getPlayersInTeam(getTeamFromName("EMS"))
createBlipAttachedTo(source, 0, 5, 255, 255, 0, 255, 0, 65535, playersinteam)

This is the part of my script that i'm having troubles with. If anyone could help me out I would very much appreciate it.

Edited by aionsrlindo
Link to comment

getPlayersInTeam returns a table of all the players in the team, so that only the team sees the blip you have to do this: 

addCommandHandler("showblip", 
	function ( ... )
        -- > this is the correct way
		local playersinteam = getPlayersInTeam(getTeamFromName("EMS"))
		for i, players in ipairs( playersinteam ) do
			createBlipAttachedTo( players, 0, 5, 255, 255, 0, 255, 0, 65535, players )
		end 
        -- > this is not the correct way 
            --local playersinteam = getPlayersInTeam(getTeamFromName("EMS"))
            --createBlipAttachedTo( players, 0, 5, 255, 255, 0, 255, 0, 65535, players )
	end)

-- type /showblip to show the blip

I'm sorry if you do not understand me, I'm using Google translator.

  • Thanks 1
Link to comment
20 hours ago, Melbourne said:

getPlayersInTeam returns a table of all the players in the team, so that only the team sees the blip you have to do this: 


addCommandHandler("showblip", 
	function ( ... )
        -- > this is the correct way
		local playersinteam = getPlayersInTeam(getTeamFromName("EMS"))
		for i, players in ipairs( playersinteam ) do
			createBlipAttachedTo( players, 0, 5, 255, 255, 0, 255, 0, 65535, players )
		end 
        -- > this is not the correct way 
            --local playersinteam = getPlayersInTeam(getTeamFromName("EMS"))
            --createBlipAttachedTo( players, 0, 5, 255, 255, 0, 255, 0, 65535, players )
	end)

-- type /showblip to show the blip

I'm sorry if you do not understand me, I'm using Google translator.

How to destroy blip or hide blip for player like admin?let me know xD I was waiting for this too

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