Raised This Month: $ Target: $400
 0% 

Real Flahbang


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-11-2007 , 15:42   Real Flahbang
Reply With Quote #1

Plug-in compiles fine, but I have big problem with plug-in works. When I throw flashbang sounds plays, but i has don't flash effects [blinding]. Plz help me. Thanks.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
#define PLUGIN "Real Flashbang"
#define VERSION "0.5"
#define AUTHOR "sQn"
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_roundid )
{
 
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 FlashedEventid )
{
 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_beginMSG_ONE,g_nMsgScreenFade,{0,0,0},id )
 
write_shortread_data) ) // Duration
 
write_shortread_data) ) // Hold time
 
write_shortread_data) ) // Fade type
 
write_byte iRed )  // Red
 
write_byte iGreen )  // Green
 
write_byte iBlue )  // Blue
 
write_byte read_data) ) // 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_loudyeffectstopid //stop the LOUDY effect
{
 
client_cmd(id,"room_refl 0.92"
}
public 
fb_effectsfade1id )
{
 if(
is_user_alive(id))
 {
  
client_cmd(id,"room_delay 0.2")
 }
  else
  {
  
set_task(0.1,"fb_effectisstopped",id)
  }
}
public 
fb_effectsfade2id )
{
 if(
is_user_alive(id))
 {
  
client_cmd(id,"room_delay 0.1")
 }
  else
  {
  
set_task(0.1,"fb_effectisstopped",id)
  }

public 
fb_effectsfade3id )
{
 if(
is_user_alive(id))
 {
  
client_cmd(id,"room_delay 0.01")
 }
 else
 {
 
set_task(0.1,"fb_effectisstopped",id)
 }
}
public 
fb_effectisstoppedid )
{
 
  
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 
omgivebeenflashbangedid //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_FEARTIMEMAXIMUM_FEARTIME),"fb_fear1",id)
  }
  else if(
bitch[id] == 2)
  {
  
set_task(random_float(MINIMUM_FEARTIMEMAXIMUM_FEARTIME),"fb_fear2",id)
  }
  else if(
bitch[id] == 3)
  {
  
set_task(random_float(MINIMUM_FEARTIMEMAXIMUM_FEARTIME),"fb_fear3",id)
  }
  else
  {
  
set_task(0.1,"fb_effectisstopped",id)
  }
 }
 
//return FMRES_IGNORED
}
public 
flashstunn_unblockedid )
{
 
g_fbomfg[id]=//hey i want to be stunned again :)
}
 
public 
fb_fear1id )
{
 
emit_sound(idCHAN_AUTO"voi/pomocy.wav"1.0ATTN_NORM0PITCH_NORM)
 
}
public 
fb_fear2id )
{
 
emit_sound(idCHAN_AUTO"voi/okurwa.wav"1.0ATTN_NORM0PITCH_NORM)
 
}
public 
fb_fear3id )
{
 
emit_sound(idCHAN_AUTO"voi/jamuzaraz.wav"1.0ATTN_NORM0PITCH_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)
 
//} 
__________________

80.52.244.150:27016
sQn is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode