Michcio Posted November 3, 2012 Posted November 3, 2012 (edited) Hi! How to make mapnames visible only to one team? Edited January 10, 2013 by Guest
Anderl Posted November 3, 2012 Posted November 3, 2012 local theTeam = "The team name"; for i,v in ipairs( getElementsByType( 'player' ) ) do if ( ( getTeamName( getPlayerTeam( v ) ) == theTeam ) and ( v == localPlayer ) ) then --draw map name end end "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Michcio Posted November 5, 2012 Author Posted November 5, 2012 Thanks but i have one more question. How to make playerblips visible only for this team?
Anderl Posted November 5, 2012 Posted November 5, 2012 There is a "visible to" parameter in createBlip. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Anderl Posted November 5, 2012 Posted November 5, 2012 Show the code you tried. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Michcio Posted November 5, 2012 Author Posted November 5, 2012 function onPlayerSpawn1 ( spawnpoint ) for id, player in ipairs( getElementsByType ( "player" ) ) do if getPlayerTeam(player) == getTeamFromName("Policja") then createBlipAttachedTo ( source, 0, 2, 0, 0, 255, 255, 0, 300, player ) end end end
Anderl Posted November 5, 2012 Posted November 5, 2012 Where is "source" defined? "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Anderl Posted November 5, 2012 Posted November 5, 2012 (edited) Is that code server-side in meta.xml? Show meta.xml. Check for errors in debug also, I can't seem to find any. Maybe it's me, I'm fucked up today. Edited November 5, 2012 by Guest "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Michcio Posted November 5, 2012 Author Posted November 5, 2012 There's no errors but it doesn't work good.
Castillo Posted November 5, 2012 Posted November 5, 2012 function onPlayerSpawn1 ( spawnpoint ) local blip = createBlipAttachedTo ( source, 0, 2, 0, 0, 255, 255, 0, 300 ) setElementVisibleTo ( blip, root, false ) for _, player in ipairs ( getPlayersInTeam ( getTeamFromName ( "Policja" ) ) ) do setElementVisibleTo ( blip, player, true ) end end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Michcio Posted November 6, 2012 Author Posted November 6, 2012 Blip is unvisible for all players. Maybe I must do it on client side and trigger setElementVisibleTo in onClientRender function.
Castillo Posted November 6, 2012 Posted November 6, 2012 My script should hide it for everyone, then show it to the players inside the team. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Michcio Posted November 6, 2012 Author Posted November 6, 2012 I know it but it shows it to players who is in team at the moment. I need to do that it is visible to players who is in this team all the time.
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