|
测试服务器地址:
221.204.251.178:27015 - 27018
密码: bisai
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- new const gs_PLUGIN[] = "Anti-Silent Plant"
- new const gs_VERSION[] = "1.6"
- new const gs_AUTHOR[] = "eSport.sX.cn"
- new gs_c4_model[] = "models/w_c4.mdl"
- new bool: gb_CheckSound
- new bool: gb_EntReadyForUse
- new bool: gb_OriginChanged
- new Float: gf_volume
- new Float: gf_attenuation
- new Float: gf_c4origin[3]
- new Float: gf_entorigin[3]
- new gi_flags
- new gi_pitch
- new g_c4entity
- new g_entillusionary
- new g_classname
- new gi_soundnum
- new g_sounds[5][] =
- {
- "weapons/c4_beep1.wav",
- "weapons/c4_beep2.wav",
- "weapons/c4_beep3.wav",
- "weapons/c4_beep4.wav",
- "weapons/c4_beep5.wav"
- }
- public plugin_init ()
- {
- register_plugin ( gs_PLUGIN, gs_VERSION, gs_AUTHOR )
- register_cvar ( "antisilentplant_version", gs_VERSION, FCVAR_SERVER|FCVAR_SPONLY )
-
- if ( engfunc ( EngFunc_FindEntityByString, -1, "classname", "func_bomb_target" ) )
- {
- register_logevent ( "fn_triggerplanted" , 3, "1=triggered", "2=Planted_The_Bomb" )
- register_logevent ( "fn_triggerroundstart" , 2, "1=Round_Start" )
- register_forward ( FM_EmitSound, "fn_soundcheck" )
- }
-
- gb_EntReadyForUse = false
- }
- public fn_triggerplanted ()
- {
- gb_CheckSound = true
- }
- public fn_triggerroundstart ()
- {
- gb_CheckSound = false
- gb_OriginChanged = false
- }
- public fn_soundcheck ( entity, i_channel, const s_SOUND[], Float: f_volume, Float: f_attenuation, i_flags, i_pitch )
- {
- if ( gb_CheckSound == true )
- {
- for ( gi_soundnum = 0; gi_soundnum < 5; gi_soundnum++ )
- {
- if ( equali ( s_SOUND, g_sounds[gi_soundnum] ) )
- {
- gf_volume = f_volume
- gf_attenuation = f_attenuation
- gi_flags = i_flags
- gi_pitch = i_pitch
-
- if ( gb_EntReadyForUse == true && gb_OriginChanged == true )
- {
- fn_emitsound ()
-
- return FMRES_SUPERCEDE
- }
-
- else if ( gb_EntReadyForUse == true && ! gb_OriginChanged == true )
- {
- fn_changeorigin ()
-
- return FMRES_SUPERCEDE
- }
-
- else
- {
- fn_createentity ()
-
- return FMRES_SUPERCEDE
- }
- }
- }
- }
-
- return FMRES_IGNORED
- }
- public fn_createentity ()
- {
- g_classname = engfunc ( EngFunc_AllocString, "func_illusionary" )
- g_entillusionary = engfunc ( EngFunc_CreateNamedEntity, g_classname )
-
- gb_EntReadyForUse = true
-
- fn_changeorigin ()
- }
- public fn_changeorigin ()
- {
- g_c4entity = engfunc ( EngFunc_FindEntityByString, -1, "model", gs_c4_model )
- pev ( g_c4entity, pev_origin, gf_c4origin )
- gf_entorigin = gf_c4origin
- engfunc ( EngFunc_SetOrigin, g_entillusionary, gf_entorigin )
-
- gb_OriginChanged = true
-
- fn_emitsound ()
- }
- public fn_emitsound ()
- {
- emit_sound ( g_entillusionary, 0, g_sounds[gi_soundnum], gf_volume, gf_attenuation, gi_flags, gi_pitch )
- }
复制代码
[color="Red"]//改了改标题 |
|