Page 1 of 1

Death Beeepp... (solved)

Posted: 28 Jan 2018, 14:10
by ArminC
Can you make this to be only for humans.. or actually: Whenever you become zm you are moved to terrorist team right?? So humans are only ct.. so can you made this only for ct to be like die beeep.. as I know.. human have some tech.. but I don't know that zombies have auto diagnostic medical system :lol:

Code: Select all

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN_NAME    "First Person Death"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR  "Numb"

#define SPECMODE_ALIVE 0

new g_msgScreenFade

public plugin_init()
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
	g_msgScreenFade = get_user_msgid("ScreenFade")
	RegisterHam(Ham_Killed, "player", "Ham_Killed_player_Post", 1);
}

public Ham_Killed_player_Post(iPlrId, iIdattacker, iShouldGib)
{

	// Screen fade effect
	message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, {0,0,0}, iPlrId)
	write_short(12288)	// Duration
	write_short(12288)	// Hold time
	write_short(0x0001)	// Fade type
	write_byte (0)		// Red
	write_byte (0)		// Green
	write_byte (0)		// Blue
	write_byte (255)	// Alpha
	message_end()

	client_cmd(iPlrId, "spk fvox/flatline");
	set_pev(iPlrId, pev_iuser1, SPECMODE_ALIVE);
		
	return HAM_IGNORED;
}

Re: Death Beeepp...

Posted: 28 Jan 2018, 16:30
by TheWhitesmith
#include <reapi>

...
public Ham bla bla...
{
if (get_member(id, m_iTeam) != TEAM_CT) return HAM_IGNORED
....
}

Re: Death Beeepp...

Posted: 28 Jan 2018, 17:17
by ArminC
Yeah, it give me an error.. about id? (At complile)

Give me the full code..

Re: Death Beeepp...

Posted: 30 Jan 2018, 06:55
by ArminC
+ add a cvar to enable/disable

Re: Death Beeepp...

Posted: 30 Jan 2018, 11:50
by Raheem
Here:
    1. #include <amxmodx>
    2. #include <reapi>
    3.  
    4. #define PLUGIN_NAME    "First Person Death"
    5. #define PLUGIN_VERSION "1.0"
    6. #define PLUGIN_AUTHOR  "Numb"
    7.  
    8. #define SPECMODE_ALIVE 0
    9.  
    10. new g_msgScreenFade
    11.  
    12. // Pointers For Cvars
    13. new g_pCvarEnable
    14.  
    15. public plugin_init()
    16. {
    17.     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
    18.    
    19.     // Hookchains
    20.     RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
    21.    
    22.     // Messages
    23.     g_msgScreenFade = get_user_msgid("ScreenFade")
    24.    
    25.     // Cvars
    26.     g_pCvarEnable = register_cvar("enable_death_beap", "1")
    27. }
    28.  
    29. public Fw_PlayerKilled_Post(id)
    30. {
    31.     if (!is_user_connected(id) || get_pcvar_num(g_pCvarEnable) == 0 || get_member(id, m_iTeam) == TEAM_TERRORIST)
    32.         return HC_CONTINUE
    33.    
    34.     // Screen fade effect
    35.     message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, {0,0,0}, id)
    36.     write_short(12288)  // Duration
    37.     write_short(12288)  // Hold time
    38.     write_short(0x0001) // Fade type
    39.     write_byte (0)      // Red
    40.     write_byte (0)      // Green
    41.     write_byte (0)      // Blue
    42.     write_byte (255)    // Alpha
    43.     message_end()
    44.    
    45.     client_cmd(id, "spk fvox/flatline");
    46.     set_entvar(id, var_iuser1, SPECMODE_ALIVE);
    47.    
    48.     return HC_CONTINUE
    49. }

Re: Death Beeepp...

Posted: 30 Jan 2018, 13:09
by ArminC
Hmm.. I forgot something :lol: .. can you add a cvar like if it's 1, enable only for CT and if it's 0 for ct+t?

+ (the most important) add a cvar if 1 enable sound if 0 just that lay effect..

Re: Death Beeepp...

Posted: 31 Jan 2018, 20:49
by ArminC
++ can you make when you die the camera to be like on the ground... like it's floating in the air.. when you die you stay lied on the ground.. not floating in the air.. wtf

Re: Death Beeepp...

Posted: 02 Feb 2018, 18:12
by ArminC
Ok, actually I don't need camera on ground anymore.. bcs. I don't know if it's possible (trough a simple code)

Re: Death Beeepp...

Posted: 07 Feb 2018, 18:53
by ArminC
This modified works? From Allied but I don't know if it's corectly made :?:

Code: Select all

#include <amxmodx>
#include <reapi>

#define PLUGIN_NAME    "First Person Death"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR  "Numb"

#define SPECMODE_ALIVE 0

new g_msgScreenFade

// Pointers For Cvars
new g_pCvarEnable, g_pCvarTeam

public plugin_init()
{
    register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
    
    // Hookchains
    RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
    
    // Messages
    g_msgScreenFade = get_user_msgid("ScreenFade")
    
    // Cvars
    g_pCvarEnable = register_cvar("enable_death_sound", "1")
    g_pCvarTeam   = register_cvar("choose_team_effect", "1") // 1 = CT, 2 = T, 3 Both
}

public Fw_PlayerKilled_Post(id)
{
    if (!is_user_connected(id) || get_pcvar_num(g_pCvarEnable) == 0)
        return HC_CONTINUE
    
    if (get_member(id, m_iTeam) != get_pcvar_num(g_pCvarTeam))
    {
        // Screen fade effect
        message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, {0,0,0}, id)
        write_short(12288)  // Duration
        write_short(12288)  // Hold time
        write_short(0x0001) // Fade type
        write_byte (0)      // Red
        write_byte (0)      // Green
        write_byte (0)      // Blue
        write_byte (255)    // Alpha
        message_end()
        
        client_cmd(id, "spk fvox/flatline");
        set_entvar(id, var_iuser1, SPECMODE_ALIVE);
    }
    return HC_CONTINUE
}