Search found 200 matches

by Doldol
Tue Jan 05, 2016 5:47 am
Forum: Plugin Development Support
Topic: Hooking CPointServerCommand::InputCommand
Replies: 2
Views: 2854

Hooking CPointServerCommand::InputCommand

I'm trying to hook the InputCommand command function but it doesn't show up in the main virtual table for CPointServerCommand. Instead the xrefs window points me to this, which seemed to be what I wanted, looking at it in the xrefs window. But when I browse to it I find it by it's lonesome seemingly...
by Doldol
Mon Jan 04, 2016 12:30 am
Forum: Code examples / Cookbook
Topic: Ending a round.
Replies: 6
Views: 21251

I updated the snipped, I think it really shows the progress SP made, since now the snippet is reduced to only really 2 lines of significant code, haha.
by Doldol
Mon Dec 28, 2015 10:37 pm
Forum: Plugin Development Support
Topic: Getting player instance in set_name hook.
Replies: 2
Views: 2704

Thanks! Especially for the offset tip, I'll be using that!
by Doldol
Sun Dec 27, 2015 9:05 pm
Forum: Plugin Development Support
Topic: Getting player instance in set_name hook.
Replies: 2
Views: 2704

Getting player instance in set_name hook.

Is there a better/more efficient way of doing this? Specifically, can I go from a CBaseClient pointer to a player index/pointer/instance with a SP conversion function? from memory import make_object, get_object_pointer from memory.hooks import PreHook from entities.helpers import index_from_edict fr...
by Doldol
Sun Dec 20, 2015 9:10 pm
Forum: Plugin Development Support
Topic: Port of IPToCountry and some questions to port from ES To SP
Replies: 25
Views: 16428

Btw, I threw this together kind of quickly, it's a wrapper around geoip2, it downloads and keeps the database updated (uses threading to do this) & contains an example.

The attachment geoip2sp.zip is no longer available
by Doldol
Sun Dec 20, 2015 7:27 pm
Forum: Plugin Development Support
Topic: Port of IPToCountry and some questions to port from ES To SP
Replies: 25
Views: 16428

Working example: from pprint import pprint from zipfile import ZipFile from contextlib import closing from urllib.request import urlopen from io import StringIO, BytesIO import csv with closing(urlopen('http://software77.net/geo-ip?DL=2')) as u: data = u.read() zip_fi...
by Doldol
Sun Dec 20, 2015 6:45 pm
Forum: Plugin Development Support
Topic: Port of IPToCountry and some questions to port from ES To SP
Replies: 25
Views: 16428

Actually, had a bit of time to do some testing this morning. Haven't figured out myself, but here is full reproducible code: You'll have to use BytesIO instead of StringIO, since you're downloading binary data. Edit: But that doesn't make sense as u.read() should already return a bytes object, I tr...
by Doldol
Sun Dec 20, 2015 10:25 am
Forum: Plugin Development Support
Topic: SQL anyone?
Replies: 11
Views: 8077

Well, I'll hapilly ship my own plugin with PyMySQL and SQLAlchemy, but what happens if every other plugin comes with its own stuff to the site-packages directory? One plugin uses PyMySQL vX.X, another one vY.Y, the third one vZ.Z etc. They will override each other and we will end up with conflictin...
by Doldol
Sun Dec 20, 2015 9:37 am
Forum: Plugin Development Support
Topic: SQL anyone?
Replies: 11
Views: 8077

Well there is a site-packages directory for this, it'd be silly to include any of the choices in the default SP installation/build package. This isn't really part of the core functionality of SP, if you wanted to make it so it is then you'd need to come up with a threaded wrapper for it anyway. I'd ...
by Doldol
Fri Dec 18, 2015 3:59 pm
Forum: Plugin Development Support
Topic: More questions
Replies: 26
Views: 17914

Thanks for pointing out those improvements! :)
by Doldol
Fri Dec 18, 2015 3:59 am
Forum: Plugin Development Support
Topic: More questions
Replies: 26
Views: 17914

