Source-Python-Dev-Team / Source.Python

This plugin aims to use boost::python and create an easily accessible wrapper around the Source Engine API for scripter use.
http://forums.sourcepython.com
GNU General Public License v3.0
163 stars 31 forks source link

Fixed an issue with certain weapons restrictions not working properly. #431

Closed CookStar closed 2 years ago

CookStar commented 3 years ago

Classname of a certain weapons cannot be obtained by normal way.

https://developer.valvesoftware.com/wiki/Weapon_cz75a

weapon_cz75a is a point entity available in Counter-Strike: Global Offensive . Warning: In the I/O system and in VScript, this entity is targeted with the classname weapon_p250 instead!

Code:

#   Weapons
from weapons.entity import Weapon

weapon_entity = Weapon.create("weapon_cz75a")

print("Weapon ClassName: ", weapon_entity.weapon_name)
print("Edict ClassName: ", weapon_entity.edict.classname)

Output:

Weapon ClassName:  weapon_cz75a
Edict ClassName:  weapon_p250