Raised This Month: $ Target: $400
 0% 

[:3] TF2_CTFWeaponInfo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-16-2010 , 12:20   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #1

Or just dont use GetOwnerEntity()
Wazz is offline
CrancK
Senior Member
Join Date: Jan 2009
Location: Netherlands
Old 10-03-2010 , 04:51   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #2

how do i use this in/for a plugin?

like, add everything before the CON_COMMAND and then make my own CON_COMMAND? (it simply looks completely different from the sourcepawn i've been using, so it looks quite confusing to me) is it possible to explain it somewhat, so i could understand and adapt it myself?

from what i can gather, the stuff within the #ifdef _win32 to #endif is for signature finding, so i'd need to put that in my con cmd too.
then there's a check for the number of args, after which it converts the arg to a char? (is that simply a string? or actually just 1 character?), which is then used to find which effect? (with a check to see if name is invalid)
and then followed by the actual stuff that does something i think...
(do i remember correctly if -> has something to do with pointers?)

basically i'm looking for a way to up a player's weapondamage in tf2 (not everyone with that weapon btw), the problem in tf2 is that in the ctx, there is a max damage defined so even if i use a point hurt, i can't actually damage them with more then the max damage for that weapon at the same time. (i'd need multiple different point hurts, which if they kill someone spams loads of kill messages)

so ye... could you explain a bit? or provide a small example of what i'm wanting to try? (or even tell me this isn't the way to do it, cos you know a better way?)
CrancK is offline
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 10-03-2010 , 05:34   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #3

It's C++, not SourcePawn. You could use SDKHooks to change the weapon damage.
Andersso is offline
CrancK
Senior Member
Join Date: Jan 2009
Location: Netherlands
Old 10-03-2010 , 05:54   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #4

how could i use sdkhooks?
I guess you're thinking of OnTakeDamage or OnTakeDamagepost, but they only provide a solution if the damage i want to do is within the limits the ctx's provide, thus rocketlauncher cant do more then about 120 damage, and stickys about 140.
I can reduce the damage perfectly with sdkhooks, but if i tell it to do 400damage with any gun, it won't...

(or am i missing something?)
CrancK is offline
Andersso
Member
Join Date: Nov 2009
Location: E8 2A 2A 2A 2A
Old 10-03-2010 , 06:54   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #5

You should be able to go over the damage limitations, I'm not 100% in TF2 but it works in all other games. I don't see any reason why it would not work in TF2.
Andersso is offline
Swixel
Senior Member
Join Date: Jul 2010
Location: Sydney, Australia
Old 10-14-2010 , 22:56   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #6

Quote:
Originally Posted by CrancK View Post
how do i use this in/for a plugin?

