PlayerEntity's properties broken?

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

PlayerEntity's properties broken?

Postby Mahi » Mon Feb 02, 2015 1:00 pm

This used to work a week or two ago:

Syntax: Select all

from players.entity import PlayerEntity
from players.helpers import index_from_userid
from events import Event

@Event
def player_spawn(game_event):
entity = PlayerEntity(index_from_userid(game_event.get_int('userid')))
entity.health += 50

But today when I tried, I get the following error:
[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\test\test.py', line 8, in player_spawn
entity.health += 50
File '..\addons\source-python\packages\source-python\entities\entity.py', line
83, in __getattr__
raise AttributeError('Attribute '{0}' not found'.format(attr))

AttributeError: Attribute 'health' not found

Same happens for 'speed', didn't try others but I guess there are others too.
Is it mine or Source.Python's fault? Any fixes?
User avatar
satoon101
Project Leader
Posts: 2703
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Feb 02, 2015 5:22 pm

I am assuming this is for CS:GO, correct? We are working on adding more to the entities data for that game to catch it back up to where it was.
http://forums.sourcepython.com/showthread.php?737
Image
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Tue Feb 03, 2015 4:02 pm

Ah yes, it's for CS:GO. Okay thanks, good to know :)

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 84 guests