if been reworking a restriction system I made and I used this hook to determine which weapon was bought:
Syntax: Select all
"""Called when a player is about to buy something."""
# Get a PlayerEntity object from the pointer passed
player = Player(index_from_pointer(args))
userid = player.userid
# Get the weapon name the player is about to buy
weapon = 'weapon_'+args
The problem is that args does no longer return a weapons name but rather a number. I looked for the WeaponID constants and when I printed args I found that the numbers did not match. AK47 for example is defined as 27 in the constants but when I buy it it prints 15. AWP is defined as 17 but prints 18 for me.
The question is if the data is outdated or if I'm doing something wrong.
Thank you :)