Search found 760 matches

by L'In20Cible
Fri Jan 19, 2018 10:22 am
Forum: Plugin Development Support
Topic: Check for custom button to be pressed ?
Replies: 2
Views: 58

Re: Check for custom button to be pressed ?

Unfortunately, this is not possible. Source.Python is a server-side plugin so it relies on the information that is networked and the clients doesn't send anything to the server unless there is a command bound to a key that needs to be send to the server. Binding a key to say_team works because the c...
by L'In20Cible
Thu Jan 18, 2018 9:21 pm
Forum: Plugin Development Support
Topic: SayCommands and args
Replies: 2
Views: 64

Re: SayCommands and args

Hm, command_string works fine for me. from commands.say import SayCommand @SayCommand('test') def _test_command(command, index, team_only=False): if not len(command) > 1: return print('No argument given.') print('command_string =', command....
by L'In20Cible
Thu Jan 18, 2018 5:28 am
Forum: Plugin Development Support
Topic: Getting player properties slow?
Replies: 9
Views: 175

Re: Getting player properties slow?

I think the most efficient way would be to keep a synced dictionary so you don't have to iterate and instantiate every tick. Something like this for example: from entities.helpers import index_from_edict from listeners import OnEntityCreated from listeners import OnTick from players import PlayerGen...
by L'In20Cible
Mon Jan 15, 2018 5:28 pm
Forum: Plugin Development Support
Topic: Players movementspeed
Replies: 7
Views: 115

Re: Players movementspeed

Yep, overlooked that part. :grin:
by L'In20Cible
Mon Jan 15, 2018 4:54 pm
Forum: Plugin Development Support
Topic: Players movementspeed
Replies: 7
Views: 115

Re: Players movementspeed

from events import Event from players.entity import Player @Event('player_spawn') def _player_spawn(game_event): """Fired when a player spawns.""" # Get a Player instance of the player spawning... player = Player.from_userid(game_event.get_i...
by L'In20Cible
Sun Dec 17, 2017 1:27 am
Forum: Plugin Development Support
Topic: Crash when spawning entities from OnLevelInit
Replies: 2
Views: 69

Re: Crash when spawning entities from OnLevelInit

OnLevelInit probably fires too early, try OnServerActivate instead.
by L'In20Cible
Fri Dec 08, 2017 6:05 pm
Forum: Whatever
Topic: Free games!!
Replies: 31
Views: 2893

Re: Free games!!

Thank you! :smile:
by L'In20Cible
Wed Dec 06, 2017 9:20 am
Forum: Plugin Development Support
Topic: Way to reverse the spawn?
Replies: 11
Views: 250

Re: Way to reverse the spawn?

I'm not entirely sure why you are not looking into Player.bump_weapon like previously suggested? It might proves to be more efficient because you already know 0 will be a player and 1 will be a weapon... There is an example there: https://github.com/Source-Python-Dev-Team/Source.Python/blob/c89f0bac...
by L'In20Cible
Wed Dec 06, 2017 5:37 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 16
Views: 271

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

Well, you can see in his code that he is also hooking the Teleport method to ensure that only his calls are passed to the engine: https://github.com/peace-maker/botmimic ... #L701-L709
by L'In20Cible
Wed Dec 06, 2017 5:07 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 16
Views: 271

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

Did you try player.teleport(angles=your_angles) or simply player.set_view_angles(your_angles)?
by L'In20Cible
Wed Dec 06, 2017 4:51 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 16
Views: 271

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

It probably crashes because the BotCmd is not initialized. Does calling bot_cmd.reset() prior to setting the view_angles also crashes? If so, it might be the structures that is outdated for that engine.
by L'In20Cible
Wed Dec 06, 2017 2:12 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 16
Views: 271

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

The difference between UserCmd and BotCmd should not matter here because they are used for different functions. OnPlayerRunCommand is correct to returns a UserCmd even for bots because this is what the original hooked method is called with. You could try any of the following, I guess: from players.b...
by L'In20Cible
Tue Dec 05, 2017 11:07 am
Forum: Plugin Development Support
Topic: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener
Replies: 16
Views: 271

Re: Can't set user_cmd.view_angles in a OnPlayerRunCommand listener

Syntax: Select all

player.angles = Vector(my_val_x, my_val_y, 0.0)
Doesn't works?
by L'In20Cible
Mon Dec 04, 2017 2:44 am
Forum: Code examples / Cookbook
Topic: Stripping weapons
Replies: 45
Views: 9078

Re: Stripping weapons

You should probably call drop_weapon() prior remove() tho so the weapons are no longer mapped in the m_hMyWeapons array for that player. Doesn't matter for Source.Python because we ensure the handles are valid, but other plugins might not and attempt to manipulate them.
by L'In20Cible
Sun Dec 03, 2017 5:29 am
Forum: Plugin Releases
Topic: Parachute v0.03!
Replies: 38
Views: 4663

Re: Parachute v0.03!

I've just updated to v0.03 which adds the delay workaround. I recommend it over the code I posted above because it use Player.delay which will ensure the delay is tracked and cancelled if needed (should not matters, but just to be safe ;)).
by L'In20Cible
Sun Dec 03, 2017 5:10 am
Forum: Plugin Releases
Topic: Parachute v0.03!
Replies: 38
Views: 4663

Re: Parachute v0.02!

If you see error models, that means your client didn't download the models. This can be caused by the server being unable to push the files because it doesn't have the correct permissions for the models/materials folders and cannot generate the ztmp files. This can also be caused by your client igno...
by L'In20Cible
Sun Dec 03, 2017 4:09 am
Forum: Plugin Releases
Topic: Parachute v0.03!
Replies: 38
Views: 4663

Re: Parachute v0.02!

The following should do it, I guess: # ../addons/source-python/plugins/parachute/parachute.py # ============================================================================ # >> IMPORTS # ============================================================================ # Python Imports # Math from math i...

Go to advanced search