Search found 793 matches

by L'In20Cible
Sun Aug 19, 2018 2:09 am
Forum: Plugin Development Support
Topic: Weapons
Replies: 2
Views: 44

Re: Weapons

satoon101 wrote:I think there is also a client command you can call in your plugin which will change their weapon based on the weapon string, but I don't remember it off hand.

If I remember correctly, that would be the following command:

Syntax: Select all

player.client_command('use weapon_knife', server_side=True)
by L'In20Cible
Fri Aug 17, 2018 6:06 am
Forum: Plugin Development Support
Topic: Bounding box
Replies: 17
Views: 227

Re: Bounding box

When it comes to the model, isn't it irrelevant what the model itself is? The trigger_multiple is a brush entity, so the model shouldn't matter, right? I'm not 100% sure on this, which is why I took your advice and changed it to use the player model. It is more than important. The model is the shap...
by L'In20Cible
Thu Aug 16, 2018 11:23 pm
Forum: Plugin Development Support
Topic: Bounding box
Replies: 17
Views: 227

Re: Bounding box

Nice! I have a few points though. First of all, the model: TRIGGER_MODEL = Model('models/props/cs_assault/money.mdl') I don't think using a random model is a good idea because depending of the angles it will parent, you may end with the parented trigger being slightly off the player....
by L'In20Cible
Wed Aug 15, 2018 11:21 pm
Forum: Plugin Development Support
Topic: Changing entity move collide
Replies: 3
Views: 49

Re: Changing entity move collide

velocity wrote:Server crash when I try to do Entity(index).get_property_int('m_MoveCollide').

Complete code? It is unlikely to crash cause of that line, so the crash must be somewhere else.
by L'In20Cible
Wed Aug 15, 2018 7:11 pm
Forum: Plugin Development Support
Topic: Changing entity move collide
Replies: 3
Views: 49

Re: Changing entity move collide

Run the following command:

Code: Select all

sp dump server_classes classes;sp dump datamaps datamaps

Then check the classes.txt and datamaps.txt files generated into the ../logs/source-python directory. A little hint, MoveCollide is an Enum so their values are integer.
by L'In20Cible
Mon Aug 13, 2018 3:03 pm
Forum: Plugin Development Support
Topic: Check if entity exists
Replies: 2
Views: 70

Re: Check if entity exists

You should not store Entity instances unless you use a container designed to keep them up-to-date such as EntityDictionary . To validate whether or not an instance is still valid, you would have to loop through all existing entities and compare their address which can get quite slow if you validate ...
by L'In20Cible
Sun Aug 12, 2018 3:57 pm
Forum: Plugin Development Support
Topic: Changing entity collision group?
Replies: 6
Views: 59

Re: Changing entity collision group?

Entity inherits from BaseEntity: _base.py#L73. So yes, everything available in BaseEntity is available for Entity but not the other way around (see Entity as being an extended version of BaseEntity).
by L'In20Cible
Sun Aug 12, 2018 3:39 pm
Forum: Plugin Development Support
Topic: Changing entity collision group?
Replies: 6
Views: 59

Re: Changing entity collision group?

This is not a float. That being said, that property is aliased: CBaseEntity.ini#L76

Syntax: Select all

Entity(index).collision_group
by L'In20Cible
Sat Aug 04, 2018 1:50 am
Forum: Plugin Development Support
Topic: How to use PlayerDictionary?
Replies: 2
Views: 61

Re: How to use PlayerDictionary?

You don't have to clear the dictionary yourself. As soon as the player entities are deleted, they are removed from the dictionary and all entities are freed on new map.
by L'In20Cible
Fri Aug 03, 2018 2:48 am
Forum: Plugin Development Support
Topic: hooking "prethink" only runs when ducking [TF2]
Replies: 7
Views: 122

Re: hooking "prethink" only runs when ducking [TF2]

The offsets are outdated it seems. Should be 337 and 336: https://github.com/Source-Python-Dev-Team/Source.Python/blob/58cda0e4eb89ca8d9608e8cab1c64db34a971bdb/addons/source-python/data/source-python/entities/orangebox/tf/CBasePlayer.ini#L9-L12 Feel free to use this tool to update them and submit a ...
by L'In20Cible
Wed Jul 18, 2018 7:16 am
Forum: Plugin Development Support
Topic: Set "lastinv"
Replies: 2
Views: 66

Re: Set "lastinv"

by L'In20Cible
Tue Jul 10, 2018 11:48 pm
Forum: Plugin Development Support
Topic: Hooked 'end_touch' function crashes server when weapon is picked up
Replies: 4
Views: 155

Re: Hooked 'end_touch' function crashes server when weapon is picked up

I don't know if it has any negative impact on game logic. It can have some negative impact for some entities, depending of their parenting chain. What you want to do is add the following in your pre-hook callback so that it notice the parent that the touching have ended: # Get the parent of the ent...
by L'In20Cible
Thu Jul 05, 2018 10:21 pm
Forum: Plugin Development Support
Topic: Hooked 'end_touch' function crashes server when weapon is picked up
Replies: 4
Views: 155

Re: Hooked 'end_touch' function crashes server when weapon is picked up

The crash occurs because the end_touch method is calling itself for the parent of the this pointer. You need to block the original call and call the method for the parent yourself without invoking the hook. Here is an example for the "touch" method: https://forums.sourcepython.com/viewtopi...
by L'In20Cible
Thu Jun 14, 2018 3:34 am
Forum: Plugin Requests
Topic: [Hldms] Entity remover, to remove "doubles"
Replies: 5
Views: 254

Re: [Hldms] Entity remover, to remove "doubles"

You could try that: https://github.com/Ayuto/EventScripts-Emulator

Or you could post the ES codes you are using in the Plugin Requests section and someone might be able to convert them to SP.
by L'In20Cible
Wed May 30, 2018 7:19 am
Forum: Plugin Development Support
Topic: No max function...?
Replies: 1
Views: 114

Re: No max function...?

You are redefining it on that line:

Syntax: Select all

max = 100 * attacker.getLevel()

Use a different name for your variable.
by L'In20Cible
Sat May 05, 2018 10:07 am
Forum: Plugin Development Support
Topic: how to catch the halftime
Replies: 5
Views: 251

Re: how to catch the halftime

You could always keep a count yourself I guess. Something like this maybe (untested): from cvars import ConVar from events import Event from listeners import OnLevelInit mp_maxrounds = ConVar('mp_maxrounds') rounds_played = int() @OnLevelInit def on_level_init(map_name...
by L'In20Cible
Sat May 05, 2018 3:51 am
Forum: Plugin Development Support
Topic: Remove Weapon on Disconnect
Replies: 3
Views: 186

Re: Remove Weapon on Disconnect

Kami wrote:Found a small typo I think.

Syntax: Select all

for weapon in player.weapons:
weapon.remove()


results in an TypeError.

It should be player.weapons() I think

Fixed, thanks!
by L'In20Cible
Fri May 04, 2018 7:16 am
Forum: Plugin Development Support
Topic: Remove Weapon on Disconnect
Replies: 3
Views: 186

Re: Remove Weapon on Disconnect

Not sure if the OnClientDisconnect listener is fired too late to iterate over his weapons but the following event should be fired early enough to do so (untested): from events import Event from players.entity import Player @Event('player_team') def player_team(game_event): if...
by L'In20Cible
Tue May 01, 2018 2:09 am
Forum: Plugin Development Support
Topic: How to get map info
Replies: 6
Views: 269

Re: How to get map info

You can also use the WORLD_ENTITY_INDEX constant, and the world_mins/world_maxs properties:

Syntax: Select all

from entities.constants import WORLD_ENTITY_INDEX
from entities.entity import Entity

world_entity = Entity(WORLD_ENTITY_INDEX)
mins = world_entity.world_mins
maxs = world_entity.world_maxs

Go to advanced search