Search found 1776 matches
- Wed Oct 20, 2021 2:17 pm
- Forum: Plugin Releases
- Topic: Custom chat tag
- Replies: 10
- Views: 18443
Re: Custom chat tag
I have a couple tips for you, if you are interested. First, line 303 will error in CS:GO since the variable naco is only defined in the else clause (variable is named team_color , which does seem more appropriate anyway, for CS:GO): https://github.com/srpg/chat_tag/blob/main/addons/source-python/plu...
- Thu Oct 14, 2021 8:57 pm
- Forum: Plugin Development Support
- Topic: trace attack
- Replies: 6
- Views: 5684
Re: Detect knife attack
untested: from entities import TakeDamageInfo from entities.hooks import EntityCondition from entities.hooks import EntityPreHook from memory import make_object @EntityPreHook(EntityCondition.is_player, get_trace_attack_function) def pre_trace_attack(stack_data): victim = make_object...
- Thu Oct 14, 2021 8:40 pm
- Forum: Plugin Development Support
- Topic: trace attack
- Replies: 6
- Views: 5684
Re: Detect knife attack
That's because the second argument isn't a player:
Syntax: Select all
# this, CTakeDamageInfo, Vector, trace_t, CDmgAccumulator
- Fri Oct 08, 2021 11:18 pm
- Forum: General Discussion
- Topic: Windows 11
- Replies: 4
- Views: 3813
Re: Windows 11
Can you please post the actual output?
- Sat Oct 02, 2021 4:51 pm
- Forum: Plugin Development Support
- Topic: Merge Folders
- Replies: 6
- Views: 4825
Re: Merge Folders
Unfortunately, I don't think we have updated SP to Python3.8 (iirc). If we did, this would work:
https://stackoverflow.com/a/58916847
But, there are other answers on that SO thread that you might try.
https://stackoverflow.com/a/58916847
But, there are other answers on that SO thread that you might try.
- Thu Sep 30, 2021 11:40 pm
- Forum: Plugin Development Support
- Topic: [Cs:s] Weapon limit for certain weapons by team and amount
- Replies: 3
- Views: 3714
Re: [Cs:s] Weapon limit for certain weapons by team and amount
Unfortunately, for the following to work, you'll have to wait for a new build. There was an issue that caused CS:S weapon restrictions to not call on purchasing, which I just committed a fix for. But, once you have a new build, you might try: from filters.entities import EntityIter from weapons.mana...
- Tue Aug 10, 2021 12:31 pm
- Forum: Plugin Development Support
- Topic: [Advanced] Hook CPluginHelpersCheck::CreateMessage
- Replies: 6
- Views: 4104
Re: [Advanced] Hook CPluginHelpersCheck::CreateMessage
Yes we do. We also have classes that wrap each of the message types to make it easier to utilize: http://wiki.sourcepython.com/developing/modules/messages.html#module-messages Look for the messages.Dialog<type> classes in that wiki link. *Edit: sorry, just realized I misread and you said "hooki...
- Wed Jul 14, 2021 9:39 pm
- Forum: Plugin Development Support
- Topic: [CS:GO] Get inflictor entity in TakeDamageInfo
- Replies: 4
- Views: 3708
Re: [CS:GO] Get inflictor entity in TakeDamageInfo
Something must have changed in CS:GO if that is true. The inflictor is typically never what you want to get in that instance. If the attacker and inflictor are the same, weapon is set to the attacker's active weapon. If the attacker and inflictor are different, the weapon is set to the inflictor. Th...
- Sat Jun 19, 2021 6:32 pm
- Forum: General Discussion
- Topic: TypeError: string indices must be integers
- Replies: 2
- Views: 4293
Re: TypeError: string indices must be integers
The error indicates that data is not structured like you think it is. Print the value of data prior to the sorted line to verify it looks like you are intending it to.
*Edit: you might print type(data) as well to make sure the whole thing isn't a string.
*Edit: you might print type(data) as well to make sure the whole thing isn't a string.
- Fri Jun 04, 2021 12:00 pm
- Forum: Plugin Development Support
- Topic: [Cs:s] How to get buying weapon price
- Replies: 4
- Views: 3127
Re: [Cs:s] How to get buying weapon price
A couple things to note on that. First, the parentheses around the value in price are unnecessary. Also, weapon_manager will automatically add the 'weapon_' prefix, so no need to do that yourself. Lastly, and most importantly, there are items you can buy that are not weapons and will cause that to e...
- Thu Jun 03, 2021 8:44 pm
- Forum: Plugin Development Support
- Topic: [Cs:s] How to get buying weapon price
- Replies: 4
- Views: 3127
Re: [Cs:s] How to get buying weapon price
If you don't have weapon customizations that would affect it, you can always use something like (iirc): from weapons.manager import weapon_manager weapon = 'ak47' print(weapon_manager['ak47'].cost) *Edit: also, if you hook buy_internal, it might include the amount they paid, ...
- Sun May 16, 2021 1:20 am
- Forum: General Discussion
- Topic: Warmup + Dissolver
- Replies: 4
- Views: 4220
Re: Warmup + Dissolver
Just to make sure, are you asking for an option to not have dissolver during the warmup round? If so, I will have to think about the best solution for that when I have time. In the meantime, you can use L'In20Cible's suggestion.
- Mon May 10, 2021 11:30 pm
- Forum: Plugin Releases
- Topic: GunGame v1.3.2
- Replies: 46
- Views: 79797
Re: GunGame v1.3.2
GunGame Update!
Version: 1.3.2
Version Notes:
Version: 1.3.2
Version Notes:
- Added playing the 'Welcome' sound when a player joins the server.
- Mon May 10, 2021 11:21 pm
- Forum: Whatever
- Topic: Welcome sound
- Replies: 6
- Views: 13985
Re: Welcome sound
I will be creating a new release shortly. Technically, the default sound is wrong, though.. I always meant to create a new sound for this version of GunGame, but never got around to it. But, for now, the GunGame5 welcome sound will work. If you or anyone else wants to make a new one for me, I would ...
- Sat May 08, 2021 4:18 pm
- Forum: Whatever
- Topic: Welcome sound
- Replies: 6
- Views: 13985
Re: Welcome sound
Looking at the code on my phone, it appears I never implemented the welcome sound, so that would be a bug. Give me some time, won't be home until this evening, but I will try to get that implemented and create a new release.
- Wed Apr 21, 2021 2:06 am
- Forum: Plugin Development Support
- Topic: Delete Player Weapons On Death.
- Replies: 7
- Views: 4810
Re: Delete Player Weapons On Death.
Yeah, it might work better to use the player_hurt event, as L'In20Cible stated. If I remember correctly, there is an event variable for the amount of remaining health, so you can just check that to see if it's 0.
- Thu Mar 25, 2021 1:10 pm
- Forum: Plugin Development Support
- Topic: [CS:GO] Print console admin log
- Replies: 5
- Views: 4012
Re: [CS:GO] Print console admin log
Also, there's already a default location for SP logs, so why not create a directory in there to store everything of that sort in 1 location: https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/paths.py#L88 from paths import LOG_PATH _logs =...
- Thu Mar 25, 2021 12:58 pm
- Forum: Plugin Development Support
- Topic: [CS:GO] Print console admin log
- Replies: 5
- Views: 4012
Re: [CS:GO] Print console admin log
I'm not sure how that works on Linux. The value of that, regardless of operating system, will be a str. And str objects don't have a joinpath method. I would highly recommend using the path package, much like we have in the paths module: https://github.com/Source-Python-Dev-Team/Source.Python/blob/m...
- Thu Mar 25, 2021 12:44 pm
- Forum: Plugin Development Support
- Topic: [CS:GO] Print console admin log
- Replies: 5
- Views: 4012
Re: [CS:GO] Print console admin log
Where is _logs defined and what is it defined as?
- Tue Feb 16, 2021 7:53 pm
- Forum: Plugin Development Support
- Topic: Wrong args/parameters for emit_sound
- Replies: 1
- Views: 2398
Re: Wrong args/parameters for emit_sound
The second argument, if you aren't giving keywords for them, in Player.play_sound is volume, not duration: https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/players/_base.py#L715-L721 My guess is that video.duration is a string value, and...