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

[TF2] Unlimited Mod


Post New Thread Reply   
 
Thread Tools Display Modes
SilentLikeSilence
Senior Member
Join Date: Jul 2009
Old 11-08-2009 , 04:25   Re: [TF2] Unlimited Mod
Reply With Quote #21

Quote:
Originally Posted by noodleboy347 View Post
Add cvars to enable each?
I will add one.
SilentLikeSilence is offline
EHG
Senior Member
Join Date: May 2009
Location: 127.0.0.1
Old 11-10-2009 , 10:32   Re: [TF2] Unlimited Mod
Reply With Quote #22

Use OnGameFrame and also check for something like if the left mouse button is pressed down. This way the OnGameFrame won't do anything unless someone is firing.
EHG is offline
SilentLikeSilence
Senior Member
Join Date: Jul 2009
Old 11-10-2009 , 11:41   Re: [TF2] Unlimited Mod
Reply With Quote #23

1 sec timer is a better way I think and it's enough, OnGameFrame is fired 24 times in a sec (if i know it well).
SilentLikeSilence is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 11-10-2009 , 13:20   Re: [TF2] Unlimited Mod
Reply With Quote #24

Ongameframe should only ever be used as a last resort. For performance, thats the worst thing you can use.
retsam is offline
SilentLikeSilence
Senior Member
Join Date: Jul 2009
Old 11-21-2009 , 09:40   Re: [TF2] Unlimited Mod
Reply With Quote #25

Man... I fixed everything and there's a lot of work in it. Why did you unapproved it?

And this is no reason "no idea what to say..."...

THAT'S NOT FAIR!

Last edited by SilentLikeSilence; 11-21-2009 at 09:48.
SilentLikeSilence is offline
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 11-22-2009 , 14:18   Re: [TF2] Unlimited Mod
Reply With Quote #26

A couple of things I noticed:
Code:
 else
    {
        //Do Nothing
    }
Isn't needed. If you don't need to do anything in an else statement then don't write 'else'. Also, you only need to create the timer when the client has entered the game, not every time the client changes class, that's just unnecessary logic checks. Create the timer in OnClientPutInServer (or in a later forward). In the repeating time you need to check if the player is alive using InPlayerAlive(client) before you do anything else. Finally, it may help performance if you store the clients class globally rather checking the clients class every time the timer 'ticks'. To do this create a global variable called g_ClientClass[MAXPLAYERS + 1] and in player_changeclass event update the class of the client. eg
Code:
 g_ClientClass[GetClientOfUserId(GetEventInt(event, "userid"))] = GetEventInt(event, "class"))
The you can swich (g_ClientClass[client]) in your Regenerate function.

P.S: (3 * 4) = 12
Wazz 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 04:49.


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