AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Third Person / Clientprefs - (1.3.1) 4/25/2013 (https://forums.alliedmods.net/showthread.php?t=204808)

friagram 01-03-2013 15:48

[TF2] Third Person / Clientprefs - (1.3.1) 4/25/2013
 
2 Attachment(s)
This is a really simple plugin that sets the forced taunt camera to allow players to go into third person. It saves their setting so that it will persist between connects/maps. It also attempts to address an issue where sometimes when you spawn, you will not be able to go into third person without going back into first person - by doing this automatically each time. The command handlers check if you are in first/third person, and omit repeated spam accordingly.


CVARs:
sm_tpcookie_version: version number, for tracking (don't change)
sm_tpcookie_enabled: (1) - Enable/Disable Plugin [0/1]

If you disable the plugin (or unload it), it should force everyone back into first person.

Commands:
sm_thirdperson or tp: Third Person
sm_firstperson or fp: First Person

Users should be familiar with these commands from other third person plugins.

Code:

2013-1-3 (v1.0.0)
* Initial Release

2013-1-3 (v1.1.0)
* Changed some MAXPLAYERS to MaxClients that were accidentally used in loops.
* Added IsPlayerAlive Checks before setting camera.

2013-1-8 (v1.2.0)
* Added CheckCommandAccess, use "sm_thirdperson" as an override flag, default is 0.
* Prevented dead/spectating players from getting feedback from commands.
* Use SM translations (lol)

2013 1-17 (v1.3.0)
* Changed how events are loaded/unloaded
* Removed superfluous sdkhooks include, =S

2013 4-25 (v1.3.1)
* Minor code cleanup
* Timers use userid instead of client

2013 9-19(v1.3.4)
* Fixed some rare client not in game errors
* Added auto third person removal/addition when enabled for zooming in with sniper rifles.

2013 9-21(v1.3.5)
* Added enabled check to condition added/removed forwards :3

Requirements:
Clientprefs

Installation:
- Put SMX in plugins directory
- Optional: add "sm_thirdperson" "SOMEFLAGS" to your overrides file to restrict everyone from using the thirdperson/firstperson commands

Plans:
- Add commands to force third/first on people for funs.
- Add natives for other plugins to send fp/tp commands depending on the client's preferences (like -> go to TP for 10 seconds and back to first, only if you prefer first).
- Figure out if there is some way to fix the crosshair from randomly appearing in the middle of the player's body =/

CuriousG 01-03-2013 17:45

Re: [TF2] Third Person / Clientprefs
 
How about adding a freeze command to encase the player in a block of ice with the models from your FreezeTag plugin?

Sreaper 01-03-2013 17:48

Re: [TF2] Third Person / Clientprefs
 
Quote:

Originally Posted by CuriousG (Post 1866468)
How about adding a freeze command to encase the player in a block of ice with the models from your FreezeTag plugin?

How is any of that relevant to this plugin?

Also nice work OP.

friagram 01-03-2013 18:03

Re: [TF2] Third Person / Clientprefs
 
Quote:

Originally Posted by CuriousG (Post 1866468)
How about adding a freeze command to encase the player in a block of ice with the models from your FreezeTag plugin?

Not relevant to this thread, but try sm_slay when you are in freezetag =S

Dr. McKay 01-03-2013 18:10

Re: [TF2] Third Person / Clientprefs
 
You should use the SourceMod override system so people don't have to edit the plugin to change the flags.

friagram 01-03-2013 18:39

Re: [TF2] Third Person / Clientprefs
 
Quote:

Originally Posted by Dr. McKay (Post 1866484)
You should use the SourceMod override system so people don't have to edit the plugin to change the flags.

You can do that also, though I'll probably add in a cvar for it later, few people sent me pms asking for that earlier.
Added to the note anyway, guess some people don't use the overrides file. I usually just build it into my plugins because it's easier to manage with multiple servers.

Edit: Changed to use checkcommandaccess with 1 shared override flag

CuriousG 01-03-2013 20:20

Re: [TF2] Third Person / Clientprefs
 
Quote:

Originally Posted by Sreaper (Post 1866470)
How is any of that relevant to this plugin?

Also nice work OP.

Not really relevant but his plans are to add command to force people into 3rd person. Why not force them to be frozen in 3rd person then? Consider it an added perk to 3rd person.

friagram 01-03-2013 21:58

Re: [TF2] Third Person / Clientprefs
 
Quote:

Originally Posted by CuriousG (Post 1866562)
Not really relevant but his plans are to add command to force people into 3rd person. Why not force them to be frozen in 3rd person then? Consider it an added perk to 3rd person.

I already integrated this feature into my freezetag mod, but I have not updated the version on the main page, if you would like to try the beta version, try the 1.02 or 1.03 in that thread:
https://forums.alliedmods.net/showpo...4&postcount=36

Code:

sm_freezetag_thirdperson [0]: 0: Do nothing special, 1: Force Third Person when frozen and First person otherwise, 2: Force Third Person when Frozen and Preserve whatever special setting the client had when they died.
You are correct in that the camera mechanisms are similar, but the mods arn't connected. They will work side-by side. We use them as such. I run this mod + my freeze tag mod with the convar set to 2 to force people into third for freeze and back to whatever they were in before. It should also work with other thirdperson plugins as well.

salsav91 01-03-2013 23:46

Re: [TF2] Third Person / Clientprefs
 
I definitely like this. Though I have one request if possible. Sometimes when I drop connection for a few seconds the game will return me to first person, unless I either change class or !fp the !tp back into it. I was wondering if perhaps the plugin can check the player every few minutes if they are in thirdperson and if they aren't, force the command, but only if they had entered thirdperson to begin with. Again I am not sure if that is even possible, just throwing it out there.

Otherwise the plugin has been working nicely, have yet to find any other problems.

friagram 01-04-2013 00:39

Re: [TF2] Third Person / Clientprefs
 
Quote:

Originally Posted by salsav91 (Post 1866661)
I definitely like this. Though I have one request if possible. Sometimes when I drop connection for a few seconds the game will return me to first person, unless I either change class or !fp the !tp back into it. I was wondering if perhaps the plugin can check the player every few minutes if they are in thirdperson and if they aren't, force the command, but only if they had entered thirdperson to begin with. Again I am not sure if that is even possible, just throwing it out there.

Otherwise the plugin has been working nicely, have yet to find any other problems.

That would probably require running a timer loop over everyone to constantly reset the camera settings. It's not a ton of overhead, but not really needed unless other people have issues. It would however force compliance with other mods that mess with the camera - like how roll the dice puts you in third person when viewing your ragdoll and such (I think), and other such mods.

I have not heard of this issue. Do you start to disconnect and see the connection interrupted message, and then hear the drowning sound before coming back in?

Edit - looks like it will spam you with feedback messages if you join the game and use the command without a team//from spectate. I'll just move the notification into an alive check, so people don't have to see that. I know a lot just bind it to their mousewheel or something.

I'll also update it to use a checkcommandaccess flag/default later, been busy working on other mods.


All times are GMT -4. The time now is 01:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.