Raised This Month: $51 Target: $400
 12% 

Block rotating door when it's touched by a Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 11-23-2009 , 11:06   Block rotating door when it's touched by a Weapon
Reply With Quote #1

Description:

Simple plugin but usefull sometimes, for example if you have something like a Realism Mode Server. Or if you want to change some things in the gameplay.

This plugin control the rotating of the door if is touched by a weapon, so you can block the door opens/closes.

Notes:

I tested only in Counter-Strike, i don't know nothing about other mods so you need to tell me if "Modification: All" must be changed.

Also, if you have a suggestion for this plugin, ofcourse you are welcome.

Requirements:
Code:
#include <amxmodx> // lol? #include <engine> // Engine Module

Cvars:
  • bt_enable (Default: 1)
    • 0: Plugin disabled.
    • 1: Plugin enabled.
  • bt_adm_inm (Default: 0)
    • 0: The block is for all players (including admins).
    • 1: The block is for all players that are not admins.
    • ADMIN_SLAY flag for default, you can change it in the .sma
  • bt_<WeaponName> (Default: 1)
    • 0: When the weapon touch the door, the door opens/closes like normal.
    • 1: Block the rotation of the door when is touched by the weapon.
    • Example of usage: bt_scout 0 or 1.

Credits:

Note: Some methods of credits help, i am not using its anymore, but i leave the credits, becouse they helped me.

Changelog:

Code:
//  Changelog: // //      0.0.1    » First Release // // //      0.0.5    » Name of the plugin changed to "Block touch betwen doors & weapons" //               » Now the plugin detect all weapons, not only grenades //               » Name of cvars changed to bt_<wpnname> //               » Removed Fakemeta module requirement //               » Added admin inmunity (configurable by cvar) //               » Grenade detection changed // // //      0.0.6    » WeaponsName global moved to plugin_init( ) //               » if( ) else if( ) -> if( ) else( ) //               » bt_adm_inm cvar changed to bt_adm_imn //               » Thanks to xPaw in this version //
Attached Files
File Type: sma Get Plugin or Get Source (BlockTouchByWeapon.sma - 710 views - 5.2 KB)
__________________
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...

Last edited by Alucard^; 06-18-2010 at 20:09. Reason: Updated to v0.0.5
Alucard^ is offline
Send a message via Skype™ to Alucard^
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-23-2009 , 11:22   Re: Block rotating door when is touched by grenades
Reply With Quote #2

tested under linux? the linux diff. should be 4 for weapons, so try to put 4 in get_pdata_int..
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2009 , 11:41   Re: Block rotating door when is touched by grenades
Reply With Quote #3

Suggestion:
Add support for dropping weapons into the door as well.
__________________
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 11-23-2009 , 11:45   Re: Block rotating door when is touched by grenades
Reply With Quote #4

Quote:
Originally Posted by xPaw View Post
tested under linux? the linux diff. should be 4 for weapons, so try to put 4 in get_pdata_int..
+5 for this offset it seems.
__________________
Arkshine is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 11-23-2009 , 12:10   Re: Block rotating door when is touched by grenades
Reply With Quote #5

Good job alucard =D
__________________
Javivi is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 11-23-2009 , 12:16   Re: Block rotating door when is touched by grenades
Reply With Quote #6

Why dont you let the door explode when its touched by a he grenade :p?
__________________
I am out of order!
grimvh2 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 11-23-2009 , 17:09   Re: Block rotating door when is touched by grenades
Reply With Quote #7

@ grimvh2

Becouse... http://forums.alliedmods.net/showthread.php?p=62410

@ Exolent

The doors opens/closes when are touched by weapons? didn't know that, i have to test it. Thx for the suggestion.
__________________
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^
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 11-23-2009 , 17:38   Re: Block rotating door when is touched by grenades
Reply With Quote #8

Yes they do open when touched by any weapon. I'd even say they will open when any ent touches them.
__________________
In Flames we trust!
Nextra is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-23-2009 , 17:48   Re: Block rotating door when is touched by grenades
Reply With Quote #9

Weird, because in HLSDK in DoorTouch(), there is a check to ignore if not a player :

Code:
    // Ignore touches by anything but players     if (!FClassnameIs(pevToucher, "player"))         return;

The check is probably removed in CS so.
__________________
Arkshine is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 11-25-2009 , 14:55   Re: Block rotating door when is touched by grenades
Reply With Quote #10

Quote:
Originally Posted by Arkshine View Post
Weird, because in HLSDK in DoorTouch(), there is a check to ignore if not a player :

Code:
&nbsp;&nbsp;&nbsp;&nbsp;// Ignore touches by anything but players &nbsp;&nbsp;&nbsp;&nbsp;if (!FClassnameIs(pevToucher, "player")) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;return;


The check is probably removed in CS so.
Ja, totally correct

Only rotating doors on Players:

PHP Code:
#include <amxmodx>
#include <engine>

public pfn_touch(tchertched)
{
    static 
szClassTemp[33]
    
entity_get_string(tcherEV_SZ_classnameszClassTempcharsmax(szClassTemp))
    
    if(
equal(szClassTemp"func_door_rotating"))
    {
        
entity_get_string(tchedEV_SZ_classnameszClassTempcharsmax(szClassTemp))
        
        if(!
equal(szClassTemp"player"))
            return 
PLUGIN_HANDLED
    
}
        
    return 
PLUGIN_CONTINUE

18 Lines,
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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 05:46.


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