PHP Code:
/* Formatright © 2010, ConnorMcLeod
This plugin is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this plugin; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define VERSION "0.0.2"
#define PLUGIN "Respawn After Death" // "Kz Respawn"
#define XO_PLAYER 5
#define m_iMenuCode 205
// #define m_iSpawnTimes 365
#define Menu_ChooseAppearance 3
#define cs_get_user_menu(%0) get_pdata_int(%0, m_iMenuCode, XO_PLAYER)
new bool:g_bRoundEnd
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
RegisterHam(Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1)
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
register_logevent("Logevent_Round_End", 2, "1=Round_End")
// register_clcmd("joinclass", "ClCmd_CoudBeChoosingAppearance")
// register_clcmd("menuselect", "ClCmd_CoudBeChoosingAppearance")
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
}
public Event_HLTV_New_Round()
{
g_bRoundEnd = false
}
public Logevent_Round_End()
{
g_bRoundEnd = true
}
/*public ClCmd_CoudBeChoosingAppearance( id )
{
if( !g_bRoundEnd && cs_get_user_menu(id) == Menu_ChooseAppearance )
{
set_pdata_int(id, m_iSpawnTimes, 0, XO_PLAYER) // this method only works on maps that don't have objectives
}
}*/
public Ham_CBasePlayer_Killed_Post( id )
{
if( !g_bRoundEnd && cs_get_user_menu(id) != Menu_ChooseAppearance )
{
set_pev(id, pev_deadflag, DEAD_RESPAWNABLE)
}
}
__________________