View Single Post
Author Message
CUatTHEFINISH
Member
Join Date: Apr 2009
Old 11-24-2009 , 05:08   [L4D2] Player Unstick
Reply With Quote #1

I've noticed (especially when playing Dead Center) playing versus, survivors can get stuck and will be unable to move. Slapping doesn't free them and sometimes they have to wait for help from an infected player gracious enough to assist. A plugin like this was made here: http://forums.alliedmods.net/showthread.php?p=508657. However, its randomized location will spawn you way outside of the map.

This plugin will allow the user to type !stuck in chat and the plugin will teleport them a few inches away to help get them out of their predicament. It limits the user to only be able to do this twice on a map.

I've adapted my code from this plugin here: http://forums.alliedmods.net/showthread.php?p=664214

Commands:
sm_unstick <name> - Admin command to unstick a player in game (Requires Generic Admin)
!stuck - User command to unstick his/her self from being glitched

Cvars:
l4d2unstick_version - Version of the plugin
l4d2unstick_teleports - (default 2) Amount of times the client can use !stuck per map.
l4d2unstick_announce - (default 1) Announces at each new map that the !stuck command is available. 0 to turn off.

Change log:
  • Version 1.0.6
    • Fixed one last logic issue when l4d2unstick_teleports is set to 0
  • Version 1.0.5
    • Fixed cvar bugs
    • Fixed logic issue when l4d2unstick_teleports is set to 0
  • Version 1.0.4
    • Fixed double announcement bug
    • Added a 3 second delay to the user !stuck command (admin cmd has no delay)
    • Added a check to prevent hanging players from using !stuck and causing them to fall
  • Version 1.0.3
    • Added sm_unstick admin command
    • Reduced teleport distance (from 10 units to 4)
    • Cleaned up code and added more documentation
    • Various text display fixes
  • Version 1.0.2
    • Bug fix to make !stuck work in all situations
  • Version 1.0.1
    • Now allows !stuck to be used in team or global chat
    • Added l4d2unstick_teleports cvar
    • Added plugin announcing and l4d2unstick_announce cvar
    • Internal documentation added to source code
  • Version 1.0
    • Initial public release
To-Do:
  • Include a cvar to allow adjustment to how many teleports a user gets during a map -DONE (v 1.0.1)
  • Allow team chat to trigger the !stuck command - DONE (v 1.0.1)
  • Internal plugin announcement (Beginning of each campaign tell the user about the !stuck command)? - DONE (v 1.0.1)
  • Menu or console command that allows admins to unstick the affected player - DONE (v 1.0.3)
  • Tell users how many teleports they have left - DONE (v 1.0.3)
  • Clean up code (some warnings on compiling, doesn't effect plugin adversely) - DONE (v 1.0.3)
  • Check if client is snared and if so don't allow !stuck
Attached Files
File Type: sp Get Plugin or Get Source (l4d2unstick.sp - 5767 views - 6.1 KB)
File Type: smx l4d2unstick.smx (6.1 KB, 1830 views)
__________________

Last edited by CUatTHEFINISH; 11-27-2009 at 00:39. Reason: Updated to 1.0.6
CUatTHEFINISH is offline