PHP Code:
/***********************************************************************************
*
* Plugin : Advanced - Respawn Menu
*
* Author : Atomen
*
* Version : 2.1 - 15/4/2008
*
* Plugin Thread : "http://forums.alliedmods.net/showthread.php?t=67801"
*
*===================================================================================*
*
* Description
*
* My first plugin , Advanced respawn with menu. Has multiple different features.
* Instant respawn on join (defined by cvar). Health on spawn feature
* 17 cvars and more to come to customize. Only works on Counter-Strike and CZ.
* Requires 4 modules , "fakemeta_util", "hamsandwich", "cstrike", "fakemeta".
*
* Advanced menu for each cvar. Also blocks
* abusing of "/respawn" say command. You cannot use it while alive. I made this
* plugin mostly because the were only 2 different respawn plugins out there.
* (This does not count as a deathmatch plugin)
*
* Halo - Respawn : Made by Emp` (Though it differs much from this plugin)
*
* Respawn Forever : Made by Geesu
*
* Last update on "Halo - Respawn" was on 4/2/2007.
* Last update on "Respawn Forever" was on 2/4/2005.
*
* This plugin is using pcvar and new respawn system "Hamsandwich"
*
*==================================================================================*
*
* Credits
*
* -Exolent : Recived a much needed help from him !
*
* -Arkshine : Pointing out that i should use if statement
*
* -G-Dog : Helped me with multiple "cs_get_user_team" command
*
* -v3x : Got help from his plugin "Awp Glow"
*
* -Geesu : Used his code for the "/respawn" command
*
* -MeRcyLeZZ : Helped me alot with the menus !
*
* -[FTW]-S.W.A.T / vittu : Code for the spawn effect
*
* -Vittu : Ham respawn function and recommending other team function
*
*==================================================================================*
*
* Changelog :
* V 2.1 - Addition Update
* - Fixed menu comes up when plugin is disabled
* - Fixed message displayed even if dead
* - Fixed problem with server cvar
* - Added amx_respawn_punish cvar/menu
* - Added amx_respawn_click cvar/menu
* - Added additional checks on spawn
* - Changed Admin flag to "u" for menu access
* - Changed position of the hudmessages
* - Changed chat detecting
*
* V 2.0 - Performance Update
* - Improved performance/stability
* - Added a lot more use of hamsandwich module
* - Added block for the say command
* - Added more checks to avoid problems
* - Renamed some functions to more appropriate names
* - Removed a lot of "not needed" functions
* - Removed not needed variables
* - Removed all bugs/problems
* - Fixed a crash whom occured on respawn
* - Fixed a pcvar problem with toggle_say
* - Fixed so less resources is used
* - Fixed amx_respawn_armor menu
* - Fixed code smaller
* - Changed the spawn effect framerate
* - Changed some commands/functions
* - Changed a lot of checks
*
* V 1.5c - Update || 10/3/2008
* - Fixed Crash problem
* - Added Plugin Tracker
* - Added *_kill_money cvar/menu
*
* V 1.5b - Small addition
* - Added more options for *_abuse
*
* V 1.5a - Bug/Problem Update
* - Fixed issue with money system
* - Fixed 3 bugs/problems
* - Fixed "/respawn"
* - Added cstrike module for better detecting
*
* V 1.5 - Never released
* - An important update on the menus !
* - Reduced numbers of "set_task()"
* - Fixed problems with menus
* - Added money system, off by default
* - Added amx_respawn_money cvar/menu
* - Added amx_respawn_amount cvar/menu
* - Added fakemeta module for respawn support
*
* V 1.4 - Important Update
* - Changed respawn method to hamsandwich
* - Fixed Weapon related Menu
* - Added amx_respawn_health cvar/menu
* - Renamed amx_respawn_say to *_abuse
*
* V 1.3a - Small Update
* - Added amx_respawn_say cvar/menu
*
* V 1.3
* - Removed fun module
* - Renamed main menu
* - Added sound effect on spawn
* - Added amx_respawn_effect cvar/menu
* - Added amx_respawn_armor cvar/menu
*
* V 1.2
* - Optimized code
*
* V 1.1
* - Removed cstrike module thanks to X-Olent
*
* V 1.0
* - Initial release
*
*==================================================================================*
*
* Menu Command :
*
* amx_respawn_menu
*
* Write in console, Requires
* ADMIN_MENU access (flag "u")
*
*
************************************************************************************
*
* CVARS Spawn Related :
*
* amx_respawn "1" //Toggles the plugin on/off
* amx_respawn_delay "1" //Delay until respawn upon death
* amx_respawn_effect "0" //Respawn effect
* amx_respawn_abuse "1" //0=Disabled 1=only dead 2=Say "/respawn" alive
* amx_respawn_health "0" //Health on spawn , 0 = 100 hp
* amx_respawn_click "0" //Respawn by click(+attack)
*
*
************************************************************************************
*
* CVARS Protection Related :
*
* amx_respawn_protection "1" //Toggles spawn protection on/off
* amx_respawn_protection_time "3" //Toggles how long you are protected
* amx_respawn_protection_glow "1" //Toggles Protection Glow
* amx_respawn_protection_message "1" //Toggles spawn protection message on/off
*
*
************************************************************************************
*
* CVARS Weapon Related :
*
* amx_respawn_pistol "1" //Respawn with a pistol or not
* amx_respawn_ammo "1" //Respawn with full ammo on the pistol
* amx_respawn_kevlar "1" //Respawn with kevlar= 1 ||Kevlar+Helmet = 2
* amx_respawn_punish "0" //Remove the users weapon on tk
*
*
************************************************************************************
*
* CVARS Money Related :
*
* amx_respawn_money "1" //Recieve money on each respawn,0 by default
* amx_respawn_amount "600" //How much money , 600 by default
* amx_respawn_kill_money "200" //Add money on frag, Default 300 + "200"
*
*
***********************************************************************************/
Recommended Addons :Updates : Current Version 2.1 - Update || 15/4/2008
Code:
* Changelog :
* V 2.1
* - Fixed menu comes up when plugin is disabled
* - Fixed message displayed even if dead
* - Fixed problem with server cvar
* - Added amx_respawn_punish cvar/menu
* - Added amx_respawn_click cvar/menu
* - Added additional checks on spawn
* - Changed Admin flag to "u" for menu access
* - Changed position of the hudmessages
* - Changed chat detecting
*
* V 2.0 - Performance Update
* - Improved performance/stability
* - Added a lot more use of hamsandwich module
* - Added block for the say command
* - Added more checks to avoid problems
* - Renamed some functions to more appropriate names
* - Removed a lot of "not needed" functions
* - Removed not needed variables
* - Removed all bugs/problems
* - Fixed a crash whom occured on respawn
* - Fixed a pcvar problem with toggle_say
* - Fixed so less resources is used
* - Fixed amx_respawn_armor menu
* - Fixed code smaller
* - Changed the spawn effect framerate
* - Changed some commands/functions
* - Changed a lot of checks
In version 2.1 i added a cvar amx_respawn_click, you
should try it out.
There are 2 different versions of the plugin.
With or without menu.
Uploaded both because the 1 with menus has a lot of more lines.
-----------------------------------------
If you have a lot of menus you can fix it easily.
Just add this menu to amxmodmenu with this command
Code:
amx_addmenuitem "Respawn Menu" "amx_respawn_menu" "c" "Advanced - Respawn Menu"
Add it to the custom menu file in "amxmodx/configs/custommenuitems.cfg"
NOTE : Since "/respawn" is often abused ive used a "protection"
to stop the abuse. If you type "/respawn" you will be teleported to
the spawn. So your hp will not get refilled or your weapons
"amx_respawn_abuse '0'" = No messages , Say Command off
"amx_respawn_abuse '1'" = Only dead players can use it(default)
"amx_respawn_abuse '2'" = Alive and dead can use it.
Screenshot on the menu