AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   TF2 Critical Hits Oo (https://forums.alliedmods.net/showthread.php?t=63393)

Tauphi 11-20-2007 06:32

TF2 Critical Hits Oo
 
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 :D

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

thanks in advance
andi

Nican 11-20-2007 07:41

Re: TF2 Critical Hits Oo
 
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

Tauphi 11-20-2007 08:13

Re: TF2 Critical Hits Oo
 
Quote:

Originally Posted by Nican (Post 554886)
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?

BAILOPAN 11-20-2007 10:23

Re: TF2 Critical Hits Oo
 
You can use sm_dump_netprops <file> to dump the network property tables to a file.

Tauphi 11-20-2007 14:00

Re: TF2 Critical Hits Oo
 
Quote:

sm_dump_netprops bla
Unknown command "sm_dump_netprops"
what the shice :-O

ferret 11-20-2007 14:04

Re: TF2 Critical Hits Oo
 
Make sure to use it through rcon or the server console.

Tauphi 11-20-2007 14:06

Re: TF2 Critical Hits Oo
 
it was the server console of a dedicated server

Tauphi 11-20-2007 14:16

Re: TF2 Critical Hits Oo
 
arg my fault ... i deactivated all standard plugins on that server :D
now it works ...

Tauphi 11-20-2007 15:37

Re: TF2 Critical Hits Oo
 
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 :D

any help would be great :)

andreas

ferret 11-20-2007 15:41

Re: TF2 Critical Hits Oo
 
A link to that mod might help us.


All times are GMT -4. The time now is 09:46.

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