Death Beeepp... (solved)

Coding Help/Re-API Supported
Post Reply
User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

Death Beeepp... (solved)

#1

Post by ArminC » 1 Year Ago

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;
}
Last edited by ArminC on 26 Feb 2018, 15:31, edited 1 time in total.

User avatar
TheWhitesmith
Member
Member
Morocco
Posts: 33
Joined: 1 Year Ago
Location: Temara/Rabat
Has thanked: 1 time
Been thanked: 2 times
Age: 19
Contact:

#2

Post by TheWhitesmith » 1 Year Ago

#include <reapi>

...
public Ham bla bla...
{
if (get_member(id, m_iTeam) != TEAM_CT) return HAM_IGNORED
....
}
[SYA] CSGO-Mod for CS 1.6 [ Cases/Keys/Rank ]
IP: 149.202.251.74:27016

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#3

Post by ArminC » 1 Year Ago

Yeah, it give me an error.. about id? (At complile)

Give me the full code..

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#4

Post by ArminC » 1 Year Ago

+ add a cvar to enable/disable

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1958
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#5

Post by Raheem » 1 Year Ago

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. }
You don't know? Learn and you will know.

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#6

Post by ArminC » 1 Year Ago

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..

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#7

Post by ArminC » 1 Year Ago

++ 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

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#8

Post by ArminC » 1 Year Ago

Ok, actually I don't need camera on ground anymore.. bcs. I don't know if it's possible (trough a simple code)

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 1 Year Ago
Location: Bucharest
Has thanked: 0
Been thanked: 2 times
Age: 17
Contact:

#9

Post by ArminC » 1 Year Ago

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
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest