Closed
Description
I want to get "desired_player_class" using the following code:
from commands import CommandReturn
from commands.client import ClientCommand
from players.entity import Player
@ClientCommand('sp_desired_class')
def print_desired_class(command, index):
player = Player(index)
desired_class = player.desired_player_class
print(f'[DEBUG] Desired player class - {desired_class}')
return CommandReturn.BLOCK
But I get the error:
[Source.Python]
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\commands\auth.py", line 44, in __call__
return self.callback(*args)
File "..\addons\source-python\plugins\dod_desired_class\dod_desired_class.py", line 9, in print_desired_class
desired_class = player.desired_player_class
ValueError: Unable to find property 'm_Shared.m_iDesiredPlayerClass'.
I guess it's because of this:
Then I've tried to add this property to this file:
Like this:
[property]
ragdoll = m_hRagdoll
# DOD:S has another path to "desired player class"
desired_player_class = m_Shared.dodsharedlocaldata.m_iDesiredPlayerClass
[[eye_angle]]
name = m_angEyeAngles[0]
type = QAngle
But this property doesn't work either, looks like SP won't override it
Metadata
Metadata
Assignees
Labels
No labels