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

[TF2]Explode Force & Rocket speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
koshmel
Member
Join Date: Nov 2008
Old 02-20-2009 , 16:11   [TF2]Explode Force & Rocket speed
Reply With Quote #1

Im writing plugin to control rocket speed and exploding force (without damage).

my code is turn off damage and make fake Rocket Jump
Need change rocket speed.

PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <tf2_stocks>
#include <dukehacks>

#define PLUGIN_VERSION "1.0"


new Handle:cvRPower INVALID_HANDLE;
new 
gRPower 40000;


public 
Plugin:myinfo 
{
    
name "Rjump no damage",
    
author "NNM",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
}
public 
OnPluginStart()
{
    
dhAddClientHook(CHK_TakeDamageTakeDamageHook);
    
cvRPower CreateConVar("ow_midair_rpower""40000""power of RJump");
    
HookConVarChange(cvRPowercvChanged);
}

public 
Action:TakeDamageHook(clientattackerinflictorFloat:damage, &Float:multiplierdamagetype)
{
    if (
damagetype DMG_BLAST)
    {
        new 
Float:IOrigin[3];
        new 
Float:COrigin[3];
        new 
Float:FOrigin[3];
        
GetEntPropVector(inflictorProp_Send"m_vecOrigin",IOrigin);
        
GetEntPropVector(clientProp_Send"m_vecOrigin"COrigin);
        
COrigin[2] += 50;
        
SubtractVectors(COriginIOrigin,FOrigin);
        new 
Float:distance=GetVectorLength(FOrigin);
        if(
distance>gRPower || distance==0)    return Plugin_Stop;
        
distance=distance*distance;
        
ScaleVector(FOrigingRPower/distance);
        for(new 
n=0;n<3;n++) 
            if(
FOrigin[n]>800.0
                
FOrigin[n] = 800.0;
        new 
Float:speed[3];
        
GetEntPropVector(clientProp_Data"m_vecVelocity"speed);
        
AddVectors(FOriginspeed,speed);
        
TeleportEntity(clientNULL_VECTORNULL_VECTORspeed);
    }    
    return 
Plugin_Stop;
}

public 
cvChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
gRPower=StringToInt(newValue);    


Last edited by koshmel; 02-20-2009 at 17:05.
koshmel is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-20-2009 , 17:30   Re: [TF2]Explode Force & Rocket speed
Reply With Quote #2

Ive actually been working on this for a few days. Not as an SM plugin though, im detouring a different function to try and tell it to keep the original velocity even with damage reduced. Pretty close but having some problems.
__________________
CrimsonGT is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 02-20-2009 , 17:41   Re: [TF2]Explode Force & Rocket speed
Reply With Quote #3

I managed to make rockets do 0 self damage using the TF2 damage snippet, but it's not a brilliant way of doing it.
MikeJS is offline
koshmel
Member
Join Date: Nov 2008
Old 02-21-2009 , 17:15   Re: [TF2]Explode Force & Rocket speed
Reply With Quote #4

How control rocket speed?

mb dhOnEntityCreated?
koshmel is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 02-21-2009 , 18:04   Re: [TF2]Explode Force & Rocket speed
Reply With Quote #5

http://forums.alliedmods.net/showpos...33&postcount=3
MikeJS is offline
koshmel
Member
Join Date: Nov 2008
Old 02-22-2009 , 06:47   Re: [TF2]Explode Force & Rocket speed
Reply With Quote #6

MikeJS
Can u help me with Rjumps.
My Rjump sucks.
koshmel is offline
nemesis787
Junior Member
Join Date: Mar 2009
Old 05-26-2009 , 10:58   Re: [TF2]Explode Force & Rocket speed
Reply With Quote #7

Anyone have a chance to take a look at this since the latest valve update. this was working beautifully ( actually the link to the example plugin). I can't get it to work now. Even after i changed the dukehacks offsets, etc.

any help worul be greatly appreciated.

Thanks
nemesis787 is offline
Reply


Thread Tools
Display Modes

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 10:52.


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