Raised This Month: $12 Target: $400
 3% 

[TF2] Third Person / Clientprefs - (1.3.1) 4/25/2013


Post New Thread Reply   
 
Thread Tools Display Modes
Author
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Plugin ID:
3447
Plugin Version:
1.3.5
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    75 
    Plugin Description:
    Provides and Saves Third Person Preferences
    Old 01-03-2013 , 15:48   [TF2] Third Person / Clientprefs - (1.3.1) 4/25/2013
    Reply With Quote #1

    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 =/
    Attached Files
    File Type: sp Get Plugin or Get Source (tpc-1-3-5.sp - 4158 views - 7.4 KB)
    File Type: smx tpc-1-3-5.smx (6.3 KB, 2299 views)

    Last edited by friagram; 10-08-2013 at 17:30.
    friagram is offline
    CuriousG
    Senior Member
    Join Date: Feb 2012
    Old 01-03-2013 , 17:45   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #2

    How about adding a freeze command to encase the player in a block of ice with the models from your FreezeTag plugin?
    CuriousG is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 01-03-2013 , 17:48   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #3

    Quote:
    Originally Posted by CuriousG View Post
    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.

    Last edited by Sreaper; 01-03-2013 at 17:49.
    Sreaper is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 01-03-2013 , 18:03   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #4

    Quote:
    Originally Posted by CuriousG View Post
    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

    Last edited by friagram; 01-03-2013 at 18:03.
    friagram is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 01-03-2013 , 18:10   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #5

    You should use the SourceMod override system so people don't have to edit the plugin to change the flags.
    __________________
    Dr. McKay is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 01-03-2013 , 18:39   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #6

    Quote:
    Originally Posted by Dr. McKay View Post
    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

    Last edited by friagram; 01-22-2013 at 12:06.
    friagram is offline
    CuriousG
    Senior Member
    Join Date: Feb 2012
    Old 01-03-2013 , 20:20   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #7

    Quote:
    Originally Posted by Sreaper View Post
    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.
    CuriousG is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 01-03-2013 , 21:58   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #8

    Quote:
    Originally Posted by CuriousG View Post
    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.
    friagram is offline
    salsav91
    Senior Member
    Join Date: Aug 2012
    Location: Where Lollichops sleep
    Old 01-03-2013 , 23:46   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #9

    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.
    __________________


    Check out my pony animations. http://www.youtube.com/salsav91
    salsav91 is offline
    friagram
    Veteran Member
    Join Date: Sep 2012
    Location: Silicon Valley
    Old 01-04-2013 , 00:39   Re: [TF2] Third Person / Clientprefs
    Reply With Quote #10

    Quote:
    Originally Posted by salsav91 View Post
    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.

    Last edited by friagram; 01-08-2013 at 04:02.
    friagram is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 22:29.


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