AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to make a smoke grenade explode ? (https://forums.alliedmods.net/showthread.php?t=63004)

ConnorMcLeod 11-09-2007 11:43

How to make a smoke grenade explode ?
 
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.

[ --<-@ ] Black Rose 11-09-2007 11:50

Re: How to make a smoke grenade explode ?
 
Explode when/why?
No information given at all.

ConnorMcLeod 11-09-2007 11:52

Re: How to make a smoke grenade explode ?
 
Just when i want...before it should explode.

[ --<-@ ] Black Rose 11-09-2007 12:05

Re: How to make a smoke grenade explode ?
 
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     } }

ConnorMcLeod 11-09-2007 12:22

Re: How to make a smoke grenade explode ?
 
Quote:

Originally Posted by [ --<-@ ] Black Rose (Post 551166)
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 }


All times are GMT -4. The time now is 01:12.

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