Draw the crosshair when in third person with cg_thirdPerson
-
Hello,
So I'm trying to add toggle-able third person on my server and with the help of several people on the Discord I got it to work but my only issue is that before I was using
camera_thirdPerson 1to set everyone in third person because it allowed me to keep the crosshair on screen.From what I understood
camera_thirdPersonis not a client dvar so I have to usecg_thirdPersoninstead but it takes away the crosshair for both normal state and aiming.I checked and both
cg_drawCrosshairandui_drawCrosshairare set to 1.Below are screenshots of what I have with
camera_thirdPersonthat I would like to replicate withcg_thirdPersoneither for both normal and aiming states or even better: only when aiming.

-
camera_thirdPerson's value is propagated by the server to all connecting clients, it is cheat protected and has another flag I don't know about.
It's a dvar shared by both game and the server. So I guess it depends what's your definition of client dvar, but I would consider it one.
So, by all means, camera_thirdPerson is good to use because you just need to change it server-side and its value will be updated to all clients.
Since it's cheat protected it will be reset to its original value once a client disconnects from your server so you don't have to worry about messing with client config. So if the reason for not using camera_thirdPerson was because you thought it was not a client dvar, now you know. -
camera_thirdPerson's value is propagated by the server to all connecting clients, it is cheat protected and has another flag I don't know about.
It's a dvar shared by both game and the server. So I guess it depends what's your definition of client dvar, but I would consider it one.
So, by all means, camera_thirdPerson is good to use because you just need to change it server-side and its value will be updated to all clients.
Since it's cheat protected it will be reset to its original value once a client disconnects from your server so you don't have to worry about messing with client config. So if the reason for not using camera_thirdPerson was because you thought it was not a client dvar, now you know.Premake5 client means each client can change it themselves. Therefore camera_thirdPerson would not work. As for getting this done, I know for a fact it can’t be done in bo2, so in mw3, i would feel the same. However I dont work with mw3 so idk haha
-
camera_thirdPerson's value is propagated by the server to all connecting clients, it is cheat protected and has another flag I don't know about.
It's a dvar shared by both game and the server. So I guess it depends what's your definition of client dvar, but I would consider it one.
So, by all means, camera_thirdPerson is good to use because you just need to change it server-side and its value will be updated to all clients.
Since it's cheat protected it will be reset to its original value once a client disconnects from your server so you don't have to worry about messing with client config. So if the reason for not using camera_thirdPerson was because you thought it was not a client dvar, now you know.Premake5 I'm not 100% sure I explained it right or if I misunderstand what you're saying.
I want each player to be in third person by default and to be able to switch his own camera and only his camera to first person by pressing a button.With
cg_thirdPersonthe script below works fine but withcamera_thirdPersonit doesn't work.
It's a server/global dvar so it doesn't work and to my understanding removing self would override the dvar for every player on the server

fun_buttonPressed2(button) { self endon("disconnect"); level endon("game_ended"); self notifyOnPlayerCommand("third_person_button", button); while(1) { self waittill("third_person_button"); isInThirdPerson = GetDvar( "camera_thirdPerson" ); self iprintlnbold(isInThirdPerson); if (isInThirdPerson == "0") { self SetClientDvar("camera_thirdPerson", "1"); } else if (isInThirdPerson == "1") { self SetClientDvar("camera_thirdPerson", "0"); } wait(1); } } -
If the crosshair is disabled by that dvar then I suggest you find in the game's code where the cross hair is supposed to be rendered and force it to always render. It's not impossible, just difficult.
-
Since this is a global dvar and I really want to keep the camera this way I decided to make a vote system on my server instead so that players can choose which camera they want at any time in the game
If anyone is interested in this see my Github
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login