View Full Version : DoD FadeToBlack (v0.9)
Firestorm
07-09-2006, 10:47 AM
// DESCRIPTION:
// ============
//
// Very simple little plugin which brings Fade-to-Black back
// to the public servers as it's only available in ClanMatch
// mode normally.
// Dead player's screen will (like the name already says)
// fade to black and he cannot see from where he was shot.
// a little bit of realism for your public server ;-)
//
// USAGE:
// ======
//
// cvars (for amxx.cfg):
// ---------------------
//
// dod_fadetoblack_enabled <1/0> = enable/disable Fade-to-Black mode
//
// dod_fadetoblack_obeyimmunity <1/0> = enable/disable fading-immunity
// for admins
//
//
// console commands:
// -----------------
//
// amx_fadetoblack <1/0> = enable/disable Fade-to-Black mode
//
// CHANGELOG:
// ==========
//
// - 16.03.2005 Version 0.5beta
// Initial Release
//
// - 17.03.2005 Version 0.6beta
// * added admin command "amx_dodftb" to
// enable/disable the plugin
//
// - 17.03.2005 Version 0.7beta
// * added cvar to exclude admins from
// fading to black after dieing
//
// - 12.08.2005 Version 0.8beta
// * fixed scoped snipers not being faded
//
// - 02.07.2007 Version 0.9
// - using pcvar system now
// - changed cvar "dod_fadetoblack" to "dod_fadetoblack_enabled"
// - changed console command "amx_dodftb" to "amx_dodfadetoblack"
// - added global tracking cvar
//
spiff
07-10-2006, 02:35 AM
Ughh i need this.
TigerMan4
09-06-2006, 10:00 PM
will this work with deathfade running as well ? since deathfade makes admins with imunity see red ?
Hood [10th MD]
01-23-2007, 04:43 PM
Can we make this work for spectators as well, so anyone in spectator team has a black screen?
Hood [10th MD]
01-23-2007, 08:08 PM
Nevermind, it already does since you have to die to switch!
Thanks, this is superb - an excellent anti-ghosting tool for realism scrimmages!
Rookie
01-25-2007, 03:46 PM
tell how many players are in the server and do fade-to-black always when there are less than 4 players. but when more join, then use the values defined by the servers cfg files or admins.
be even better if there were a cvar to turn on and off this less than 4 player fade-to-black mode.
Rookie
Hood [10th MD]
02-26-2007, 02:14 AM
I have modified this code, and borrowed Tatsu's suggestion for the death fade to improve the plugin as follows:
The death fade now lasts MUCH longer, which is especially useful for this function I added:
Anyone that joins the spectator team also gets the fade, and it lasts as long as seems possible, which is excellent.
So why this modification? Well - it prevents ghosting, this is especially useful during realisms. Everyone check it out, let me know if it needs to be fixed, etc.
#include <amxmodx>
#include <amxmisc>
#include <dodx>
public plugin_init()
{
register_plugin("DoD FadeToBlack","0.8beta","AMXX DoD Team")
register_statsfwd(XMF_DEATH)
register_concmd("amx_dodftb","cmdsetftb",ADMIN_CFG,"<1/0> - enable/disable DoD FadeToBlack")
register_cvar("dod_fadetoblack","0")
register_cvar("dod_fadetoblack_obeyimmunity","0")
register_event("TextMsg","specblack","a","1=3","2=#game_joined_team","4=Spectators")
}
public plugin_modules()
{
require_module("dodx")
}
public specblack()
{
if(get_cvar_num("dod_fadetoblack")==1)
{
new username[32]
read_data(3,username,31)
new id = get_user_index(username)
set_task(0.1,"fade_to_black", id)
while(is_user_alive(id)==0)
{
set_task(20.0,"fade_to_black", id)
}
}
return PLUGIN_CONTINUE
}
public client_death(killer,victim,wpnindex,hitplace,TK){
if(get_cvar_num("dod_fadetoblack") == 1){
if((get_user_flags(victim)&ADMIN_IMMUNITY) && get_cvar_num("dod_fadetoblack_obeyimmunity") == 1){
return PLUGIN_CONTINUE
}
set_task(0.1,"fade_to_black",victim)
}
return PLUGIN_CONTINUE
}
public fade_to_black(victim){
new FadeToBlack = get_user_msgid("ScreenFade")
message_begin(MSG_ONE_UNRELIABLE,FadeToBlack,{0,0, 0},victim)
write_short( 1<<13)
write_short(~0)
write_short( 1)
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
}
public cmdsetftb(id,level,cid){
if (!cmd_access(id,level,cid,2)){
return PLUGIN_HANDLED
}
new ftb_s[2]
read_argv(1,ftb_s,2)
new ftb = str_to_num(ftb_s)
if(ftb == 1){
if(get_cvar_num("dod_fadetoblack") == 1){
client_print(id,print_chat,"[AMXX] DoD FadeToBlack is already enabled.....")
}
else if (get_cvar_num("dod_fadetoblack") == 0){
set_cvar_num("dod_fadetoblack",1)
client_print(id,print_chat,"[AMXX] DoD FadeToBlack ENABLED.....")
}
}
else if(ftb == 0){
if(get_cvar_num("dod_fadetoblack") == 0){
client_print(id,print_chat,"[AMXX] DoD FadeToBlack is already disabled.....")
}
else if(get_cvar_num("dod_fadetoblack") == 1){
set_cvar_num("dod_fadetoblack",0)
client_print(id,print_chat,"[AMXX] DoD FadeToBlack DISABLED.....")
}
}
return PLUGIN_HANDLED
}
Hood [10th MD]
02-26-2007, 02:20 AM
Nevermind... this change actually causes an error which crashes the server. What the error is, I couldn't say...
Thoughts?
=|[76AD]|= TatsuSaisei
02-26-2007, 04:30 AM
;4195']
Thoughts?
http://www.dodplugins.net/forums/showthread.php?t=669
but ...
new FadeToBlack = get_user_msgid("ScreenFade")
message_begin(MSG_ONE_UNRELIABLE,FadeToBlack,{0,0, 0},victim)
write_short( 1<<13)
write_short(~0)
write_short( 1) <<-- change this to 5
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
setting that value from 1 to 5 will ignore the ~0 previous value set by the write_short and simply make the fade last indefinetely until the next time a fade message is sent... (happens on player spawn by setting back to normal) and this will accomplish what you want as far as perm. blackout on spec... which btw.. my recent plugin does perfectly well... with the option of setting colors as well... not that this plugin was broken or bad by any means... I just will not pick up others work without being asked... and I learn more by "recoding" what I want done anyways...
MBosta
03-10-2007, 01:38 PM
this only works when you die, but anyway to make it work so if you go spec, it makes it black.
MBosta
03-10-2007, 01:43 PM
Sorry., but is there anyway for it so everyone that joins spec, sees black. Even people with immunity.
=|[76AD]|= TatsuSaisei
03-10-2007, 01:45 PM
Sorry., but is there anyway for it so everyone that joins spec, sees black. Even people with immunity.
ffs this post is not buried in another page....
http://www.dodplugins.net/forums/showthread.php?t=669
MBosta
03-10-2007, 01:54 PM
yea i installed that one, yet i'm able to see in spec and i have immunity. As you stated in that post, that it doesn't work on people with ban admin and up.
Kiel |17.SS|
03-12-2007, 10:44 PM
Set it so it shows on admin.
FeuerSturm
07-02-2007, 06:08 PM
//
// - 02.07.2007 Version 0.9
// - using pcvar system now
// - changed cvar "dod_fadetoblack" to "dod_fadetoblack_enabled"
// - changed console command "amx_dodftb" to "amx_dodfadetoblack"
// - added global tracking cvar
//
As always, please report bugs with the new version immediately!
Enjoy!
diamond-optic
07-02-2007, 06:22 PM
// - chaged console command "amx_dodftb" to "amx_dodfadetoblack"
BUG!!!!
typo :P heheh
FeuerSturm
07-02-2007, 06:53 PM
BUG!!!!
typo :P heheh
you're really mean :( :(
you should take into account that i'm
a) tired as it's 11pm here and i worked 10 hours today
b) english is not my native language
but hey, go on and shoot me :D :D
=|[76AD]|= TatsuSaisei
07-03-2007, 03:57 PM
you're really mean :( :(
you should take into account that i'm
a) tired as it's 11pm here and i worked 10 hours today
b) english is not my native language
but hey, go on and shoot me :D :D
NVM diamond.. he is sore as he was tracking someone elses packages for a few days while wondering why it said delivered and still wasn't holding anything of his...
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.