Weapon clip how to

Please post any questions about developing your plugin here. Please use the search function before posting!
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Weapon clip how to

Postby arawra » Thu Jul 16, 2015 5:16 pm

How would I get the current amount of ammo in a weapon's clip?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Jul 16, 2015 5:56 pm

PlayerEntity inherits not only from Entity, but also _PlayerWeapons. Here is the section of that class that involves getting weapon clips:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/players/weapons/__init__.py#L72

You can also use the following to print out all attributes (written in and dynamically added) for PlayerEntity:

Syntax: Select all

for x in dir(PlayerEntity(index)):
print(x)
Image

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 8 guests