araiza12 Posted October 23, 2018 Share Posted October 23, 2018 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: C help me pls i need this script :c Link to comment
LilDawage Posted October 23, 2018 Share Posted October 23, 2018 (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 October 23, 2018 by LilDawage Link to comment
araiza12 Posted October 23, 2018 Author Share Posted October 23, 2018 (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 October 23, 2018 by araiza12 Link to comment
Z4Zy Posted October 23, 2018 Share Posted October 23, 2018 (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 October 23, 2018 by DeadthStrock Link to comment
araiza12 Posted October 23, 2018 Author Share Posted October 23, 2018 [07:20:00] WARNING: [Scrips]\PRIVADOS\clanes.lua:53: Bad argument @ 'destroyElement' [Expected element at argument 1, got nil] Link to comment
Z4Zy Posted October 23, 2018 Share Posted October 23, 2018 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) Link to comment
araiza12 Posted October 23, 2018 Author Share Posted October 23, 2018 when leaving the clan if it is deleted but not when entering again Link to comment
Z4Zy Posted October 23, 2018 Share Posted October 23, 2018 so you need to run the blip function [ blip() ] when someone join the clan. Link to comment
araiza12 Posted October 23, 2018 Author Share Posted October 23, 2018 help me pls i'm new in scripting pls :C Link to comment
Z4Zy Posted October 24, 2018 Share Posted October 24, 2018 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. Link to comment
araiza12 Posted October 24, 2018 Author Share Posted October 24, 2018 then I will not be able to :c Link to comment
Z4Zy Posted October 24, 2018 Share Posted October 24, 2018 so post the code that helps to put a player in a clan. 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