Page 1 of 1

Players Entity

Posted: Sun Mar 06, 2016 6:34 pm
by FraggerDown
Good afternoon, I'm starting to develop plugins with sp.

At first, as a form of apprenticeship, I'm trying to create my own reset score, show damage, and other simple things.

I downloaded some addons and found some properties related to the player entity. but I wanted to see all... Where can I find these packages?

I tried to dump the entity player in many ways...

Code: Select all

from players.entity import Player

def load():
   player = Player (1)
   print (vars (player))



however I expect to receive all the attributes, but I got this:
{'_index': 1, '_playerinfo': None, '_edict': None, '_pointer': None}

I have some experience with php and javascript.
If someone can show me a good starting point

Posted: Sun Mar 06, 2016 6:49 pm
by Ayuto
In Python you usually use "help(<object>)".

Syntax: Select all

from players.entity import Player

help(Player)
However, the Entity/Player class is a special one, because it adds in attributes dynamically depending on the entity type. You can use "dir(<object>)" to print these attributes.

Syntax: Select all

from players.entity import Player

for x in sorted(dir(Player(1))):
print(x)

Posted: Sun Mar 06, 2016 7:37 pm
by FraggerDown
exactly what I expected, Thank you