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

Burst/Silencer Blocker


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management        Approver:   Hawk552 (427)
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-06-2009 , 09:35   Burst/Silencer Blocker
Reply With Quote #1

Hi, well here is my RLY first plugin...

Description:

With this plugin you can block the Burst Fire (that GLOCK18 and FAMAS have) and Silencer too (that USP and M4A1 have). Some ppl ask me... "why i want to block silencer or burst fire", well... i dont know but why i want to block a command like KILL? (like others plugins)... Some ppl need that for some MODS... this is the same... maybe you have a mod that for some reasons you want to block the silencer and/or the burst fire... so this plugin is for this.

Commands:
  • !silencer: Show in chat if the silencer is blocked (in wich weapon is blocked too).
  • /silencer: Show in chat if the silencer is blocked (in wich weapon is blocked too).
  • !burst: Show in chat if the burst fire is blocked (in wich weapon is blocked too).
  • /burst: Show in chat if the burst fire is blocked (in wich weapon is blocked too).
Cvars:
  • block_burst (Default: 0)
    • 0: Dont block the burst fire in any weapon.
    • 1: Block the burst fire only in GLOCK18.
    • 2: Block the burst fire only in FAMAS.
    • 3: Block the burst fire in two weapons.
  • block_sil (Default: 0)
    • 0: Dont block the silencer in any weapon.
    • 1: Block the silencer only in USP.
    • 2: Block the silencer only in M4A1.
    • 3: Block the silencer in two weapons.
  • fade_enable (Default: 0)
    • 0: Disable Screen Fade.
    • 1: Enable Screen Fade.
  • fade_burstcolor (Default: "255 0 0")
    • Color of the Screen Fade when the burst fire is blocked.
  • fade_silcolor (Default: "0 255 255")
    • Color of the Screen Fade when the silencer is blocked.
  • fade_alpha (Default: "20")
    • The transparency amount of the Screen Fade.
Credits:

Exolent[jNr] - +attack2 detection
crazyeffect - ML

Changelog:
  • Version 1.0
    • First Release.
  • Version 1.1
    • Added ML.
    • Added chat color.
    • Added ScreenFade (with cvars).
Multilingual:

Quote:
[EN] - Alucard^
[ES] - Alucard^
[NL] - crazyeffect
[PL] - MmikiM
[FR] - die-demoneye
[DE] - D o o m
[SV] - Afro-Ankan
[RO] - benn1907
[LT] - Kukulis :*
Image

Multilingual Thread: http://forums.alliedmods.net/showthread.php?t=99528

Sry for my english.
Attached Files
File Type: sma Get Plugin or Get Source (Burst&Silencer_Blocker.sma - 2498 views - 5.2 KB)
File Type: txt b&s_blocker.txt (3.9 KB, 613 views)

Last edited by Alucard^; 08-12-2009 at 01:16.
Alucard^ is offline
Send a message via Skype™ to Alucard^
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-06-2009 , 09:43   Re: Burst/Silencer Blocker
Reply With Quote #2

A lot more efficient way would be to use the weapon offset m_flNextSecondaryAttack so you would not need FM_CmdStart. If you don't know how, tell me.
__________________

Last edited by Arkshine; 08-06-2009 at 12:18.
Arkshine is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-06-2009 , 11:53   Re: Burst/Silencer Blocker
Reply With Quote #3

Cool
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-06-2009 , 13:27   Re: Burst/Silencer Blocker
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
A lot more efficient way would be to use the weapon offset m_flNextSecondaryAttack so you would not need FM_CmdStart. If you don't know how, tell me.
Well... i tried with a code that you posted:

PHP Code:
#include <hamsandwich>
#include <fakemeta>

const m_flNextSecondaryAttack 47

new p_BlockSil

public plugin_init() 
{
    
register_plugin"Block M4A1 Secondary Attack""1.0""Amxx Community" )
    
    
p_BlockSil register_cvar("block_sil""0")
    
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_m4a1" "Event_BlockSecondaryAttack" )
    
RegisterHamHam_Item_Deploy "weapon_m4a1" "Event_BlockSecondaryAttack")
}

public 
Event_BlockSecondaryAttack ( const Entity )
{
    if(!
get_pcvar_num(p_BlockSil) )
        return 
HAM_SUPERCEDE
    set_pdata_float
Entity m_flNextSecondaryAttack 9999.0)
    return 
HAM_IGNORED

