Search found 1259 matches
- Sun Nov 06, 2022 11:21 am
- Forum: Plugin Development Support
- Topic: [Cs:s] How to hook weapon reload
- Replies: 2
- Views: 9185
Re: [Cs:s] How to hook weapon reload
The first problem is that you are effectively hooking CBaseCombatCharacter::RemovePlayerItem because your hook targets players, not weapons. To target weapons, you would have to change your condition to: lambda entity: entity.is_weapon() However, Reload is virtual and each weapon entity impl...
- Sun Oct 16, 2022 4:30 am
- Forum: Plugin Development Support
- Topic: [Cs:s] How to block kill command in console
- Replies: 3
- Views: 19886
Re: [Cs:s] How to block kill command in console
kill is technically a server command, not a client one. Using ServerCommand should work. However, you cannot access the index of the player issuing it because GetCommandIndex don't seem to be currently exported to Python. EDIT: GetCommandIndex has been exported as commands.get_command_index into 34...
- Fri Sep 23, 2022 2:37 am
- Forum: Plugin Development Support
- Topic: TF2 Event Win Reasons
- Replies: 4
- Views: 9276
Re: TF2 Event Win Reasons
You can find the enumeration declaration in the SDK. However, I'm not sure how up-to-date it is, nor if it is complete. The translations files usually have the whole list that allows you to compare the index with the message, etc.
- Fri Sep 23, 2022 1:34 am
- Forum: Plugin Development Support
- Topic: TF2 Event Win Reasons
- Replies: 4
- Views: 9276
Re: TF2 Event Win Reasons
# ../resource/tf_english.txt "Winreason_AllPointsCaptured" "%s1 captured all control points" "Winreason_FlagCaptureLimit" "%s1 captured the enemy intelligence %s2 times" "Winreason_FlagCaptureLimit_One" "%s1 captured the enemy intelligence %s2 ...
- Sun Sep 18, 2022 6:48 am
- Forum: Custom Packages
- Topic: Enki
- Replies: 3
- Views: 174861
Re: Enki
It is indeed very cool! Fighting client prediction on physics or movements is always a pain and it looks really smooth in your previews which is impressive. I've not looked much at the code, but 2 things I've noticed: ⋅ In your first example (water_splash.py), I think you could use the fol...
- Sun Sep 18, 2022 6:37 am
- Forum: Plugin Development Support
- Topic: trace ray
- Replies: 4
- Views: 20922
Re: trace ray
You can simply modify the TraceFilterSimple to ignore all players: engine_trace.trace_ray( TraceFilterSimple(ignore=[player.index for player in PlayerIter()]), ) Despite what I believe is outdated documentation, the TraceFilterSimple class actually accept an iterable of Base...
- Wed Aug 31, 2022 3:03 am
- Forum: Plugin Development Support
- Topic: Error with bots and PlayerDictionary
- Replies: 8
- Views: 19513
- Thu Jul 07, 2022 1:58 am
- Forum: Plugin Development Support
- Topic: print UnicodeEncodeError
- Replies: 4
- Views: 15799
Re: print UnicodeEncodeError
Thank you for your update! The machine where the exception occurs is running CS:S only, since your core file is inside a csgo folder. My bad, knew you were on Linux but thought this was for CS:GO. I will drop a CS:S build in that directory shortly. Its a very weird behaviour, since the machine's ou...
- Wed Jul 06, 2022 4:39 pm
- Forum: Plugin Development Support
- Topic: print UnicodeEncodeError
- Replies: 4
- Views: 15799
Re: print UnicodeEncodeError
My first guess would be that, at some point, your locale settings are being overwritten somehow causing SP to resolve to ascii after a subsequent launch of your server(s). We -could- enforce an encoding, however, this would likely result into weird behaviours for everything that rely on locale/defau...
- Tue May 31, 2022 5:39 pm
- Forum: Plugin Development Support
- Topic: HudMsg immediately disappears
- Replies: 2
- Views: 8084
Re: HudMsg immediately disappears
Whenever a new round starts, the game send a ResetHUD message to all players in order to remove messages from the last round. Delay your message by a few frames so that it is being sent after that reset.
- Thu May 05, 2022 5:22 pm
- Forum: Plugin Development Support
- Topic: Entity I/O
- Replies: 4
- Views: 11208
Re: Entity I/O
Articha wrote:you write two DataType.Pointer. How I know what arguments should be passed to function?
That specific function is defined as an ENTITYFUNCPTR:
Syntax: Select all
typedef void (CBaseEntity::*ENTITYFUNCPTR)(CBaseEntity *pOther );
- Thu May 05, 2022 1:59 pm
- Forum: Plugin Development Support
- Topic: Entity I/O
- Replies: 4
- Views: 11208
Re: Previous forum
I still don't want to hook OnTrigger like in trigger_multiple, bcz there's many triggers with OnTrigger output. Can I somehow move that trigger into FireUser1-4 without Hammer? I understand the reasoning, but I don't think these inputs/outputs are the solution here. Instead, you could simply inject...
- Fri Apr 15, 2022 9:35 am
- Forum: Plugin Development Support
- Topic: [Cs:s] Hook remaining time of the map
- Replies: 7
- Views: 26344
Re: [Cs:s] Hook remaining time of the map
You don't necessarily need a signature for that: from cvars import ConVar from engines.gamerules import find_game_rules from engines.server import global_vars mp_timelimit = ConVar('mp_timelimit') def get_map_remaining_time(): """Returns the remaining time for ...
- Tue Dec 28, 2021 8:24 am
- Forum: Plugin Development Support
- Topic: ClientCommand working for +lookatweapon but not +jump?
- Replies: 2
- Views: 12491
Re: ClientCommand working for +lookatweapon but not +jump?
Why does this happen, and is there a way around it? Commands that are solely flagged as CLIENTDLL are for the most part not networked from client → server. This is the case for movements and impulses; they are combined using bitwise operators and networked as a single integer once per frame rather ...
- Tue Dec 21, 2021 1:50 pm
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 161505
Re: EasyPlayer
I've chosen not to implement caching as I believe one should be using PlayerDictionary anyways, and subclassing to enable caching should be trivial. Technically they could also pass caching=True on construction to get the instance from the cache. Not declaring it in the class (or its __init__ signa...
- Mon Dec 20, 2021 9:15 am
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 161505
Re: EasyPlayer
Why should I use caching though? Isn't that what PlayerDictionary is for? To an extent, yes. Assuming scripters using your library only query instances from a dictionary. Telling your class to uses caching makes sure all the following is True : from players.entity import Player from players.diction...
- Mon Dec 20, 2021 5:22 am
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 161505
Re: EasyPlayer
Nice! Here are some stuff I noticed after a quick hovering: ⋅ Your Player class won't use caching unless you explicitly tell it to do so: class Player(SourcePythonPlayer): """A player entity class with additional functionality. Takes full advantage of the `Effect` cl...
- Mon Dec 20, 2021 5:07 am
- Forum: Plugin Development Support
- Topic: Is it possible to use the newer style radio menus?
- Replies: 2
- Views: 11791
Re: Is it possible to use the newer style radio menus?
Very unlikely. That menu is probably client-side and all the server receives are the radio commands upon selection. I vaguely remember CS:GO didn't even offer the old ShowMenu at first when it was released and was added later on due to community demands.
- Mon Dec 20, 2021 5:05 am
- Forum: Plugin Requests
- Topic: Snowfall for Black Mesa
- Replies: 29
- Views: 56426
Re: Snowfall for Black Mesa
It will only work on small maps that don't already have a lot of particles. For example, on CS:S it will work on maps such as cs_assault but won't on maps such as de_dust2 (larger, with lot of dust particles builtins, etc.).
- Mon Dec 13, 2021 9:44 pm
- Forum: Plugin Development Support
- Topic: When to create and cache a TempEntity?
- Replies: 4
- Views: 16852
Re: When to create and cache a TempEntity?
And I can reuse this throughout the plugin's entire lifetime? Just making sure :grin: Yes. The engine uses a global instance and set all values every times it sends one, but the TempEntity class was designed with isolation in mind and make a copy of the global instance so that each instances have t...