Urh, I want to answer but it's a mess sifting through numbered replies, as everyone has stated already, please, please, create multiple topics when the questions aren't related! 8. How can i check if a player is onGround (couldnt find anything on forum/wiki) This is the property: from players.entity...
by Doldol
Thu Dec 17, 2015 8:41 pm
Forum: Plugin Development Support
Topic: Port of IPToCountry and some questions to port from ES To SP
Replies: 25
Views: 16428

Why don't you just use a readily-available geoip library? e.g. https://pypi.python.org/pypi/geoip2
by Doldol
Wed Dec 09, 2015 3:53 pm
Forum: General Discussion
Topic: SP CSGO server crash (After CSGO update 2015/12/08)
Replies: 5
Views: 5034

SP CSGO server crash (After CSGO update 2015/12/08)

After the SourcePython loading message this displays, then the server crashes (Win 8.1, most recent SP): Seeded random number generator @ 1057344291 ( 0.523 )Failed to load gamerulescvars.txt, game rules cvars might not be reported to management tools. Server is hibernating No web api auth key speci...
by Doldol
Wed Dec 09, 2015 3:42 am
Forum: Plugin Requests
Topic: Snowfall for Black Mesa
Replies: 29
Views: 21522

Hi mates, could someone take a look at it again? This works in CSGO for me, but as said crashes CSS with a C++ error message, maybe CSS does some optimisation @ map compile time? I guess you could test this out in Black Mesa? from events import Event from entities.entity import Entity from entities...
by Doldol
Mon Dec 07, 2015 1:04 am
Forum: Code examples / Cookbook
Topic: Particle effects!
Replies: 36
Views: 85863

Also found a post at AlliedModders claiming that CS:S is something special in this case: Unfortunately, the guy and his friend don't want to publish the code. So a sigscanned/virtual offset function? I don't see how the number of dll's loaded would change anything. You can't magically make the clie...
by Doldol
Mon Dec 07, 2015 12:55 am
Forum: Plugin Development Support
Topic: SourceMod Access
Replies: 4
Views: 4986

Sockets anyone? I'm pretty sure SM supports those and Python (and by extension SourcePython) surely does. Source server commands are usually not secure enough, anyone with the RCON password could mess with the internals of a program, which is something you don't want.
by Doldol
Sat Nov 28, 2015 11:53 am
Forum: Code examples / Cookbook
Topic: Creating and manually firing VMF-like output connections
Replies: 11
Views: 27104

I actually misread a lot in your suggestion, Doldol, I was sleepy (and I am), and I made some significant changes to my previous post. Main things changed: 1. I don't get the point of taking the target pattern out of the rest of the connection: "floor1_relay": ["Disable",False,0...
by Doldol
Fri Nov 27, 2015 7:46 am
Forum: Code examples / Cookbook
Topic: Creating and manually firing VMF-like output connections
Replies: 11
Views: 27104

Yes, later I learned about delays, but haven't got around to actually removing that tick_delays part. Regarding to keeping track of how many times it was fired, well, here you need some instance to track. Because you can't judge if this is the same output connection or not only by its arguments. Sa...
by Doldol
Thu Nov 26, 2015 6:45 pm
Forum: Code examples / Cookbook
Topic: Creating and manually firing VMF-like output connections
Replies: 11
Views: 27104

Thirdly, I didn't know .call_input natively supports delays and counts how many times it was fired. Actually, how would it count that? AFAIK it does indeed support delaying (You are still passing the same arguments to outputs, if delay is included in them, you can obviously use it.), but I don't kn...
by Doldol
Sun Nov 22, 2015 11:27 pm
Forum: General Discussion
Topic: SP crashing server No global pointer found for "Server"
Replies: 4
Views: 4193

I updated from an older build to 141. I deleted everything in /addons then extracted the addons folder from the archive into addons, saw a crash, repeated the same process for build 140, everything worked. I'll try again to make sure I didn't mess something up. Edit: Indeed my mistake, whoopsie. Bui...

Go to advanced search