Coding Help/Re-API Supported
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#1
Post
by ArminC » 6 years 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
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 6 years ago, edited 1 time in total.
-
TheWhitesmith
- Member
- Posts: 33
- Joined: 6 years ago
- Location: Temara/Rabat
-
Contact:
-
Quote
-
0
login to like this post
#2
Post
by TheWhitesmith » 6 years 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 ][/size]
IP: 149.202.251.74:27016
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#3
Post
by ArminC » 6 years ago
Yeah, it give me an error.. about id? (At complile)
Give me the full code..
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#4
Post
by ArminC » 6 years ago
+ add a cvar to enable/disable
-
Raheem
- Mod Developer
- Posts: 2214
- Joined: 7 years ago
-
Contact:
-
Quote
-
0
login to like this post
#5
Post
by Raheem » 6 years ago
Here:
#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
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_beap", "1")
}
public Fw_PlayerKilled_Post(id)
{
if (!is_user_connected(id) || get_pcvar_num(g_pCvarEnable) == 0 || get_member(id, m_iTeam) == TEAM_TERRORIST)
return HC_CONTINUE
// 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
}
He who fails to plan is planning to fail
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#6
Post
by ArminC » 6 years ago
Hmm.. I forgot something
.. 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..
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#7
Post
by ArminC » 6 years 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
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#8
Post
by ArminC » 6 years ago
Ok, actually I don't need camera on ground anymore.. bcs. I don't know if it's possible (trough a simple code)
-
ArminC
- Senior Member
- Posts: 137
- Joined: 6 years ago
- Location: Bucharest
-
Contact:
-
Quote
-
0
login to like this post
#9
Post
by ArminC » 6 years 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
}
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Register
Sign in
Users browsing this forum: No registered users and 0 guests