LucasBaker Posted November 5, 2014 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 )
joaosilva099 Posted November 5, 2014 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 http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
LucasBaker Posted November 5, 2014 Author 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 ?
Anubhav Posted November 5, 2014 Posted November 5, 2014 setElementVisibleTo ( lixo1, root, false ) setElementVisibleTo ( blip, root, false ) setElementVisibleTo ( lixo1, playerTeam, true ) setElementVisibleTo ( blip, playerTeam, true ) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
joaosilva099 Posted November 6, 2014 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! http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
Anubhav Posted November 8, 2014 Posted November 8, 2014 No problem. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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