Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Explode entity ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-04-2017 , 17:47   Re: [ H3LP ] Explode entity ?
Reply With Quote #9

From my box plugin, this is what you are looking for...

PHP Code:
public fw_HamKilled(entattackershouldgib)
{
    
// Entity not valid?
    
if(!pev_valid(ent)) return HAM_IGNORED
    
    
// Search for our entity
    
static szClass[32]
    
entity_get_classname(ent,szClass)
    
    
// Not our entity?
    
if(!equal(szClassCLASSNAME_BOX)) return HAM_IGNORED
    
    
// Entity destroy sound
    
emit_sound(entCHAN_AUTOsound_crate_destroy1.00.30PITCH_NORM)
    
    
// Get entity origin
    
new Float:origin[3]
    
entity_get_vector(entEV_VEC_originorigin)
    
    new 
stage entity_get_int(entEV_INT_iuser3)
    
    if(
stage)
    {
        
// Metal shatter
        
engfunc(EngFunc_MessageBegin,MSG_PVS,SVC_TEMPENTITY,origin,0);
        
write_byte(TE_BREAKMODEL);
        
engfunc(EngFunc_WriteCoordorigin[0]);
        
engfunc(EngFunc_WriteCoordorigin[1]);
        
engfunc(EngFunc_WriteCoordorigin[2]);
        
write_coord(16);
        
write_coord(16);
        
write_coord(16);
        
write_coord(random_num(-25,25));
        
write_coord(random_num(-25,25));
        
write_coord(25);
        
write_byte(10);
        
write_short(g_gibs_1);
        
write_byte(5);
        
write_byte(5);
        
write_byte(2);
        
message_end();
    }    
    else
    {
        
// Glass shatter
        
engfunc(EngFunc_MessageBegin,MSG_PVS,SVC_TEMPENTITY,origin,0);
        
write_byte(TE_BREAKMODEL);
        
engfunc(EngFunc_WriteCoordorigin[0]);
        
engfunc(EngFunc_WriteCoordorigin[1]);
        
engfunc(EngFunc_WriteCoordorigin[2]);
        
write_coord(16);
        
write_coord(16);
        
write_coord(16);
        
write_coord(random_num(-50,50));
        
write_coord(random_num(-50,50));
        
write_coord(25);
        
write_byte(10);
        
write_short(g_gibs_2);
        
write_byte(5);
        
write_byte(5);
        
write_byte(0);
        
message_end();        
    }
    
    
Entity_Gravity()
    
    return 
HAM_IGNORED

__________________

Last edited by Depresie; 04-04-2017 at 17:50.
Depresie is offline
 



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 17:51.


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