LucasBaker Posted November 5, 2014 Share Posted November 5, 2014 Hello , I would like the marker to appear only for the team but who is this giving an error that I am unable to resolve the following code : lixo1 = createMarker(1516.41675, -1847.13733, 13.54688, 'cylinder', 2, 255, 0, 0, 150) function aLixeiro (source) outputChatBox("Você pegou o lixo na casa!", source, 255, 0, 0) givePlayerMoney ( source, 50 ) setElementPosition( lixo1, 0, 0, 0 ) setTimer(function() setElementPosition( lixo1, 1516.41675, -1847.13733, 13.54688 ) end,2000,1) end addEventHandler( "onMarkerHit", lixo1, aLixeiro ) function onStart(source) if getTeamName(getPlayerTeam(source)) == "Lixeiros" then local playerTeam = getPlayerTeam ( source ) local blip = createBlipAttachedTo( lixo1, 51, 2, 255, 0, 0, 255, 255, 255 ) setElementVisibleTo ( lixo1, playerTeam, true ) setElementVisibleTo ( blip, playerTeam, true ) setElementVisibleTo ( lixo1, root, false ) setElementVisibleTo ( blip, root, false ) end end addEventHandler( "onMarkerHit", getRootElement(), onStart ) Link to comment
joaosilva099 Posted November 5, 2014 Share Posted November 5, 2014 Just think about it. If you first set it visible to one player and then false for root. That player is children of root so it will not show. Set it first false to root then true for player. Same for blip Link to comment
LucasBaker Posted November 5, 2014 Author Share Posted November 5, 2014 Just think about it. If you first set it visible to one player and then false for root. That player is children of root so it will not show. Set it first false to root then true for player. Same for blip setElementVisibleTo ( lixo1, playerTeam, true ) setElementVisibleTo ( blip, playerTeam, true ) setElementVisibleTo ( lixo1, root, false ) setElementVisibleTo ( blip, root, false ) like this ? Link to comment
Anubhav Posted November 5, 2014 Share Posted November 5, 2014 setElementVisibleTo ( lixo1, root, false ) setElementVisibleTo ( blip, root, false ) setElementVisibleTo ( lixo1, playerTeam, true ) setElementVisibleTo ( blip, playerTeam, true ) Link to comment
joaosilva099 Posted November 6, 2014 Share Posted November 6, 2014 setElementVisibleTo ( lixo1, root, false ) setElementVisibleTo ( blip, root, false ) setElementVisibleTo ( lixo1, playerTeam, true ) setElementVisibleTo ( blip, playerTeam, true ) Thanks for sample to him Anubhav! 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