AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Replace Func_breakable with Func_wall (https://forums.alliedmods.net/showthread.php?t=223173)

devu4 08-10-2013 13:18

Replace Func_breakable with Func_wall
 
Hello, I am trying to replace a breakable box in a map (jb_oasis) with a unbreakable box. I researched and came up with this from xPaws Deathrun Map fixer. Now I do not know how to replace the entites. The breakable box model = "func_breakable" "*148".

I would be grateful if someone could help me! so What I need is to replace the breakable box with a non-breakable box.

PHP Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>


public plugin_init( ) {
    
register_plugin"Maps Fixer""1.7""xPaw" );
    
    
register_cvar"deathrun_mapsfixer""1.7"FCVAR_SERVER FCVAR_SPONLY );
    
    new 
szMapname32 ];
    
get_mapnameszMapnamecharsmaxszMapname ) );
    
    if( 
equaliszMapname"jb_oasis" ) )
        
FixMap_oasis( );
}

FixMap_oasis( ) {






akcaliberg 08-10-2013 15:48

Re: Replace Func_breakable with Func_wall
 
PHP Code:

set_entities_unbreakable() {
    new 
ent;
    while( (
ent find_ent_by_class(ent"func_breakable")) ) {
        
entity_set_float(entEV_FL_takedamage0.0)
    }



devu4 08-10-2013 18:11

Re: Replace Func_breakable with Func_wall
 
Quote:

Originally Posted by akcaliberg (Post 2010145)
PHP Code:

set_entities_unbreakable() {
    new 
ent;
    while( (
ent find_ent_by_class(ent"func_breakable")) ) {
        
entity_set_float(entEV_FL_takedamage0.0)
    }



this is good, however I want a specific func_breakable to become unbreakable, not all the breakables on map.

akcaliberg 08-10-2013 18:32

Re: Replace Func_breakable with Func_wall
 
How specific ? What's your filter ?

devu4 08-10-2013 18:35

Re: Replace Func_breakable with Func_wall
 
Quote:

Originally Posted by akcaliberg (Post 2010257)
How specific ? What's your filter ?

I want to replace func_breakable *148 only.

bibu 08-10-2013 18:39

Re: Replace Func_breakable with Func_wall
 
PHP Code:

new iEnt

iEnt 
find_ent_by_model(-1"func_breakable""*148"

And then you can dispatch it.

red_bull2oo6 08-11-2013 07:00

Re: Replace Func_breakable with Func_wall
 
i`m sorry i came here.. but i have a doubt too.
what means that "*148" parameter ?

bibu 08-11-2013 12:00

Re: Replace Func_breakable with Func_wall
 
Each map has its own entity model number. With that number, you can simply edit that entity for example.

See here:

http://img.brothersoft.com/screensho...250846517.jpeg

red_bull2oo6 08-11-2013 13:06

Re: Replace Func_breakable with Func_wall
 
thanks that helped a lot!


All times are GMT -4. The time now is 15:47.

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