But this code have some bugs... for example...

1: block_sil 0 default (i can use +attack2, good)
2: change block_sil to 1 (i have to change to another weapon and then come back to M4A1 to block the +attack2 command)
3: now if i go back to block_sil 0 (i have to do sv_restart to unblock the +attack2 in M4A1)

----------------------------

Update

Quote:
  • Version 1.1
    • Added ML.
    • Added chat color.
    • Added ScreenFade (with cvars).
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2009 , 13:36   Re: Burst/Silencer Blocker
Reply With Quote #5

Quote:
Originally Posted by Alucard^ View Post
But this code have some bugs... for example...

1: block_sil 0 default (i can use +attack2, good)
2: change block_sil to 1 (i have to change to another weapon and then come back to M4A1 to block the +attack2 command)
3: now if i go back to block_sil 0 (i have to do sv_restart to unblock the +attack2 in M4A1)
Or, you could also just cache the value every round in a global variable so that these bugs don't occur and so that it is a little less cpu intensive.
Besides, how often is an admin going to change the value of these cvars?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-06-2009 , 13:55   Re: Burst/Silencer Blocker
Reply With Quote #6

There is also the solution to use a command to act like a cvar, so if a new value is given you could update right away.
__________________
Arkshine is offline
MmikiM
Senior Member
Join Date: Nov 2006
Location: Poland
Old 08-06-2009 , 14:12   Re: Burst/Silencer Blocker
Reply With Quote #7

Code:
[pl]
BF_NOT_BLOCKED = Tryb strzelania seria nie jest zablokowany.
BF_BLOCKED_FOR = Tryb strzelania seria jest zablokowany tylko dla %s.
BF_BLOCKED_BOTH = Tryb strzelania seria jest zablokowany dla %s i %s.
S_NOT_BLOCKED = Tlumik nie jest zablokowany.
S_BLOCKED_FOR = Tlumik jest zablokowany tylko dla %s.
S_BLOCKED_BOTH = Tlumik jest zablokowany dla %s i %s.
BF_YOUR_WEAPON = Tryb strzelania seria jest zablokowany dla borni, ktora masz.
S_YOUR_WEAPON = Tlumik jest zablokowany dla broni, ktora masz.
Polish translate
__________________


Projects:
Zombie Elite - Technical: 100% Looking for models and sounds...
CS:Source Zombie -
Work in progress...
MmikiM is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-06-2009 , 15:29   Re: Burst/Silencer Blocker
Reply With Quote #8

*Credits added.
*ML Thread added
*PL translate added

Quote:
Originally Posted by Exolent[jNr] View Post
Or, you could also just cache the value every round in a global variable so that these bugs don't occur and so that it is a little less cpu intensive.
Thx, i have to see that.

Quote:
Originally Posted by Exolent[jNr] View Post
Besides, how often is an admin going to change the value of these cvars?
Yes i know but i think if i can fix all bugs, is better =p

Quote:
Originally Posted by Arkshine View Post
There is also the solution to use a command to act like a cvar, so if a new value is given you could update right away.
Sry but i didnt understand at all, can you give me an example?
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2009 , 15:34   Re: Burst/Silencer Blocker
Reply With Quote #9

It's basically my method with a global variable, except the you use commands instead of cvars, so you know when the value is changed, so then you could update the value for other players weapons.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Kukulis :*
Member
Join Date: Apr 2009
Location: www.godlike.lt
Old 08-08-2009 , 08:44   Re: Burst/Silencer Blocker
Reply With Quote #10

Lithuanian
Code:
[lt]
BF_NOT_BLOCKED = Sprogimo ugnis nera blokuota.
BF_BLOCKED_FOR = Sprogimo ugnis yra blokuota tik %s.
BF_BLOCKED_BOTH = Sprogimo ugnis yra blokuota tik %s ir %s.
S_NOT_BLOCKED = Slopintuvas nera blokuotas.
S_BLOCKED_FOR = Slopintuvas yra blokuota tik %s.
S_BLOCKED_BOTH = Slopintuvas yra blokuota tik %s ir %s.
BF_YOUR_WEAPON = Sprogimo ugnis yra blokuota ginklui, kuri jus turite.
S_YOUR_WEAPON = Slopintuvas yra blokuotas ginklui, kuri jus turite.
Kukulis :* is offline
Send a message via Skype™ to Kukulis :*
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 18:28.


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