Raised This Month: $ Target: $400
 0% 

Grenades...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-13-2013 , 19:50   Grenades...
Reply With Quote #1

Hi
I have 3 questions. It might be request but if tell me how with good examples i think is enough

First: (all nades)
- Making the grenades doesnt change target. I mean it goes in aim direction, doesnt goes higher or fall.

Second:
- Make HE grenade explode (normal explosion) 1 second after touch something (players or walls) and also make it glowing red when is on air (till the explosion)

Third:
- Making Flashbang do damage defined with cvar/define
__________________
Jhob94 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 09-14-2013 , 00:52   Re: Grenades...
Reply With Quote #2

1) Change it's velocity and remove it's gravity.

2) Register touch, use set_rendering(), and then set pev_dmgtime to 0.0 or use CGrenade::Detonate3() with Orpheu.

3) Register ScreenFade message.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 09-15-2013 at 08:48.
hornet is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 09-14-2013 , 03:09   Re: Grenades...
Reply With Quote #3

i did some tests on this and ended up with having this
PHP Code:
#include <amxmodx>
#include <csx>
#include <engine>
#include <fakemeta>

public plugin_init()
{
    
register_touch("*""grenade""fw_GrenadeTouch")
}

public 
grenade_throw(idiEntwId)
{
    if(
wId != CSW_HEGRENADE)
    {
        return;
    }
    
    new 
Float:flNewVelocity[3]
    
velocity_by_aim(id500flNewVelocity)
    
entity_set_vector(iEntEV_VEC_velocityflNewVelocity)
    
    
//entity_set_float(iEnt, EV_FL_gravity, 0.0)
    
entity_set_int(iEntEV_INT_movetypeMOVETYPE_FLY)
    
    
// Working but not as it should be ..
    //new Float:flVelocity[3]
    //entity_get_vector(iEnt, EV_VEC_velocity, flVelocity)
    //flVelocity[2] = 0.0
    //entity_set_vector(iEnt, EV_VEC_velocity, flVelocity)
    
    
    
entity_set_float(iEntEV_FL_dmgtime9999.0)
    
    
set_rendering(iEntkRenderFxGlowShell25500kRenderNormal16)
}

public 
fw_GrenadeTouch(iTouchedEntiGrenade)
{
    if(!
IsGrenade(iGrenade))
    {
        return;
    }

    if( 
entity_get_int(iTouchedEntEV_INT_solid) == SOLID_TRIGGER )
    {
        return;
    }
    
    
set_rendering(iGrenade)
    
entity_set_float(iGrenadeEV_FL_dmgtime1.0)
}

IsGrenadeiEnt // VEN
{
    if (
get_pdata_int(iEnt114) & (1<<0))
    {
        return 
1
    
}
    
    return 
0

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster 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 18:46.


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