BaseEntity(index).owner error

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

BaseEntity(index).owner error

Postby BackRaw » Wed Jan 28, 2015 1:01 am

Hi,

I'm getting this error

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File '../addons/source-python/packages/source-python/events/listener.py', line 90, in fire_game_event
    callback(game_event)
  File '../addons/source-python/plugins/simpledm/simpledm.py', line 193, in player_death
    for idle in filter(lambda x: x.owner == -1, entityiter_idle):
  File '../addons/source-python/plugins/simpledm/simpledm.py', line 193, in <lambda>
    for idle in filter(lambda x: x.owner == -1, entityiter_idle):
  File '../addons/source-python/packages/source-python/entities/entity.py', line 83, in __getattr__
    raise AttributeError('Attribute '{0}' not found'.format(attr))
 
AttributeError: Attribute 'owner' not found
everytime I try this:

Syntax: Select all

from filters.entities import EntityIter
from entities.helpers import remove_entity
from events import Event

# generator for idle weapons
entityiter_idle = EntityIter("weapon_", False, "entity")


@Event
def player_death(game_event):

for idle in filter(lambda x: x.owner == -1, entityiter_idle):
remove_entity(idle.index)
What's wrong here?

EDIT: Using the January 17 release
My Github repositories:

Source.Python: https://github.com/backraw
User avatar
satoon101
Project Leader
Posts: 2703
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Jan 28, 2015 1:52 am

Which game is this for? If it is for CS:S, make sure when you updated SP last that you also updated the ../addons/source-python/data/source-python/entities/ directory. If it is for CS:GO, then the 'owner' property was not added until after the latest release.
Image
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Wed Jan 28, 2015 5:13 pm

It's for CS:S. Okay I'll check :)
My Github repositories:

Source.Python: https://github.com/backraw
User avatar
BackRaw
Senior Member
Posts: 537
Joined: Sun Jul 15, 2012 1:46 am
Location: Germany
Contact:

Postby BackRaw » Thu Jan 29, 2015 12:28 am

Works now. :D
My Github repositories:

Source.Python: https://github.com/backraw

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 108 guests