Search found 52 matches
- Sat Mar 19, 2022 9:55 pm
- Forum: General Discussion
- Topic: Possible to compile SP for a TF2 Mod?
- Replies: 0
- Views: 7283
Possible to compile SP for a TF2 Mod?
Theres a mod called OpenFortress, which is essentially converting TF2 into Quake. It's code is forked from the TF2 base, so it's the same branch as TF2 I imagine that most of the same things will exist there; and I'm wondering how difficult it would be to get SourcePython to run on OpenFortress serv...
- Sat May 29, 2021 8:25 pm
- Forum: Plugin Development Support
- Topic: SP cannot find libbz2.so
- Replies: 0
- Views: 6210
SP cannot find libbz2.so
[SP] Caught an Exception: Traceback (most recent call last): File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin plugin = self.manager.load(plugin_name) File "../addons/source-python/packages/source-python/plugins/manager.py", line ...
- Wed May 26, 2021 11:30 pm
- Forum: Plugin Development Support
- Topic: Hook Player Spray
- Replies: 4
- Views: 19904
Re: Hook Player Spray
Would implementing a "spray ban" feature be as simple as just blocking this event with a pre-event hook?
(also sry if i'm not supposed to necro old posts, i can make a seperate post if nessessary)
(also sry if i'm not supposed to necro old posts, i can make a seperate post if nessessary)
- Sat May 22, 2021 10:16 pm
- Forum: Plugin Development Support
- Topic: Player connect event missing index?
- Replies: 2
- Views: 9180
Re: Player connect event missing index?
This seems to work for me.
Syntax: Select all
@Event("player_activate")
def on_player_activate(event):
args = event.variables.as_dict()
index = index_from_userid(args['userid'])
player = Player(index)
assign_permissions(player)
- Sat May 22, 2021 9:27 pm
- Forum: Plugin Development Support
- Topic: Player connect event missing index?
- Replies: 2
- Views: 9180
Player connect event missing index?
Hello hopefully this is a simple problem. I need to apply attributes to a player when they join the server. I need their steamid to lookup some info about them. Currently im catching the "player_connect" event since it gives me index and steam id. Upon connecting though; the server doesnt ...
- Mon Jun 29, 2020 6:23 am
- Forum: General Discussion
- Topic: Small "threaded" function decorator
- Replies: 0
- Views: 6478
Small "threaded" function decorator
from listeners.tick import GameThread def threaded(fn): def wrapper(*args, **kwargs): thread = GameThread(target=fn, args=args, kwargs=kwargs) thread.daemon = True thread.start() return wrapper def load(): do_something_that_blocks() @threaded def do_something_that_blocks(): requests.get("https...
- Mon Jun 29, 2020 2:29 am
- Forum: General Discussion
- Topic: [TF2] Extending the Player class
- Replies: 11
- Views: 20573
Re: [TF2] Extending the Player class
So this is what my ctf player is looking like: CTFPlayer.ini [virtual_function] # _ZN9CTFPlayer10BumpWeaponEP17CBaseCombatWeapon [[bump_weapon]] offset_linux = 401 offset_windows = 400 arguments = POINTER return_type = BOOL [property] ragdoll = m_hRagdoll player_class = m_PlayerClass.m_iClass desire...
- Mon Jun 29, 2020 1:02 am
- Forum: General Discussion
- Topic: [TF2] Extending the Player class
- Replies: 11
- Views: 20573
Re: [TF2] Extending the Player class
So im looking to get uber gun percentage as well So I would need to be able to get the active weapon class that the player has. I see this being under this: CTFPlayer (type DT_TFPlayer) Table: baseclass (offset 0) (type DT_BasePlayer) Table: baseclass (offset 0) (type DT_BaseCombatCharacter) Table: ...
- Sun Jun 28, 2020 11:40 pm
- Forum: General Discussion
- Topic: [TF2] Extending the Player class
- Replies: 11
- Views: 20573
Re: [TF2] Extending the Player class
So I'm not seeing any data with a class name to id mapping; i assume i should add it? Since it's very specfic to TF2, im not sure where to put it. Bascially would want this: [classes] scout = 1 sniper = 2 soldier = 3 demoman = 4 medic = 5 heavy = 6 pyro = 7 spy = 8 engineer = 9
- Sat Jun 27, 2020 10:55 pm
- Forum: General Discussion
- Topic: [TF2] Extending the Player class
- Replies: 11
- Views: 20573
Re: [TF2] Extending the Player class
Similar to the Player classes for CSGO and CSS , you can create one for Team Fortress 2 ( source-python/packages/source-python/players/orangebox/tf.py ). As for enums, there's already data for teams , you can use that as a template for creating one for classes. The class properties you're using are...
- Sat Jun 27, 2020 5:18 am
- Forum: Plugin Development Support
- Topic: [TF2] Hooking Server Log
- Replies: 5
- Views: 11719
Re: [TF2] Hooking Server Log
This works! Thanks for all the help guys!
- Sat Jun 27, 2020 4:55 am
- Forum: General Discussion
- Topic: [TF2] Extending the Player class
- Replies: 11
- Views: 20573
[TF2] Extending the Player class
Hello! There are some convenience methods that would be very helpful for me to have on the player class from TF2. I'm currently monkey patching the Player module to add them, but wondering what I could do to make this part of SP directly. It would add methods to this class here: http://wiki.sourcepy...
- Fri Jun 26, 2020 7:09 pm
- Forum: Plugin Development Support
- Topic: [TF2] Hooking Server Log
- Replies: 5
- Views: 11719
Re: [TF2] Hooking Server Log
If you want to to hook the complete server output, you can use the OnServerOutput listener: http://wiki.sourcepython.com/developing/module_tutorials/listeners.html#onserveroutput If you want to get the server output at a specific time (e. g. when executing a command), you can use context manager se...
- Fri Jun 26, 2020 6:29 am
- Forum: Plugin Development Support
- Topic: [TF2] Hooking Server Log
- Replies: 5
- Views: 11719
[TF2] Hooking Server Log
Basically I need the SP equivalent of this: https://sm.alliedmods.net/new-api/logging/AddGameLogHook This allows me to take the log output from the server console (via the log cvar) and pipe it into a file which I will later need to upload somewhere when the match ends. Example log line: L 06/26/202...
- Sat Jun 20, 2020 8:49 pm
- Forum: Plugin Development Support
- Topic: [TF2] Suppress mp_tournament_whitelist output
- Replies: 2
- Views: 8858
[TF2] Suppress mp_tournament_whitelist output
Basically every time the server changes level or does mp_tournament_restart it will spit out a giant list of allowing and denying items in both console and in in-game chat Heres a snippet of what it looks like: ... -> Removing 'Taunt: The Russian Arms Race' -> Removing 'Taunt: The Soviet Strongarm' ...
- Sat Jun 20, 2020 8:45 am
- Forum: Plugin Releases
- Topic: [ANY] SP Exec
- Replies: 0
- Views: 6816
[ANY] SP Exec
Okay so this is a long story as to why i decided i needed to do this; but short version is: srcds is unable to correctly read the file size from cfg files inside a mounted NFS volume. This means I can't use an AWS EFS volume to store cfg and other files to share between my servers. So my solution fo...
- Mon Dec 30, 2019 11:38 pm
- Forum: Plugin Development Support
- Topic: [ANY] Prevent user name changes
- Replies: 10
- Views: 19149
[ANY] Prevent user name changes
I'm creating an plugin to integrate my discord with my TF2 servers; and want to force names to be sync'd. I need to be able to prevent players from changing their name. This code does not seem to work: @PreEvent('player_changename') def on_changename(event): return EventAction.BLOCK Am I missing som...
- Mon Dec 30, 2019 10:47 pm
- Forum: Plugin Development Support
- Topic: [TF2] Force start round in mp_tournament
- Replies: 2
- Views: 9108
Re: [TF2] Force start round in mp_tournament
I know this is a very late response; but this is the only thing I could get to work: https://github.com/servers-tf/sourcepython-plugins/blob/master/admin/admin.py#L111-L120 If I remember correctly; there were entities i could send inputs to but they just ignored it. The behavior of the mp_tournament...
- Thu Mar 21, 2019 6:33 pm
- Forum: Plugin Development Support
- Topic: [TF2] Force start round in mp_tournament
- Replies: 2
- Views: 9108
[TF2] Force start round in mp_tournament
Hello! I'm trying to work on some plugins for competitive TF2, one thing that would be really nice is having a bit more control over the mp_tournament stuff. Basically TF2 has a mode than can be enabled called "mp tournament" which allows community organized competitive matches to occur. I...
- Sat Sep 08, 2018 2:26 am
- Forum: Plugin Development Support
- Topic: Server Monitoring Plugin
- Replies: 0
- Views: 7461
Server Monitoring Plugin
Hey all! So I'm a system administrator by day; ive recently started using some new monitoring software and I wanna use it with my TF2 servers. Basically I want to write a plugin that outside processes can hit an endpoint and ask for information from the srcds process. Thinking I would just stand up ...