[STOCKS] Useful TF2 Functions
2 Attachment(s)
PHP Code:
|
Re: [STOCKS] Useful TF2 Functions
Did you test this functions?
|
Re: [STOCKS] Useful TF2 Functions
Yup. I've used them all before. I use half of them in my ClassChooser plugin (see the New Plugins forum). Also, a good thing to note is that when you equip a class with another class's weapons, the models might have problems. Most of the weapons are not compatible with all classes so there will be some glitches involved.
|
Re: [STOCKS] Useful TF2 Functions
Updated the library a bit.
Changes:
|
Re: [STOCKS] Useful TF2 Functions
You might wanna create the global variables using 'static' instead to avoid variable naming conflicts (as described here).
Also, what the f* is this? :D Code:
The file is getting included at compile time and the if clause causes hGameConfTF to be assigned to a gameconfigfile handle only if sdktools is NOT running at the time. Probably not what you want. |
Re: [STOCKS] Useful TF2 Functions
That's not how it works. Only the following line is inside of the if statement. All that statement does is check if sdktools is already included, and if it isn't, it includes it. As for the static thing, the global variables are needed in the main file, so using static would eliminate that because it limits it to that one include file. At least that's how I understand it. I guess I could use it for the hGameConfTF part, but the hWeaponEquip might be needed elsewhere.
[edit] To better explain the if statement, if I were to have used brackets there, it would look like this: PHP Code:
|
Re: [STOCKS] Useful TF2 Functions
Sorry, but you cant include files during runtime. They simply inform the compiler a function is defined elsewhere (referring to natives), so doing that doesnt make much sense. :?
EDIT: Quote:
EDIT 2: If you wanna check whether the file is already included or not, do Code:
Though it doesnt hurt even if sdktools was included twice cause it uses that define too. |
Re: [STOCKS] Useful TF2 Functions
Ah, I see what you're saying now. I don't know why I thought that would have worked (the plugin I was using already included the file so I guess I wasn't getting any errors because of it). The thing is that I only want the file included if that one function is used. I guess I'm just going to have to have it loaded always then.
[edit] Updated with the info p3tsin gave. |
All times are GMT -4. The time now is 14:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.