[CSGO] Setting ammo doesn't work
Posted: Tue Apr 12, 2016 8:08 pm
I can't get set_ammo to work in CSGO. Setting the weapon clip works fine, but setting the weapon ammo only changes the ammo count on the UI.
As soon as you either reload or drop and pick up the weapon again, the ammo will revert to the previous value.
Am I messing something up, or is setting ammo broken in CSGO?
As soon as you either reload or drop and pick up the weapon again, the ammo will revert to the previous value.
Syntax: Select all
#set_ammo_test.py
from events import Event
from mathlib import NULL_VECTOR
from entities.entity import Entity
from players.entity import Player
from players.helpers import index_from_userid
from weapons.entity import Weapon
from listeners.tick import Delay
@Event('player_spawn')
def player_setup(game_event):
player = Player(index_from_userid(game_event.get_int('userid')))
for index in player.weapon_indexes():
weapon = Entity(index)
player.drop_weapon(weapon.pointer, NULL_VECTOR, NULL_VECTOR)
weapon.remove()
player.give_named_item('weapon_deagle', 0, None, True)
Delay(0, ammo_setup, player)
def ammo_setup(player):
player.set_secondary_clip(1)
player.set_secondary_ammo(1)
Am I messing something up, or is setting ammo broken in CSGO?