Search found 241 matches
- Fri Jul 03, 2015 11:49 am
- Forum: Plugin Development Support
- Topic: player/entity constants: GODMODE
- Replies: 10
- Views: 6796
Players are entities. Using m_takedamage allows you to set it so that an entity/player does not take damage. This is a true godmode instead of being tricky with life states. What would be the most convenient way of using m_takedamage? Is there a property for it or should I use player.set_property_b...
- Thu Jul 02, 2015 1:12 pm
- Forum: Plugin Development Support
- Topic: Guarantee an event listener to be called before other listeners of the same event?
- Replies: 2
- Views: 2723
Guarantee an event listener to be called before other listeners of the same event?
How would I ensure that my player_spawn event listener gets called before others? I'm trying to reset every player's gravity to 1.0 whenever they spawn, and I want to make sure it happens before other player_spawn functions modify the gravity again. Here's an easy example code of what I have: # ../p...
- Thu Jul 02, 2015 12:47 pm
- Forum: Code examples / Cookbook
- Topic: [TF2] getting healing target + checking if player is being healed from a dispenser
- Replies: 20
- Views: 40173
I'm happy that you play around with SP, but you should really test your code before posting on the forums -- at least when it comes to code examples! There are some errors in your code. I apologize, I'm used to compiling my code as I did with sourcemod but I don't know how to test-compile with sour...
- Thu Jul 02, 2015 11:50 am
- Forum: News & Announcements
- Topic: New release July 2nd, 2015!!
- Replies: 14
- Views: 37442
- Thu Jul 02, 2015 11:43 am
- Forum: Code examples / Cookbook
- Topic: [TF2] getting healing target + checking if player is being healed from a dispenser
- Replies: 20
- Views: 40173
- Tue Jun 30, 2015 10:43 pm
- Forum: Plugin Development Support
- Topic: Adding a tint overlay (fade user message?) on player's screen
- Replies: 3
- Views: 3068
The Fade class has been a part of the messages package since its creation. I did test using the numbers you have, but I am receiving errors. So, I lowered the 500 and 482 down to 5 and 2, and it worked like a charm: from colors import RED from events import Event from messages import Fade from play...
- Tue Jun 30, 2015 9:35 pm
- Forum: Plugin Development Support
- Topic: Adding a tint overlay (fade user message?) on player's screen
- Replies: 3
- Views: 3068
Adding a tint overlay (fade user message?) on player's screen
Say I want to make player's screen "bloody" by adding a red tint to it, how would this be done?
In eventscripts I would add a tint like so:
In eventscripts I would add a tint like so:
Code: Select all
es usermsg fade event_var(userid) 0 500 482 255 0 0 150
- Tue Jun 30, 2015 7:12 pm
- Forum: Plugin Development Support
- Topic: New Project: Porting Saxton Hale mod for Source.Python
- Replies: 27
- Views: 23217
I'm debating if I should encapsulate the class members or just leave them public as this will be my first real object-oriented plugin. Rarely should you "encapsulate" (there's no true encapsulation in Python) anything. But if you want, you can mark attributes or methods "private" with a leading und...
- Mon Jun 22, 2015 12:49 am
- Forum: Plugin Development Support
- Topic: __init__ (constructor) question when inheriting
- Replies: 11
- Views: 6652
- Mon Jun 22, 2015 12:34 am
- Forum: Plugin Development Support
- Topic: __init__ (constructor) question when inheriting
- Replies: 11
- Views: 6652
Satoon might be right about the pylint, but no, you don't have to define __init__ in a subclass if it doesn't do anything different from its super class's __init__. There's absolutely no benefit of doing this. Also, I couldn't find anything about this on PEP8, nor do I personally see why would you e...
- Tue Jun 09, 2015 10:36 am
- Forum: Plugin Development Support
- Topic: [TF2] VGUIMenu not working
- Replies: 7
- Views: 5281
- Fri Jun 05, 2015 1:00 pm
- Forum: General Discussion
- Topic: Python's eval() function
- Replies: 9
- Views: 7297
- Thu Jun 04, 2015 1:20 pm
- Forum: General Discussion
- Topic: Few questions regarding S.P and SourceMod
- Replies: 18
- Views: 14033
- Tue Jun 02, 2015 10:12 am
- Forum: Plugin Development Support
- Topic: how to show name of player that you are pointing to
- Replies: 22
- Views: 12808
- Mon Jun 01, 2015 9:57 pm
- Forum: Plugin Development Support
- Topic: how to show name of player that you are pointing to
- Replies: 22
- Views: 12808
- Fri May 29, 2015 8:57 pm
- Forum: Plugin Development Support
- Topic: how to show name of player that you are pointing to
- Replies: 22
- Views: 12808
Well, I don't think that fully applies in this instance as, in my view, that is for not creating 2 separate and distinct ways of doing the same thing. If we were to fully follow that rule as if it applied fully universally, one could argue that using the Entity/PlayerEntity attributes we add dynami...
- Fri May 29, 2015 7:07 pm
- Forum: Plugin Development Support
- Topic: how to show name of player that you are pointing to
- Replies: 22
- Views: 12808
- Fri May 29, 2015 1:42 pm
- Forum: Plugin Development Support
- Topic: how to show name of player that you are pointing to
- Replies: 22
- Views: 12808
The property wraps the 2 methods. This is actually a fairly common practice. We use it quite a bit for Entity/PlayerEntity. Never seen it before, I've only seen people use either properties (usually with the decorator) or set_x() and get_x() methods, but never both (doesn't mean it's wrong or anyth...
- Fri May 29, 2015 12:11 pm
- Forum: Plugin Development Support
- Topic: how to show name of player that you are pointing to
- Replies: 22
- Views: 12808
- Sun May 24, 2015 7:11 pm
- Forum: Plugin Development Support
- Topic: Property 'm_Effects' not found for entity type 'player'
- Replies: 8
- Views: 5229