Wgrałem sobie taki plugin jak w temacie, ale są z nim problemy. Kiedy rzycę flasha nic się nie dzieje. Wszytsko widać, nic nie oślepia. Dzwięk jest. Poniżej plik *.SMA plugina. Proszę o sprawdzenie.
PS. Dodam jeszcze, że przed kilkoma dzwiękami dałem
//, aby dzwięki się nie odtwarzały.
SMA pluginu:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
#define PLUGIN "Real Flashbang"
#define VERSION "0.5"
#define AUTHOR "v3x / VoivoD"
new g_nMsgScreenFade
new g_fbomfg[33]
#define MINIMUM_FEARTIME 0.1
#define MAXIMUM_FEARTIME 3.0
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("ScreenFade","FlashedEvent","be","4=255","5=255","6=255","7>199")
g_nMsgScreenFade = get_user_msgid("ScreenFade")
register_logevent("fbnew_round", 2, "1=Round_Start")
// Cvars
register_cvar("amx_fb_effect", "1")
register_cvar("amx_fb_r", "2")
register_cvar("amx_fb_g", "1")
register_cvar("amx_fb_b", "1")
}
public plugin_precache()
{
precache_sound("voi/flashbanged2.wav")
// precache_sound("voi/jamuzaraz.wav")
// precache_sound("voi/okurwa.wav")
// precache_sound("voi/pomocy.wav")
// precache_sound("scientist/startle1.wav")
// precache_sound("scientist/dontwantdie.wav")
//precache_sound("voi/heartbeat_voi.wav")
}
public fbnew_round( id )
{
client_cmd(id,"room_type 0")
}
public client_connect(id)
{
client_cmd(id,"room_type 0") //to be sure that the echo didnt survived after mapchange...
} //...if the fault was this effect or predefined echo on the map(cs_siege,rats etc.)
public FlashedEvent( id )
{
if(get_cvar_num("amx_fb_effect")==1)
{
new iRed,iGreen,iBlue
iRed = get_cvar_num("amx_fb_r")
iGreen = get_cvar_num("amx_fb_g")
iBlue = get_cvar_num("amx_fb_b")
if ( !( iRed ) || !( iGreen ) || !( iBlue ) )
{
iRed = 100
iGreen = 100
iBlue = 100
}
message_begin( MSG_ONE,g_nMsgScreenFade,{0,0,0},id )
write_short( read_data( 1 ) ) // Duration
write_short( read_data( 1 ) ) // Hold time
write_short( read_data( 3 ) ) // Fade type
write_byte ( iRed ) // Red
write_byte ( iGreen ) // Green
write_byte ( iBlue ) // Blue
write_byte ( read_data( 0 ) ) // Alpha
message_end()
set_task(1.5,"omgivebeenflashbanged",id) //stunned this long then waking+heartbeat and breathe sounds
set_task(5.0,"fb_effectsfade1",id) //fading
set_task(6.0,"fb_effectsfade2",id) //of
set_task(7.0,"fb_effectsfade3",id) //echo
set_task(8.0,"fb_effectisstopped",id)
client_cmd(id,"room_type 6;room_delay 0.3;room_lp 1;room_mod 5;room_feedback 0.85;room_size 0.9;room_left 0.5;room_refl 2")
// i leave those lines if u want to know which commands do what
// client_cmd(id,"room_delay 0.3") //those nice echo effects like on de_rats + tweaked
// client_cmd(id,"room_lp 1") //effect - some kind of filter //hope this few lines doesnt make overflows
// client_cmd(id,"room_mod 5") //effect - modulation
// client_cmd(id,"room_feedback 0.85")
// client_cmd(id,"room_size 0.9") //effect - size of the room echo(and how long the sound is "bounced)
// client_cmd(id,"room_left 0.5") //effect - nice stereo delay
// client_cmd(id,"room_refl 2") //effect - all LOUDER!
set_task(1.0,"fb_loudyeffectstop",id)
client_cmd(id,"spk voi/flashbanged2") //u hear the stunning sound
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public fb_loudyeffectstop( id ) //stop the LOUDY effect
{
client_cmd(id,"room_refl 0.92")
}
public fb_effectsfade1( id )
{
if(is_user_alive(id))
{
client_cmd(id,"room_delay 0.2")
}
else
{
set_task(0.1,"fb_effectisstopped",id)
}
}
public fb_effectsfade2( id )
{
if(is_user_alive(id))
{
client_cmd(id,"room_delay 0.1")
}
else
{
set_task(0.1,"fb_effectisstopped",id)
}
}
public fb_effectsfade3( id )
{
if(is_user_alive(id))
{
client_cmd(id,"room_delay 0.01")
}
else
{
set_task(0.1,"fb_effectisstopped",id)
}
}
public fb_effectisstopped( id )
{
client_cmd(id,"room_type 0")
client_cmd(id,"room_size 0.09")
//setting this to default is useless, but u may uncomment it // client_cmd(id,"room_mod 0")
client_cmd(id,"room_lp 0")
client_cmd(id,"room_left 0.01")
}
public omgivebeenflashbanged( id ) //you start waking
{
if((g_fbomfg[id]==0) || is_user_alive(id))
{
g_fbomfg[id]=1 //hmm im stunned, i dont need more
set_task(7.0,"flashstunn_unblocked",id) //the stunned player sounds are blocked
new bitch[33]
bitch[id] = (random_num(1,3))
if(bitch[id] == 1)
{
set_task(random_float(MINIMUM_FEARTIME, MAXIMUM_FEARTIME),"fb_fear1",id)
}
else if(bitch[id] == 2)
{
set_task(random_float(MINIMUM_FEARTIME, MAXIMUM_FEARTIME),"fb_fear2",id)
}
else if(bitch[id] == 3)
{
set_task(random_float(MINIMUM_FEARTIME, MAXIMUM_FEARTIME),"fb_fear3",id)
}
else
{
set_task(0.1,"fb_effectisstopped",id)
}
}
//return FMRES_IGNORED
}
public flashstunn_unblocked( id )
{
g_fbomfg[id]=0 //hey i want to be stunned again <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />
}
public fb_fear1( id )
{
// emit_sound(id, CHAN_AUTO, "voi/pomocy.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public fb_fear2( id )
{
// emit_sound(id, CHAN_AUTO, "voi/okurwa.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
public fb_fear3( id )
{
// emit_sound(id, CHAN_AUTO, "voi/jamuzaraz.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
//public fb_fear4( id )
//{
// emit_sound(id, CHAN_AUTO, "scientist/startle1.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
//}
//public fb_fear5( id )
//{
// emit_sound(id, CHAN_AUTO, "scientist/dontwantdie.wav", 1.0, ATTN_NORM, 0, PITCH_LOW)
//}


Dodatki SourceMod



Temat jest zamknięty










