various things not working on dedicated server

Hi all.

I’m bashing my head against the wall wondering why these things are happening…

Firstly, nothing happens when I spin the scrollwheel - the IsMouseDown check never returns true. I’ve tried swapping the plain text enums for their number value (112 and 113)

local dist = 100

--third person
function ThirdPerson( ply, pos, ang, fov )

        if input.IsMouseDown(MOUSE_WHEEL_DOWN) then
            if dist > 50 then dist = dist - 5 end
        elseif input.IsMouseDown(MOUSE_WHEEL_UP) then
            if dist < 1000 then dist = dist + 5 end

                print(dist) -- this does not change from 100

hook.Add( "CalcView", "ThirdPerson", ThirdPerson )

Another issue I’m having is that code that worked on a listen server is breaking on a dedicated. Suddenly the bottom borders of my DTextEntry boxes are not drawing. It’s not a case of them not fitting the DPanel correctly or being covered up, see second screenshot

See and

And sql.SQLStr is still adding a bunch of random double quotation marks into strings, which it doesn’t do on a listen server

Thanks for any help :slight_smile:

Use CreateMove for mouse-wheel:

-1, 0, 1
[lua]hook.Add( “CreateMove”, “ThirdpersonFreecam:CreateMove”, function( cmd )
print( cmd:GetMouseWheel( ) );
end );[/lua]

Thanks! That works. Can you offer any insight into the other problems?

Code is executed differently when in singleplayer vs mp.

Use SRCDS to test your code. Second, sql.SQLStr takes a second argument for putting ""s around strings. Set it to true/false depending what you want to do.

I’m aware there’s differences… it’s fixing the problems I’m stuck on. I’ve already set SQLStr’s second argument to true, to disable adding " but it still ruins the string, as I’ve posted here

My other issue is that disabled DTextEntry boxes aren’t drawing properly (enabled ones are fine). They’re ‘moved downwards’ by 1 pixel, thus making them draw wrong - but this only happens on a dedicated server

thanks :slight_smile:

Hmm it seems I can type into the disabled text entrys as well