Raised This Month: $ Target: $400
 0% 

How to make a smoke grenade explode ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2007 , 11:43   How to make a smoke grenade explode ?
Reply With Quote #1

Hi,

All in the title.

What i've tried :

Code:
        set_pev(ent, pev_movetype, MOVETYPE_STEP)         set_pev(ent, pev_velocity, {0.0,0.0,-200.0})
The nade fall on the ground but then take few seconds to explode (best way i've foung at the moment.)



Code:
        set_pev(ent, pev_velocity, {0.0,0.0,0.0})         engfunc(EngFunc_DropToFloor, ent)
Not better



Code:
dllfunc(DLLFunc_Touch, ent, 0)
Doesn't work

Code:
dllfunc(DLLFunc_Touch, 0, ent)
Doesn't work


P.S.: set_pev(ent, pev_dmgtime, 0.0) just work fine for HE and Flash, but not for smokes.

Last edited by ConnorMcLeod; 11-09-2007 at 11:56.
ConnorMcLeod is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-09-2007 , 11:50   Re: How to make a smoke grenade explode ?
Reply With Quote #2

Explode when/why?
No information given at all.
[ --<-@ ] Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2007 , 11:52   Re: How to make a smoke grenade explode ?
Reply With Quote #3

Just when i want...before it should explode.
ConnorMcLeod is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-09-2007 , 12:05   Re: How to make a smoke grenade explode ?
Reply With Quote #4

You wanna catch the explosion or make it explode on command?
Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_forward(FM_EmitSound, "fw_EmitSound"); } public fw_EmitSound(ent, channel, sample[]) {         if ( equal(sample[8], "sg_explode", 10) ) {                 new model[32];         pev(ent, pev_model, model, 31);                 if ( equal(model[9], "w_smokegrenade.mdl") )             // BOOM     } }

Last edited by [ --<-@ ] Black Rose; 11-09-2007 at 12:10.
[ --<-@ ] Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2007 , 12:22   Re: How to make a smoke grenade explode ?
Reply With Quote #5

Quote:
Originally Posted by [ --<-@ ] Black Rose View Post
make it explode on command
Something like that.
Just make it explode as fast as possible.
I just rewrite the grenade realism plugin and i'm just stuck on the smoke grenade :

Code:
public fwdSetModel(ent, model[]) {     if(!g_explode_enable)         return FMRES_IGNORED     static classname[8]     pev(ent, pev_classname, classname, charsmax(classname))     if (!equal(classname, "grenade"))         return FMRES_IGNORED     if (get_pdata_int(ent, 96) & (1<<8))         return FMRES_IGNORED     static owner     owner = pev(ent, pev_owner)     if(!owner)         return FMRES_IGNORED     if(!g_explode[owner])         return FMRES_IGNORED     static bits     bits = get_pdata_int(ent, 114)     if(!bits || bits & (1<<0))     {         static Float:velocity[3]         pev(owner, pev_velocity, velocity)         set_pev(ent, pev_velocity, velocity)         set_pev(ent, pev_dmgtime, 0.0)     }     else if(bits & (1<<1))   // SmokeGrenade Here     {         set_pev(ent, pev_movetype, MOVETYPE_STEP)         set_pev(ent, pev_velocity, {0.0,0.0,-100.0})     }     return FMRES_HANDLED }
ConnorMcLeod is offline
Old 11-09-2007, 16:31
Greenberet
This message has been deleted by Greenberet.
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 01:12.


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