Raised This Month: $ Target: $400
 0% 

Object Dissapear when Prep. time ends [BB]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
romi
Member
Join Date: Jul 2014
Location: Far Far AwaY From YoU!
Old 09-24-2015 , 05:52   Object Dissapear when Prep. time ends [BB]
Reply With Quote #1

Hello , i have a basebuilder server and i was wondering if you could make a plugin : that when preparation time ends all object that hasn't been moved / locked ddissappear .. tnx
romi is offline
niqo
Senior Member
Join Date: Feb 2010
Location: Argentina
Old 09-24-2015 , 11:21   Re: Object Dissapear when Prep. time ends [BB]
Reply With Quote #2

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

#define PLUGIN    "hideNotUsed"
#define AUTHOR    "DarkGL"
#define VERSION    "1.0"

forward bb_round_started();

new 
pCvarTime ,
    
FloatfAmount    =    255.0 ,
    
FloatfOffset    =    0.0 ;

public 
plugin_init(){
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pCvarTime    =    register_cvar"hideTime" "4.0" );
}

public 
bb_round_started(){
    
    
fAmount    =    255.0;
    
    
fOffset    =    fAmount / ( get_pcvar_floatpCvarTime ) * 10.0 ) ;
    
    
setBlocksfAmount , .reset true );
    
    
set_task0.1 "hideAll" );
}

public 
hideAll(){
    if( 
fAmount <= 0.0 ){
        
        
setBlocksfAmount , .changeOrigin true );
        
        return ;
    }
    
    
fAmount    -=    fOffset;
    
    
setBlocksfAmount );
    
    
set_task0.1 "hideAll" );
}

setBlocksFloatfAmount boolchangeOrigin false boolreset false ){
    
    new 
szTarget16 ] ,
        
iEnt ;
    
    while( ( 
iEnt engfuncEngFunc_FindEntityByString iEnt "classname" "func_wall" ) ) != ){
        
        if( !
pev_validiEnt ) ){
            continue;
        }
        
        
peviEnt pev_targetname szTarget charsmaxszTarget ) );
        
        if( 
equalszTarget "ignore" ) || equalszTarget "barrier" ) || bb_is_used_blockiEnt ) ){
            continue;
        }
        
        if( 
reset ){
            
set_peviEnt pev_rendermode kRenderNormal );
            
set_peviEnt pev_renderamt 255.0 );
        }
        else if( !
changeOrigin ){
            
set_peviEnt pev_rendermode kRenderTransTexture );
            
set_peviEnt pev_renderamt fAmount );
        }
        
        if( 
changeOrigin ){
            
engfuncEngFunc_SetOrigin iEnt , { 9999.0 9999.0 9999.0 } );
        }
        
    }
}

boolbb_is_used_blockiEnt ){
    return 
peviEnt pev_iuser4 ) != 0;

__________________
niqo is offline
romi
Member
Join Date: Jul 2014
Location: Far Far AwaY From YoU!
Old 09-25-2015 , 10:28   Re: Object Dissapear when Prep. time ends [BB]
Reply With Quote #3

TNX MAN ,, Pls Close Topic
romi is offline
Deft
Junior Member
Join Date: Sep 2015
Old 09-25-2015 , 14:54   Re: Object Dissapear when Prep. time ends [BB]
Reply With Quote #4

Someone can replace it to Object dissapear when build time ends?
Deft 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 08:50.


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