Raised This Month: $ Target: $400
 0% 

Respawning player right after death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Desikac
Senior Member
Join Date: Apr 2010
Location: Serbia
Old 06-16-2011 , 10:57   Re: Respawning player right after death
Reply With Quote #1

Thanks Exolent.

But now when the player is respawned, his corpse is removed from the game. How can I prevent that?
Desikac is offline
Send a message via MSN to Desikac Send a message via Skype™ to Desikac
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-16-2011 , 11:12   Re: Respawning player right after death
Reply With Quote #2

Quote:
Originally Posted by Desikac View Post
Thanks Exolent.

But now when the player is respawned, his corpse is removed from the game. How can I prevent that?
You have to make your own corpse entity and block the ClCorpse message.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-16-2011 , 12:08   Re: Respawning player right after death
Reply With Quote #3

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(PLUGINVERSION"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_Postid )
{
    if( !
g_bRoundEnd && cs_get_user_menu(id) != Menu_ChooseAppearance )
    {
        
set_pev(idpev_deadflagDEAD_RESPAWNABLE)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-19-2011 , 17:19   Re: Respawning player right after death
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
You have to make your own corpse entity and block the ClCorpse message.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 23:31.


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