Jump to content

Help "blip vehicle visible for gang" help pls :C


araiza12

Recommended Posts

Posted

I want to make a blip to put it in a car and only the members of a certain gang can look at it on the map help pls I can not do it alone: ChHJjPxm.png

help me pls i need this script :c

Posted (edited)
setElementVisibleTo (Car,Member, true )
Member = get Player Clan 

dont Forrget to add Event for that 

like "onPlayerSpawnCar" , "onPlayerVehicleEnter"

bro dont Forgget to destoryElement (blip) when Car explode...
Edited by LilDawage
Posted (edited)

I'm using the datas of gang no of team

ex:

 

vehicles_blips = {}
root = getRootElement()
function blip ()
pla = getElementsByType ( "player" )
for k,x in ipairs(pla) do
if ( getElementData (x, "gang" ) == "123" )then
blip = createBlipAttachedTo(MiAuto,2,2,255,55,0,255)
vehicles_blips[MiAuto] = blip
setElementVisibleTo (blip,x, true )
end
end
end
setTimer(blip,3000,1)

function destroyb(player)
play = getElementsByType ( "player" )
for k,z in ipairs(play) do
if ( getElementData (z, "gang" ) == "None" )then
 local blip = vehicles_blips[MiAuto]
 destroyElement(blip) 
 vehicles_blips[MiAuto] = nil
end
end
end
setTimer(destroyb,3000,0)

it's not deleted when leaving the gang :c and try everytring helpme pls

not work

Edited by araiza12
Posted (edited)

There's and 'visibleTo' argument already in "createBlipAttachedTo" function.

Server Side :-

vehicles_blips = {}

function blip ()
  local pla = getElementsByType ( "player" )
    for k,x in ipairs (pla) do
        if ( getElementData (x, "gang" ) == "123" )then
            vehicles_blips[MiAuto] = createBlipAttachedTo(MiAuto,2,2,255,55,0,255,0,1000,x)
        end
    end
end
setTimer(blip,3000,1)
 
function destroyb(player)
  local play = getElementsByType ( "player" )
    for k,z in ipairs (play) do
        if ( getElementData (z, "gang" ) == "None" )then
          local blip = vehicles_blips[MiAuto]
            destroyElement(blip)
            vehicles_blips[MiAuto] = nil
        end
	end
end
setTimer(destroyb,3000,0)

 

Edited by DeadthStrock
Posted

check that element exists !

vehicles_blips = {}

function blip ()
  local pla = getElementsByType ( "player" )
    for k,x in ipairs (pla) do
        if ( getElementData (x, "gang" ) == "123" )then
            vehicles_blips[MiAuto] = createBlipAttachedTo(MiAuto,2,2,255,55,0,255,0,1000,x)
        end
    end
end
setTimer(blip,3000,1)
 
function destroyb(player)
  local play = getElementsByType ( "player" )
    for k,z in ipairs (play) do
        if ( getElementData (z, "gang" ) ~= "123" )then
          local blip = vehicles_blips[MiAuto]
		    if isElement(blip) then
                destroyElement(blip)
                vehicles_blips[MiAuto] = nil
			end
        end
	end
end
setTimer(destroyb,3000,0)

 

Posted

there's no code that joining the player into a clan. So, you have to add blip() to the code that joining the player into a clan.

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