• I need a little help with my status text addon
    1 replies, posted
concommand.Add( "announcement", function( ply, cmd, type )         if ( Player( 2 ):IsUserGroup( "superadmin" ) ) then draw.DrawText( "Server Status: ", type ), "TargetID", ScrW() * 0.5, ScrH() * 0.25, Color( 255, 255, 255, 255 ), TEXT_ALIGN_RIGHT end ) I am trying to make it display on the screen infinite
Your code has a few problems: On the second line you use a hard coded player instead of whoever is calling the function (use ply instead of Player(2)). Your draw.DrawText function closes after type when it should close after TEXT_ALIGN_RIGHT You don't close your if statement (you need another end) You only draw the text once the command is called and you're trying to use a table (type) as a string. My suggestion: A good way to do this would be to use a replicated console variable to store the text instead of a concommand. You could either split this into two files, one for the server and one for the client, or use a shared file. You'd make the console variable, ensuring that it's on the server not the client, and on the client you'd make a HUDPaint hook that checks the console variable. If the variable is an empty string then return otherwise draw the text.
Sorry, you need to Log In to post a reply to this thread.