Raised This Month: $32 Target: $400
 8% 

[L4D & L4D2] Headshot Reward / Sounds v1.1 [5-December-22]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Plugin ID:
7978
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
gain the buff and play reward sound when you doing headshot
Old 02-26-2022 , 00:33   [L4D & L4D2] Headshot Reward / Sounds v1.1 [5-December-22]
Reply With Quote #1

about
  • make headshot more attractive
  • gain wepaon buff and ding sound when headshot and optional
  • specifies which action can be boost: reloading / firing / deploying / melee swinging
  • specifies speed rate, hurt duration, kill duration, clear duration when switch weapon
  • merges Dingshot feature
  • now all the idea about kill well done i may wont made more, i have to learn more other

ConVar
PHP Code:
// buff actions 1=Firing 2=Deploying 4=Reloading 8=MeleeSwinging
headshot_buff_actions "-1"

// death only, ignore headshot hurt
headshot_buff_death "0"

// Enabled 'Headshot Buff'
headshot_buff_enabled "1"

// buff duration gains of headshot hurt 0:sound only
headshot_buff_gain_hurt "0.3"

// buff duration gains of headshot killed 0:sound only
headshot_buff_gain_kill "0.6"

// keep buff when switch weapon 0:clear 1:keep
headshot_buff_keep "0"

// which sound wanna play for headshot hurt empty:noplay
headshot_buff_sound_hurt "ui/littlereward.wav"

// which sound wanna play for headshot kill empty:noplay
headshot_buff_sound_kill "level/bell_normal.wav"

// buff speed rate 2:double speed
headshot_buff_speed "1.5"

// temp health gives when headshot hurt
headshot_buff_temp_hurt "0.16"

// temp health gives when headshot kill
headshot_buff_temp_kill "0.33"

// which effects show on headshot kill 1=spark 2=incendiary 4=explosive
headshot_buff_effects_kill "4" 

Required / Dependecies

changelog
  • v1.0 just releases; 26-2-22
  • v1.0.1 fix player zombies not works; 28-2-22
  • v1.0.2 fix issue 'wrong param cause buff time sharing between clients'; 6-June-2022
  • v1.0.3 optional *_temp_hurt *_temp_kill to control gives temp hp, prevent trigger on victim survivor; 6-November-2022
  • v1.1 new ConVar *_effects_kill to show headshot particle effects on zombie head,
    regular the code styles,
    delete ConVar *_enabled, if needed just unmount the plugin; 6-December-2022


Installation
Attached Files
File Type: sp Get Plugin or Get Source (l4d_headshot_buff.sp - 514 views - 12.1 KB)
__________________

Last edited by NoroHime; 12-05-2022 at 10:09.
NoroHime is offline
maclarens
Senior Member
Join Date: Jul 2020
Location: Kz
Old 06-05-2022 , 08:58   Re: [L4D & L4D2] Headshot Reward / Sounds <WeaponHandling Add-On> v1.0.1 [26-2-22]
Reply With Quote #2

great plugin but old syntax



Compiling l4d_headshot_buff.sp...
SourcePawn Compiler 1.10.0.6540
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2018 AlliedModders LLC

l4d_headshot_buff.sp(142) : warning 234: symbol "IsValidHandle" is marked as deprecated: Do not use this function.
l4d_headshot_buff.sp(166) : warning 234: symbol "IsValidHandle" is marked as deprecated: Do not use this function.
l4d_headshot_buff.sp(189) : warning 234: symbol "IsValidHandle" is marked as deprecated: Do not use this function.
maclarens is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 06-05-2022 , 13:22   Re: [L4D & L4D2] Headshot Reward / Sounds <WeaponHandling Add-On> v1.0.1 [26-2-22]
Reply With Quote #3

actually IsValidHandle no more deprecated in SM1.11, so no problem to use these
__________________
NoroHime is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-05-2022 , 13:34   Re: [L4D & L4D2] Headshot Reward / Sounds <WeaponHandling Add-On> v1.0.1 [26-2-22]
Reply With Quote #4

You still shouldn't be using it and instead check if the timer handle is null.

Your timers are setup wrong, you're passing "TIMER_REPEAT" as the client index. You should also be setting "timer_buff[client] = null;" in the timer callback and "delete timer_buff[client]" in "OnClientDisconnect".

Use "delete" instead of "KillTimer". You also never set the stored handle back to null here, that's what delete does for you.

As the code currently stands I find it hard to believe it works properly.

As a note for IsValidHandle:
Quote:
* This function is intended only for tests where the validity of a
* Handle can absolutely not be known.
*
* Do not use this to check the return values of functions, or to
* check if timers should be closed (except in very rare cases).
* This function is for very specific usage and using it for general
* purpose routines can and will hide very subtle bugs.
__________________

Last edited by Silvers; 06-05-2022 at 13:37.
Silvers is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 06-06-2022 , 03:38   Re: [L4D & L4D2] Headshot Reward / Sounds <WeaponHandling Add-On> v1.0.1 [26-2-22]
Reply With Quote #5

Quote:
Originally Posted by Silvers View Post
You still shouldn't be using it and instead check if the timer handle is null.

Your timers are setup wrong, you're passing "TIMER_REPEAT" as the client index. You should also be setting "timer_buff[client] = null;" in the timer callback and "delete timer_buff[client]" in "OnClientDisconnect".

Use "delete" instead of "KillTimer". You also never set the stored handle back to null here, that's what delete does for you.

As the code currently stands I find it hard to believe it works properly.

As a note for IsValidHandle:
very thanks, this bug cant found under solo game until check the code

update
Quote:
  • v1.0.2 fix issue 'wrong param cause buff time sharing between clients'; 6-June-2022
  • v1.0.3 optional *_temp_hurt *_temp_kill to control gives temp hp, prevent trigger on victim survivor; 6-November-2022
  • v1.1 new ConVar *_effects_kill to show headshot particle effects on zombie head,
    regular the code styles,
    delete ConVar *_enabled, if needed just unmount the plugin; 6-December-2022

ConVar
PHP Code:
// temp health gives when headshot hurt
headshot_buff_temp_hurt "0.16"

// temp health gives when headshot kill
headshot_buff_temp_kill "0.33"

// which effects show on headshot kill 1=spark 2=incendiary 4=explosive
headshot_buff_effects_kill "4" 
__________________

Last edited by NoroHime; 12-05-2022 at 10:08.
NoroHime is offline
Reply



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:58.


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