set_color error
Posted: Tue May 06, 2014 4:34 pm
Exception
Code:
- I've tried with and without alpha same thing.
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File '../addons/source-python/packages/source-python/events/listener.py', line 84, in fire_game_event
callback(game_event)
File '../addons/source-python/plugins/tuck/tuck.py', line 40, in player_spawn
player.set_color((255, 0, 0, 255))
File '../addons/source-python/packages/source-python/entities/entity.py', line 314, in set_color
self.rendermode = self.rendermode | 1
File '../addons/source-python/packages/source-python/entities/entity.py', line 237, in __setattr__
self.datamaps[attr]._set_value(value)
File '../addons/source-python/packages/source-python/entities/datamaps.py', line 365, in _set_value
getattr(self.current_pointer, self.set_attr)(value, self.offset)
Boost.Python.ArgumentError: Python argument types in
Pointer.set_char(Pointer, int, int)
did not match C++ signature:
set_char(CPointer {lvalue}, char, int offset=0)
Code:
- I've tried with and without alpha same thing.
Syntax: Select all
from events import Event
from players.helpers import index_from_userid
from players.entity import PlayerEntity
@Event
def player_spawn(GameEvent):
userid = GameEvent.get_int('userid')
index = index_from_userid(userid)
player = PlayerEntity(index)
if not player.isdead and player.name == 'Tuck':
player.set_color((255, 0, 0))