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

TF2 Critical Hits Oo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-20-2007 , 06:32   TF2 Critical Hits Oo
Reply With Quote #1

hello,

it is mir first time i try to write scripts with sourcemod...

is it possible to change the critical hit chance for single players? perhaps by given steam ids or so?
something like "tf_crit_chance <userid>|<steamid>|<nickname> <percent>"

if yes, how do i search for it? i would like to know, in which docs i can find things like "what commands do i need?", "what commands/functions are supported for tf2" etc ...

the coding itself is not my problem, but how to find out, how to do and what i can do, is not easy with 100 of docs

and a little info about my crit thing would be great, too

thanks in advance
andi
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 11-20-2007 , 07:41   Re: TF2 Critical Hits Oo
Reply With Quote #2

Let's go by steps, I found the offset CTFPlayer::m_iCritMult in TF2 prop list, but I am not sure what it does or how does it work, so let's first try to find it's default value

Try hooking some command to:
PHP Code:
new offset FindSendPropOffs("CTFPlayer""m_iCritMult");

LogMessage("CritMult: %d"GetEntData(clientoffset4)); 
Go in the game, and check the value it Logs
If it gives a giant random number, try changing the 4 to 2 or to 1



If you learned what is does and how it works, try messing around with it's value
PHP Code:
new offset FindSendPropOffs("CTFPlayer""m_iCritMult");

SetEntData(clientoffsetNewValue4); 
Note: If you are going to use this function a good number of times, try making the "offset" a global and call FindSendPropOffs at PluginStart
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-20-2007 , 08:13   Re: TF2 Critical Hits Oo
Reply With Quote #3

Quote:
Originally Posted by Nican View Post
Let's go by steps, I found the offset CTFPlayer::m_iCritMult in TF2 prop list
hi nican, thanks for your help ... i will tryout this later today...

one question left ... where can I find the "TF2 prop list" or the prop list of other games?
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
BAILOPAN
Join Date: Jan 2004
Old 11-20-2007 , 10:23   Re: TF2 Critical Hits Oo
Reply With Quote #4

You can use sm_dump_netprops <file> to dump the network property tables to a file.
__________________
egg
BAILOPAN is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-20-2007 , 14:00   Re: TF2 Critical Hits Oo
Reply With Quote #5

Quote:
sm_dump_netprops bla
Unknown command "sm_dump_netprops"
what the shice :-O
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 11-20-2007 , 14:04   Re: TF2 Critical Hits Oo
Reply With Quote #6

Make sure to use it through rcon or the server console.
__________________
I'm a blast from the past!
ferret is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-20-2007 , 14:06   Re: TF2 Critical Hits Oo
Reply With Quote #7

it was the server console of a dedicated server
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-20-2007 , 14:16   Re: TF2 Critical Hits Oo
Reply With Quote #8

arg my fault ... i deactivated all standard plugins on that server
now it works ...
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 11-20-2007 , 15:37   Re: TF2 Critical Hits Oo
Reply With Quote #9

ok i tested it a little bit ...

PHP Code:
new offset FindSendPropOffs("CTFPlayer""m_iCritMult"); 

LogMessage("CritMult: %d"GetEntData(clientoffset4)); 
the results are the maxiumum health points of my class ... 125 as scout, 200 as soldier and 300 as heavy ...

the the prop list i found the following with "crit" included:
PHP Code:
CTFGrenadePipebombProjectile m_bCritical
CTFProjectile_Rocket m_bCritical
CTFProjectile_SentryRocket m_bCritical
CTFWeaponBaseGrenadeProj m_bCritical
CTFMinigun m_bCritShot
CTFFlameThrower m_bCritFire
CTFPlayer m_iCritMult 
bCritShot and bCritFire are sometimes 1 or 2 ... the others are 0 ... i changed the numbers of all values a lot of times in different values ... no effect ...

any idea how to change the crit chance for a player now? :-/


there a is mod called "TFTrue", which supports cvars to change it global:
PHP Code:
tftrue_crit_multiple
    The multiple used 
for applying crits (normally x3)

tftrue_crit_chance
    The chance to 
do critical damage (decimal percentage)

tftrue_melee_crit_chance
    The chance to 
do critical damage with a melee attack (decimal percentage
so it should be possible

any help would be great

andreas
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 11-20-2007 , 15:41   Re: TF2 Critical Hits Oo
Reply With Quote #10

A link to that mod might help us.
__________________
I'm a blast from the past!
ferret 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:34.


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