Search found 1413 matches

by Ayuto
Wed Jun 24, 2015 4:29 pm
Forum: Plugin Development Support
Topic: Count temp entities
Replies: 11
Views: 8271

I doubt parsing the output of report_entities will be faster than using EntityIter(). You could even skip EntityIter() and use EntityGenerator() directly. As you can see it doesn't do very much if you just want to iterate over all entities. But why do you think that it might be too slow? Did you exp...
by Ayuto
Wed Jun 17, 2015 8:55 pm
Forum: Plugin Releases
Topic: simple death and kill streaks tracker
Replies: 16
Views: 13524

This is also working fine.^^

Syntax: Select all

>>> def f(x):
print(x)
return;

>>> f(5)
5
by Ayuto
Wed Jun 17, 2015 8:42 pm
Forum: Plugin Releases
Topic: simple death and kill streaks tracker
Replies: 16
Views: 13524

Also, your code wont load due to ; after return which is an invalid syntax. No, a semicolon is valid in Python. It allows you to use multiple statements within the same row.[PYTHON]>>> def f(x): print(x); x += 5; return x; >>> f(5) 5 10[/PYTHON]Though, you usually don't use that in Python.
by Ayuto
Sat Jun 13, 2015 12:36 pm
Forum: Plugin Development Support
Topic: [request] Short model list for CS:S
Replies: 4
Views: 3350

No, I meant the cstrike_pak_dir.vpk in your cstrike folder on your server. Though, the client has probably the same models.
by Ayuto
Sat Jun 13, 2015 11:56 am
Forum: Plugin Development Support
Topic: [request] Short model list for CS:S
Replies: 4
Views: 3350

You should be able to use every model you want. The built-in models are packed in *.vpk files in your cstrike folder. You can use GCFScape to open the cstrike_pak_dir.vpk, which lists the models, materials, etc.
by Ayuto
Wed Jun 10, 2015 7:04 am
Forum: Plugin Development Support
Topic: [CSS] Creating a usable, destroyable prop.
Replies: 8
Views: 7106

I could imagine that the info_target entity implements its own Use() method. So, your hook only gets called when you press +USE on an info_target entity. Try hooking it on prop_physics_override.
by Ayuto
Wed Jun 10, 2015 6:54 am
Forum: Plugin Development Support
Topic: ConVar - equivalent to RegisterConVarChanges
Replies: 9
Views: 7407

The callback gets called everytime a ConVar changes and it doesn't need the NOTIFY flag. But yes, if it has this flag, you would need to hook FireEvent.
by Ayuto
Tue Jun 09, 2015 6:24 am
Forum: Plugin Development Support
Topic: ConVar - equivalent to RegisterConVarChanges
Replies: 9
Views: 7407

We haven't added that to the wiki yet. But here is the source code: https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/memory/__init__.py#L77

I can add that to the wiki today. :)
by Ayuto
Mon Jun 08, 2015 5:34 pm
Forum: Plugin Development Support
Topic: ConVar - equivalent to RegisterConVarChanges
Replies: 9
Views: 7407

I would like to take this chance to show another feature of SP, which is already available since a long time. Though, we have improved this feature a few weeks ago. You can create functions, which have an address in memory, so you can pass them to any function you want. This means that you can creat...
by Ayuto
Fri Jun 05, 2015 7:14 pm
Forum: General Discussion
Topic: Python's eval() function
Replies: 9
Views: 7221

Well, it does not allow you to use operators.

Check the docs: https://docs.python.org/3.4/library/ast.html#ast.literal_eval
by Ayuto
Fri Jun 05, 2015 4:29 am
Forum: Plugin Releases
Topic: Admin Commands
Replies: 9
Views: 11729

Could you please post the error?
by Ayuto
Thu Jun 04, 2015 12:54 pm
Forum: General Discussion
Topic: Few questions regarding S.P and SourceMod
Replies: 18
Views: 13931

Yes, you could do that, but what's the point? You can easily decompile it back to a *.py file. Moreover, we want to encourage people to make their code public.
by Ayuto
Thu Jun 04, 2015 9:57 am
Forum: Plugin Development Support
Topic: Angle of Incidence
Replies: 14
Views: 10401

plane.normal returns a Vector object.

Sorry for the short answers. I'm currently in my phone.
by Ayuto
Thu Jun 04, 2015 7:45 am
Forum: Plugin Development Support
Topic: Angle of Incidence
Replies: 14
Views: 10401

I guess you currently only have two points. The player's location and the impact location (which is on the wall). But I think you need another point on the wall, because you can't calculate the angle to a single point. :D
by Ayuto
Wed Jun 03, 2015 7:41 am
Forum: Plugin Development Support
Topic: CSGO: Change nick
Replies: 3
Views: 3464

Yes, it's possible, but requires the memory module. I guess we will add that functionality at some point, so you can just do player.name = <new name>: import memory from memory import Convention from memory import DataType from memory.hooks import PreHook from engines.server import engine_server fro...
by Ayuto
Fri May 29, 2015 7:45 pm
Forum: Plugin Development Support
Topic: how to show name of player that you are pointing to
Replies: 22
Views: 12698

I just read about properties and found a quote of the zen of python, which is obviously a point for you.
There should be one-- and preferably only one --obvious way to do it.
And since we are actually following many proposals, we should think about following that as well.
by Ayuto
Fri May 29, 2015 6:26 pm
Forum: Plugin Development Support
Topic: how to show name of player that you are pointing to
Replies: 22
Views: 12698

We decided that we want to have properties, because we think they are more handy. Do you have any sources for the "usually" in your edit? I have never seen a proposal for that. Though, I should also mention that I didn't search for it. If you are looking for other projects, which are using get_*/set...
by Ayuto
Fri May 29, 2015 9:50 am
Forum: Plugin Development Support
Topic: how to show name of player that you are pointing to
Replies: 22
Views: 12698

The error tells you which types you can pass to the constructor. However, you don't need the pointer thing. Just return trace.get_entity_index().
by Ayuto
Thu May 28, 2015 7:52 pm
Forum: Plugin Development Support
Topic: How to reset the player's sound to normal on player_blind?
Replies: 55
Views: 29031

No, L'In20Cible is right. Here is the proof. https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/src/core/modules/memory/memory_hooks.cpp#L124

If you would just return True or False in a PreHook, what would be the return value for the caller?

Go to advanced search