like, add everything before the CON_COMMAND and then make my own CON_COMMAND? (it simply looks completely different from the sourcepawn i've been using, so it looks quite confusing to me) is it possible to explain it somewhat, so i could understand and adapt it myself?
This is C++ for use in a plugin. If you simply wish to hurt someone, buff their health then hit them with multiple point_hurts. That can be done in Pawn.
Swixel is offline
ProdigySim
SourceMod Plugin Approver
Join Date: Feb 2010
Old 12-13-2010 , 17:42   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #7

Updated FileWeaponInfo_t for L4D2, along with L4D2's CCSWeaponInfo and CTerrorWeaponInfo...

Patch for FileWeapoInfo_t on hl2sdk-l4d2:
https://bugs.alliedmods.net/show_bug.cgi?id=4744
CCSWeaponInfo + CTerrorWeaponInfo:
PHP Code:
class CCSWeaponInfo : public FileWeaponInfo_t // 866 bytes
public:
    
float m_fMaxPlayerSpeed// 2192
    
int m_nWeaponType;  // 2196
    
int m_nTeam// 2200 // ANY = 0, TR = 2, CT = 3
    
float m_fBotAudiblerange// 2204
    
float m_fWeaponArmorRatio// 2208
    
int m_nCrosshairMinDistance// 2212
    
int m_nCrosshariDeltaDistance// 2216
    
bool m_bCanEquipWithShield// 2220
    
char m_aWrongTeamMsg[32]; // 2221
    
char m_aPlayerAnimationExtension[16]; // 2253
    
char m_aShieldViewModel[64]; // 2269
    
char m_aAddonModel[80]; // 2333
    
char m_aAddonAttachment[80]; // 2413
    
int m_nMuzzleFlashStyle// 2496 (not confirmed)
    
float m_fMuzzleFlashScale// 2500
    
int m_nPenetration// 2504
    
int m_nDamage// 2508
    
float m_fRange// 2512
    
float m_fRangeModifier// 2516
    
int m_nBullets// 2520
    
float m_fCycleTime// 2524
    
int m_nAccuracyQuadratic// 2528
    
float m_fAccuracyDivisor// 2532
    
float m_fAccuracyOffset// 2536
    
float m_fMaxInaccuracy// 2540
    
float m_fTimeToIdle// 2544
    
float m_fIdleInterval// 2548
    
float m_fNoiseFactor// 2552
    
int m_nBlackMarketPrice// 2556
    
int m_nBlackMarketPrice2// 2560
    
int m_nBlackMarketPreviousPrice// 2564 (not confirmed)
    
char m_aResponseRulesName[80]; // 2568
    
char m_aMuzzleFlashEffect_1stPerson[80]; // 2648
    
char m_aMuzzleFlashEffect_3rdPerson[80]; // 2728
    
char m_aEjectBrassEffect[80]; // 2808
    
char m_aDisplayName[80]; // 2888
    
char m_aDisplayNameAllCaps[80]; // 2968
    
int m_iTier// 3048
    
float m_fMusicDynamicSpeed// 3052
    
bool m_bNewInL4D2// 3056
    
bool m_bCSWeapon// 3057
};  

class 
CTerrorWeaponInfo : public CCSWeaponInfo 
public:
    
int m_iLoadoutSlots// 3060
    
float m_fMaxAutoAimDeflection1// 3064
    
float m_fMaxAutoAimRange1// 3068
    
float m_fWeaponAutoAimScale// 3072
    
float m_fVerticalPunch// 3076
    
float m_fHorizontalPunch// 3080
    
float m_fHorizontalPunchDirChance// 3084
    
float m_fSpreadPerShot// 3088
    
float m_fMaxSpread// 3092
    
float m_fSpreadDecay// 3096
    
float m_fMinDuckingSpread// 3100
    
float m_fMinStandingSpread// 3104
    
float m_fMinInAirSpread// 3108
    
float m_fMaxMovementSpread// 3112
    
float m_fPelletScatterPitch// 3116
    
float m_fPelletScatterYaw// 3120
    
float m_fUnknown// 3124
    
float m_fReloadDuration// 3128
    
float m_fDualReloadDuration// 3132
    
float m_fDeployDuration// 3136
    
float m_fDualDeployDuration// 3140
    
float m_fPenetrationNumLayers// 3144
    
float m_fPenetrationPower// 3148
    
float m_fPenetrationMaxDistance// 3152
    
float m_fCharacterPenetrationMaxDistance// 3156
    
float m_fGainRange// 3160
    
CUtlDict<const char*, unsigned shortm_tCharacterViewmodelAddon// 3164
    
char m_aViewModelDual[80]; // 3192
    
char m_aPlayerModelDual[80]; // 3272
    
char m_aAddonAttachment2[80]; // 3352 Why is this duplicated from 2413
    
Vector m_vAddonOffest// 3432 vector
    
Vector m_vAddonAngles// 3444 vector
    
char m_aWorldModel[80]; // 3456
}; 
Wazz's code for finding the database should still work. The sig seems fine to me for l4d2. I can't seem to make it work in windows, though. I probably typo'd something in the gamedata.

Last edited by ProdigySim; 12-14-2010 at 11:31. Reason: Updated hl2sdk patch + some variable lengths
ProdigySim 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:14.


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