• Cloak
    2 replies, posted
Hello, There seems to be an issue with my cloak. Whenever you cloak, your name above your head is still showing, whenever you have a physic gun out it reveals the brightness of it, and when you begin to type something it shows the message icon above your head. How are you able to make it completely cloak so none of this happens? The codes below. [CODE]function ulx.cloak( calling_ply, target_plys, amount, should_uncloak ) if not target_plys[ 1 ]:IsValid() then Msg( "You are always invisible.\n" ) return end amount = 255 - amount for i=1, #target_plys do ULib.invisible( target_plys[ i ], not should_uncloak, amount ) end if not should_uncloak then ulx.fancyLogAdmin( calling_ply, "#A cloaked #T by amount #i", target_plys, amount ) else ulx.fancyLogAdmin( calling_ply, "#A uncloaked #T", target_plys ) end end local cloak = ulx.command( CATEGORY_NAME, "ulx cloak", ulx.cloak, "!cloak" ) cloak:addParam{ type=ULib.cmds.PlayersArg, ULib.cmds.optional } cloak:addParam{ type=ULib.cmds.NumArg, min=0, max=255, default=255, hint="amount", ULib.cmds.round, ULib.cmds.optional } cloak:addParam{ type=ULib.cmds.BoolArg, invisible=true } cloak:defaultAccess( ULib.ACCESS_ADMIN ) cloak:help( "Cloaks target(s)." ) cloak:setOpposite( "ulx uncloak", {_, _, _, true}, "!uncloak" )[/CODE]
With my invisibility system, I use PrePlayerDraw ( returning true prevents the player from being rendered and should prevent any name data being shown ). Also, if the selected weapon is physgun when cloak is activated, set the weapon color to 0 0 0... If not-invisible and the color is 0 0 0 then restore the color. If weapon switched to physgun while invisible, alter color to 0 0 0, or if not invisible restore color.
I changed the true, but seems that people still see my name. function ulx.cloak( calling_ply, target_plys, amount, should_uncloak ) if not target_plys[ 1 ]:IsValid() then Msg( "You are always invisible.\n" ) return end amount = 255 - amount for i=1, #target_plys do ULib.invisible( target_plys[ i ], not should_uncloak, amount ) end if not should_uncloak then ulx.fancyLogAdmin( calling_ply, true, "#A cloaked #T by amount #i", target_plys, amount ) else ulx.fancyLogAdmin( calling_ply, true, "#A uncloaked #T", target_plys ) end end local cloak = ulx.command( CATEGORY_NAME, "ulx cloak", ulx.cloak, "!cloak" ) cloak:addParam{ type=ULib.cmds.PlayersArg, ULib.cmds.optional } cloak:addParam{ type=ULib.cmds.NumArg, min=0, max=255, default=255, hint="amount", ULib.cmds.round, ULib.cmds.optional } cloak:addParam{ type=ULib.cmds.BoolArg, invisible=true } cloak:defaultAccess( ULib.ACCESS_ADMIN ) cloak:help( "Cloaks target(s)." ) cloak:setOpposite( "ulx uncloak", {_, _, _, true}, "!uncloak" )
Sorry, you need to Log In to post a reply to this thread.