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

changing a grenades velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
icetea
BANNED
Join Date: Sep 2008
Old 10-02-2008 , 20:02   changing a grenades velocity
Reply With Quote #1

anyone know how to change the speed of a thrown grenade?
icetea is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-02-2008 , 21:11   Re: changing a grenades velocity
Reply With Quote #2

I've tried, and I haven't found any solution for changing the actual grenade's velocity.
However, I was able to recreate a grenade in the same path, and make it go where I wanted.
I had to make the real grenade SOLID_NOT, and invisible.
Then, when the grenade was about to explode, I set it's origin where the fake one is at, then deleted the fake entity.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 10-02-2008 , 21:17   Re: changing a grenades velocity
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
I've tried, and I haven't found any solution for changing the actual grenade's velocity.
However, I was able to recreate a grenade in the same path, and make it go where I wanted.
I had to make the real grenade SOLID_NOT, and invisible.
Then, when the grenade was about to explode, I set it's origin where the fake one is at, then deleted the fake entity.
pev_velocity was no good?
Prajch is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-02-2008 , 21:22   Re: changing a grenades velocity
Reply With Quote #4

No, it wasn't.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 10-02-2008 , 23:01   Re: changing a grenades velocity
Reply With Quote #5

it is work fine for me.try this.
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <csx> #define PLUGIN_NAME "change grenade speed" #define PLUGIN_VERSION  "1.0" #define PLUGIN_AUTHOR   "zwfgdlc" public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR); } public grenade_throw(id,greindex,wid) {     new Float:vel[3]     velocity_by_aim(id,1800,vel);     set_pev(greindex,pev_velocity,vel); }

Last edited by zwfgdlc; 10-02-2008 at 23:10.
zwfgdlc is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 10-02-2008 , 23:15   Re: changing a grenades velocity
Reply With Quote #6

Tested and works...

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "Nade Velocity"
#define VERSION    "1.0"
#define AUTHOR    "hlstriker"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_forward(FM_SetModel"fwd_SetModel");
}

public 
fwd_SetModel(iEnt, const szModel[])
{
    
// Check to see if a he grenade model was set...
    
if(equal(szModel"models/w_hegrenade.mdl"))
    {
        
// The model is also set as soon as you buy a grenade, but has no owner yet.
        // So check to see if the nade as an owner and continue...
        
if(pev(iEntpev_owner) > 0)
        {
            static 
Float:flVelocity[3];
            
pev(iEntpev_velocityflVelocity);
            
flVelocity[0] *= 2.5;
            
flVelocity[1] *= 2.5;
            
flVelocity[2] *= 2.5;
            
set_pev(iEntpev_velocityflVelocity);
        }
    }

hlstriker is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 10-03-2008 , 13:13   Re: changing a grenades velocity
Reply With Quote #7

Quote:
flVelocity[0] *= 2.5;
Yes, and 2.5 is maximal really workong value ;)

btw. real funny efect
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 10-04-2008 , 03:53   Re: changing a grenades velocity
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
I've tried, and I haven't found any solution for changing the actual grenade's velocity.
However, I was able to recreate a grenade in the same path, and make it go where I wanted.
I had to make the real grenade SOLID_NOT, and invisible.
Then, when the grenade was about to explode, I set it's origin where the fake one is at, then deleted the fake entity.
Code for this has been present in ChickenMod for ages (years), where we just drop the grenade.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz 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 13:46.


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