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

TE_EXPLODEMODEL & TE_BREAKMODEL


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 09-15-2010 , 16:30   TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #1

Could anyone provide a working example of this messages ?
__________________
Voi is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-15-2010 , 17:05   Re: TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #2

You can take a look at Frost Nades for TE_BREAKMODEL, anyway here is the code:
PHP Code:
        // add the shatter
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
        
write_byte(108); // TE_BREAKMODEL
        
write_coord(origin[0]); // x
        
write_coord(origin[1]); // y
        
write_coord(origin[2] + 24); // z
        
write_coord(16); // size x
        
write_coord(16); // size y
        
write_coord(16); // size z
        
write_coord(random_num(-50,50)); // velocity x
        
write_coord(random_num(-50,50)); // velocity y
        
write_coord(25); // velocity z
        
write_byte(10); // random velocity
        
write_short(glassGibs); // model index that you want to break
        
write_byte(10); // count
        
write_byte(25); // life
        
write_byte(0x01); // flags: BREAK_GLASS
        
message_end(); 
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 09-15-2010 , 17:36   Re: TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #3

Thanks

If someone would need to know what settings to use with flags i post here a part of fgd file:
Quote:
material(choices) :"Material type" : "" =
[
//* <b>Gibs:</b> models/glassgibs.mdl
//* <b>Break noise:</b> debris/bustglassX.wav
//* <b>Bounce noise:</b> debris/glassX.wav
"": "Glass"
//* <b>Gibs:</b> models/woodgibs.mdl
//* <b>Break noise:</b> debris/bustcrateX.wav
//* <b>Bounce noise:</b> debris/woodX.wav
1: "Wood"
//* <b>Gibs:</b> models/metalplategibs.mdl
//* <b>Break noise:</b> debris/bustmetalX.wav
//* <b>Bounce noise:</b> debris/metalX.wav
2: "Metal"
//* <b>Gibs:</b> models/fleshgibs.mdl
//* <b>Break noise:</b> debris/bustfleshX.wav
//* <b>Bounce noise:</b> debris/fleshX.wav
3: "Flesh"
//* <b>Gibs:</b> models/cindergibs.mdl
//* <b>Break noise:</b> debris/bustconcreteX.wav
//* <b>Bounce noise:</b> debris/concreteX.wav
4: "Cinder Block"
//* <b>Gibs:</b> models/ceilinggibs.mdl
//* <b>Break noise:</b> debris/bustceilingX.wav
//* <b>Bounce noise:</b> none
5: "Ceiling Tile"
//* <b>Gibs:</b> models/computergibs.mdl
//* <b>Break noise:</b> debris/bustmetalX.wav
//* <b>Bounce noise:</b> debris/woodX.wav
//* <b>Note:</b> Generates sparks when damaged.
6: "Computer"
//* <b>Gibs:</b> models/glassgibs.mdl
//* <b>Break noise:</b> debris/bustglassX.wav
//* <b>Bounce noise:</b> debris/glassX.wav
//* <b>Note:</b> Makes ricochet noises when damaged.
7: "Unbreakable Glass"
//* <b>Gibs:</b> models/rockgibs.mdl
//* <b>Break noise:</b> debris/bustconcreteX.wav
//* <b>Bounce noise:</b> debris/concreteX.wav
8: "Rocks"
]
So for example flag for rocks will be: write_byte(0x08)
__________________
Voi is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-15-2010 , 20:33   Re: TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #4

http://www.twhl.co.za/wiki.php?id=164
__________________
Arkshine is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-18-2021 , 07:11   Re: TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #5

https://www.amxmodx.org/api/message_...picks-from-set is wrong. It is putting in 3 velocity coordinates when there is only one.
Code:
#if defined(DEBUG)     server_print("TE_EXPLODEMODEL NEW") #endif         #define TE_EXPLODEMODEL             107         message_begin(MSG_BROADCAST, SVC_TEMPENTITY,{0,0,0},0);         write_byte(TE_EXPLODEMODEL)         write_coord(floatround(Origin[0]+random_float(-11.0,11.0)))     // XYZ (start)         write_coord(floatround(Origin[1]-random_float(-11.0,11.0)))         write_coord(floatround(Origin[2]+random_float(1.0,75.0)))         write_coord(random_num(-1500,10000))                            // velocity         switch(random_num(0,6))         {             case 0: write_short(g_Wtf0)                                 //(model index)             case 1: write_short(g_Wtf1)             case 2: write_short(g_Wtf2)             case 3: write_short(g_Wtf3)             case 4: write_short(g_Wtf4)             case 5: write_short(g_Wtf5)             case 6: write_short(g_Wtf6)         }         write_short(random_num(10,200))                                 //(count)         write_byte(random_num(20,1000))                                 //(life in 0.1's)         message_end()


Other sources:
__________________
DJEarthQuake is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-18-2021 , 07:25   Re: TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #6

Velocity can not be a single number. Why do you think the description is wrong?
__________________

Last edited by HamletEagle; 09-18-2021 at 07:25.
HamletEagle is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-18-2021 , 09:02   Re: TE_EXPLODEMODEL & TE_BREAKMODEL
Reply With Quote #7

It is the "Ejection speed for all models". The directions are defined on the 3 coordinates beforehand.
__________________
DJEarthQuake 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 03:40.


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