igthomas Posted March 17, 2012 Posted March 17, 2012 Well players arent invisible iv = 0 function toggleInvis( source ) local skin = getElementModel (source) if ( skin == 310 or skin == 217 ) then if iv == 0 then iv = 1 setPlayerNametagShowing(source, false) setElementAlpha(source, 0) else iv = 0 setPlayerNametagShowing(source, true) setElementAlpha(source, 255) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), toggleInvis ) In meta I've added it as a server type
bandi94 Posted March 17, 2012 Posted March 17, 2012 this script will make 1 invisible 1 visible 1invisible 1 visible and so on .... player this is what you want ? Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
igthomas Posted March 17, 2012 Author Posted March 17, 2012 no it should be so when player spawn as skin 310 or 217 then his blip and tagname should be invisible
bandi94 Posted March 17, 2012 Posted March 17, 2012 if you set the player's Alpha to 0 that will not hide the blip you need to destroy or set the blip alpha to 0 for i,v in pairs(getAttachedElements(source)) do if getElementType(v)=="blip" then r,g,b,a = getBlipColor(v) setBlipColor(v,r,g,b,0) end end Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
Castillo Posted March 17, 2012 Posted March 17, 2012 local invisible = { } local skins = { [ 217 ] = true, [ 310 ] = true } function toggleInvis ( ) setTimer ( function ( player ) local skin = getElementModel ( player ) if ( skins[ skin ] ) then if ( not invisible[ player ] ) then invisible[ player ] = true setPlayerNametagShowing ( player, false ) setElementAlpha ( player, 0 ) else invisible[ player ] = false setPlayerNametagShowing ( player, true ) setElementAlpha ( player, 255 ) end end end ,200, 1, source ) end addEventHandler ( "onPlayerSpawn", root, toggleInvis ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
igthomas Posted March 17, 2012 Author Posted March 17, 2012 Thanks it worked but blips are still visible
bandi94 Posted March 17, 2012 Posted March 17, 2012 (edited) local invisible = { } local skins = { [ 217 ] = true, [ 310 ] = true } function toggleInvis ( ) setTimer ( function ( player ) local skin = getElementModel ( player ) if ( skins[ skin ] ) then if ( not invisible[ player ] ) then invisible[ player ] = true setPlayerNametagShowing ( player, false ) setElementAlpha ( player, 0 ) blip(player,true) else invisible[ player ] = false setPlayerNametagShowing ( player, true ) setElementAlpha ( player, 255 ) blip(player,false) end end end ,200, 1, source ) end addEventHandler ( "onPlayerSpawn", root, toggleInvis ) function blip(player,status) for i,v in pairs(getAttachedElements(player)) do if getElementType(v)=="blip" then r,g,b,a = getBlipColor(v) if status then setBlipColor(v,r,g,b,0) else setBlipColor(v,r,g,b,255) end end end Edited March 17, 2012 by Guest Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
Kenix Posted March 17, 2012 Posted March 17, 2012 local tInvisible = { } local tSkins = { [ 217 ] = true; [ 310 ] = true; } function fInvisible ( ) setTimer ( function ( uPlayer ) local nSkin = getElementModel ( uPlayer ) if tSkins[ nSkin ] then tInvisible[ uPlayer ] = not tInvisible[ uPlayer ] setPlayerNametagShowing ( uPlayer, not tInvisible[ uPlayer ] ) setElementAlpha ( uPlayer, not tInvisible[ uPlayer ] and 255 or 0 ) for _,uBlip in pairs( getAttachedElements( uPlayer ) ) do if getElementType( uBlip ) == "blip" then local nR, nG, nB, _ = getBlipColor( uBlip ) setBlipColor( uBlip, nR, nG, nB, not tInvisible[ uPlayer ] and 255 or 0 ) end end end end ,200, 1, source ) end addEventHandler ( "onPlayerSpawn", root, fInvisible ) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Kenix Posted March 17, 2012 Posted March 17, 2012 No problem http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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