Players Entity

Please post any questions about developing your plugin here. Please use the search function before posting!
FraggerDown
Junior Member
Posts: 4
Joined: Fri Mar 04, 2016 8:15 pm

Players Entity

Postby FraggerDown » Sun Mar 06, 2016 6:34 pm

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
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Mar 06, 2016 6:49 pm

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)
FraggerDown
Junior Member
Posts: 4
Joined: Fri Mar 04, 2016 8:15 pm

Postby FraggerDown » Sun Mar 06, 2016 7:37 pm

exactly what I expected, Thank you

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 148 guests