Search found 1413 matches
- Fri Jun 03, 2016 5:35 pm
- Forum: Development Status Updates
- Topic: Development status update (May 2016)
- Replies: 1
- Views: 4139
Development status update (May 2016)
It's time for another development status update! :smile: ⋅ Fixes: ⋅ Fixed issue with char SendProp types being retrieved and set as integers. ⋅ Fixed getting/setting char properties. ⋅ Fixed issue #125. ⋅ Fixed issue #127. ⋅ Additions: ...
- Fri Jun 03, 2016 5:17 pm
- Forum: Plugin Development Support
- Topic: Pickle Save Dict
- Replies: 9
- Views: 6868
Re: Pickle Save Dict
I have added pickle support for the mathlib classes, so pickling Vector instances will work with version 345:
https://github.com/Source-Python-Dev-Te ... 36c5f685e5
https://github.com/Source-Python-Dev-Te ... 36c5f685e5
- Fri Jun 03, 2016 8:48 am
- Forum: Plugin Development Support
- Topic: Pickle Save Dict
- Replies: 9
- Views: 6868
Re: Pickle Save Dict
You can work around that issue by converting the Vector instances to a tuple when you want to save it. Then, when you read it, you simply create Vector instances from the tuples.
- Thu Jun 02, 2016 9:20 pm
- Forum: Plugin Development Support
- Topic: QAngle to Vector
- Replies: 1
- Views: 2278
Re: QAngle to Vector
The easiest way to convert a QAngle instance to a Vecor is the following:
That should work perfectly fine.
Syntax: Select all
angle = QAngle(0, -90, 0)
vector = Vector(*angle)
- Thu Jun 02, 2016 5:44 pm
- Forum: Plugin Development Support
- Topic: Events vs. Listeners
- Replies: 6
- Views: 5183
Re: Events vs. Listeners
Well, I think OnClientDisconnect/player_disconnect and OnClientActive/player_activate are pretty much the only duplicates where an event and a listener exist. Since I don't know any downsides go with whatever you prefer.
- Thu Jun 02, 2016 5:36 pm
- Forum: Plugin Development Support
- Topic: Events vs. Listeners
- Replies: 6
- Views: 5183
Re: Events vs. Listeners
Am I right to assume that the event 'player_disconnect' is fired after the listener 'OnClientDisconnect' has been called? A quick test has shown that the event is getting fired before the listener is called. The reason why we have added listeners is because there are callbacks in the engine for whi...
- Thu Jun 02, 2016 5:15 pm
- Forum: Plugin Development Support
- Topic: Create beam and play sound around player
- Replies: 3
- Views: 3158
Re: Create beam and play sound around player
Use engines.sound.Sound for the sound and pass the "index" parameter to emit the sound from a specific entity. A beam always has a start and an end. See the documentation for more info: http://builds.sourcepython.com/job/Source.Python%20-%20Documentation/lastSuccessfulBuild/artifact/cstrik...
- Mon May 30, 2016 9:33 am
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
If you want to use a hook, try this:
viewtopic.php?f=20&p=7857#p7838
That's exactly the "beautiful" solution you are looking for.
viewtopic.php?f=20&p=7857#p7838
That's exactly the "beautiful" solution you are looking for.
- Sun May 29, 2016 9:15 pm
- Forum: Plugin Development Support
- Topic: CS:GO server_cvar event for created ConVar
- Replies: 2
- Views: 3135
Re: CS:GO server_cvar event for created ConVar
The server_cvar event only gets fired for ConVars that have the NOTIFY flag. I recommend to use OnConVarChanged if you don't want to add that flag.
- Sun May 29, 2016 9:13 pm
- Forum: Plugin Development Support
- Topic: BotCmd and bot_manager
- Replies: 4
- Views: 3642
Re: BotCmd and bot_manager
Yeah, that might be possible with a tick listener and BotController.run_player_move(). But I have never tried that.
- Sun May 29, 2016 6:05 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
Meanwhile props to Ayuto for showing the way how to use EntityPreHook (with EntityCondition) with custom virtual functions. Now I don't need to use memory's PreHook for simple entity hooks anymore. I have already used this a few weeks ago. :tongue: http://forums.sourcepython.com/viewtopic.php?f=20&...
- Sun May 29, 2016 5:51 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
My tests have shown that the performance increase is neglegible. This is my test library code (see attachment for a compiled binary): #include <stdio.h> #define EXPORT extern "C" __declspec(dllexport) EXPORT int f1(int x, int y) { puts("f1"); return x * y;...
- Sun May 29, 2016 4:22 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
but i guess that depends on the individual usage of the function, that is getting "Nop'ed". Not the function (RemoveAmmo) is filled with NOP instructions, but all calls to RemoveAmmo. Imagine this is the reload function, which calls RemoveAmmo() at some point. ; More ASM code... mov ecx, ...
- Sun May 29, 2016 3:35 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
You would try to find all calls to that method and use <Pointer object>.set_uchar(0x90) to set the NOP instruction (0x90 is the byte code for a NOP instruction in x86 code). But like I said: this is a tremendous work and quite difficult with virtual functions, because IDA doesn't show you the calls ...
- Sun May 29, 2016 3:16 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
[...] replace the content with 0 [...] The 0 just tells SP to block the original method from executing. That means the hook will simply jump back to the caller. Registers are used as temporary storage for single values, passing parameters and returning values. They do not store the implementation o...
- Sun May 29, 2016 2:22 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
[...] maybe find the respective register in memory [...] Are you sure you mean register? But yeah, you can hook the RemoveAmmo() method and simply block it from executing. There is no need to do anything more. But again: it requires you to use additional game data, which I would avoid if possible, ...
- Sat May 28, 2016 1:33 pm
- Forum: Plugin Development Support
- Topic: BotCmd and bot_manager
- Replies: 4
- Views: 3642
- Sat May 28, 2016 1:25 pm
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
BackRaw wrote:This way, the ammo will not reset after the weapon has been reloaded, for example with the AK47:
Yeah, I know, but it's less error prone than using the delay method.
- Sat May 28, 2016 11:26 am
- Forum: Plugin Development Support
- Topic: OnWeaponReloaded listener?
- Replies: 35
- Views: 24746
Re: OnWeaponReloaded listener?
Seems like my hook never gets called. :( What about something like this? from events import Event from entities.helpers import index_from_inthandle from players.entity import Player from weapons.entity import Weapon from weapons.manager import weapon_manager @Event('weapon_reload') d...
- Fri May 27, 2016 2:16 pm
- Forum: General Discussion
- Topic: Server took too long to process (probably infinite loop).
- Replies: 1
- Views: 3209
Re: Server took too long to process (probably infinite loop).
Have you tried disabling SP? If that eliminates the issue, try to find out which SP plugin causes the issue.