Raised This Month: $32 Target: $400
 8% 

[TF2] Make client unable to attack


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-04-2015 , 09:21   Re: [TF2] Make client unable to attack
Reply With Quote #11

Quote:
Originally Posted by Chdata View Post
There's no point in doing that if you set the next attack to 3 years from now.

PHP Code:
// Sarysa variables

#define FAR_FUTURE 100000000.0      // This is about 3 years 
I would test that first, though. The game may very well clamp values to what it considers a reasonable range.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Phil25
AlliedModders Donor
Join Date: Feb 2015
Old 12-04-2015 , 09:29   Re: [TF2] Make client unable to attack
Reply With Quote #12

Quote:
Originally Posted by Powerlord View Post
I would test that first, though. The game may very well clamp values to what it considers a reasonable range.
If you want to test whether you will be able to attack after 3 years, be my guest ;)

Quote:
Originally Posted by Chdata View Post
There's no point in doing that if you set the next attack to 3 years from now.
And isn't it generally better to work with smaller values? I mean, I understand that it's pretty much impossible to get past that limit but I look at it like at the infamous water/glass analogy: while having a large volume of water you either get a huge-ass glass for it or distribute the water into regular glasses, adding one when you need it.

It all comes down to preference, anyway.

Last edited by Phil25; 12-04-2015 at 09:35.
Phil25 is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 12-04-2015 , 09:43   Re: [TF2] Make client unable to attack
Reply With Quote #13

Quote:
Originally Posted by Chdata View Post
There's no point in doing that if you set the next attack to 3 years from now.

PHP Code:
// Sarysa variables

#define FAR_FUTURE 100000000.0      // This is about 3 years 
lol
__________________
Starbish is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-04-2015 , 09:58   Re: [TF2] Make client unable to attack
Reply With Quote #14

Quote:
Originally Posted by Phil25 View Post
If you want to test whether you will be able to attack after 3 years, be my guest ;)



And isn't it generally better to work with smaller values? I mean, I understand that it's pretty much impossible to get past that limit but I look at it like at the infamous water/glass analogy: while having a large volume of water you either get a huge-ass glass for it or distribute the water into regular glasses, adding one when you need it.

It all comes down to preference, anyway.
Why go through extra typing work to set up a timer that in the end will only waste cycles?

I mean, your example goes both ways. Why transport water in shot glasses when you could distribute water in gallons stored on trucks? Or a better example, why buy one straw from the store every time you need one?

If you look at how often your code is executing, setting it one time is better than constantly setting it again and again to achieve the same thing - in this case you're only writing the value 'when you need it'. You can also re-enable the weapon, only 'when you need to'.

Random code debate aside have a frog: http://imgur.com/p2lkCIK

Quote:
Originally Posted by Powerlord View Post
I would test that first, though. The game may very well clamp values to what it considers a reasonable range.
I tend to use 999999.0 and it works fine.
__________________

Last edited by Chdata; 12-04-2015 at 10:07.
Chdata is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-04-2015 , 11:46   Re: [TF2] Make client unable to attack
Reply With Quote #15

Quote:
Originally Posted by Phil25 View Post
If you want to test whether you will be able to attack after 3 years, be my guest ;)
I meant to read the value and see what it's set to. If it was clamped, you'd get whatever the game is allowing as the max value back.
__________________
Not currently working on SourceMod plugin development.
Powerlord 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 00:19.


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