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

No touch/pressure breakables


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   Exolent[jNr] (178)
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 01-22-2010 , 07:39   No touch/pressure breakables
Reply With Quote #1

Description:

This plugin removes/makes solid breakables which have "Touch" or "Stand on pressure" flags. This plugin could be used on deathrun maps. I always hated dr maps which had these breakables, because it is hard to remeber where they are.

Cvars:

ntpb_mode (default: 2)
  • 0: plugin disabled
  • 1: makes those entities solid
  • 2: removes them
Notes:

Engine module required

Change log:

Code:

1.1:
- Code optimizations
1.0:
- Public release

Attached Files
File Type: sma Get Plugin or Get Source (ntpb.sma - 1709 views - 961 Bytes)

Last edited by BeasT; 04-28-2010 at 07:52. Reason: fix
BeasT is offline
Send a message via Skype™ to BeasT
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 01-22-2010 , 07:54   Re: No touch/pressure breakables
Reply With Quote #2

PHP Code:
public plugin_cfg()
{
    new 
mode get_pcvar_num(cvar_mode)
    
    if(!
mode)
        return
    
    new 
ent = -1flags
    
    
while((ent find_ent_by_class(ent"func_breakable"))) 
    {
        
flags entity_get_int(entEV_INT_spawnflags)
        
        switch(
mode)
        {    
            case 
1// make it solid
            
{
                if(
flags SF_BREAK_PRESSURE)
                    
entity_set_int(entEV_INT_spawnflags, ~SF_BREAK_PRESSURE)
                else if(
flags SF_BREAK_TOUCH)
                    
entity_set_int(entEV_INT_spawnflags, ~SF_BREAK_TOUCH)
            }
            case 
2// remove it
            
{
                if(
flags SF_BREAK_PRESSURE || flags SF_BREAK_TOUCH)
                    
remove_entity(ent)
            }
        }
    }

The cvar won't change.

Good idea otherwise. Could be useful to some.
__________________
In Flames we trust!
Nextra is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 01-22-2010 , 08:04   Re: No touch/pressure breakables
Reply With Quote #3

Thanks. Fixed.
BeasT is offline
Send a message via Skype™ to BeasT
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-22-2010 , 08:33   Re: No touch/pressure breakables
Reply With Quote #4

For safety I would check if entity is valid before. It doesn't hurt. And about the last check, more a user's preference you can do flags & ( SF_BREAK_PRESSURE | SF_BREAK_TOUCH ).
__________________
Arkshine is offline
BeasT
Senior Member
Join Date: Apr 2007
Location: Lithuania
Old 01-22-2010 , 10:14   Re: No touch/pressure breakables
Reply With Quote #5

Thank you for your notes. Updated.
BeasT is offline
Send a message via Skype™ to BeasT
andrept4
Senior Member
Join Date: Dec 2012
Location: Portugal
Old 09-19-2014 , 14:08   Re: No touch/pressure breakables
Reply With Quote #6

lol why do you think they built a map with that breakeables?
__________________
andrept4 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 13:01.


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