def set_sending_packets(self, status=True): win32.write_memory( self.game, self.engine + self.offset['signatures']['dwbSendPackets'], constant.STATE_SENDING_PACKETS_ENABLE if status else constant.STATE_SENDING_PACKETS_DISABLE, 'b') return True
def set_right(self, status=True): if not self.is_alive(): return False win32.write_memory( self.game, self.client + self.offset['signatures']['dwForceRight'], constant.STATE_MOVING_ENABLE if status else constant.STATE_MOVING_DISABLE, 'i') return True
def set_flash_alpha(self, value): if not self.is_alive(): return False win32.write_memory( self.game, self._get_offset() + self.offset['netvars']['m_flFlashMaxAlpha'], float(value), 'f') return True
def set_flags(self, value): flag = 0 if isinstance(value, int): flag = value else: flag = value.compile() win32.write_memory(self.pycsapi.game, self.address + 0x14, flag, 'i') return True
def set_bspotted(self, status=True): if not self.is_player() or not self.is_alive(): return False win32.write_memory( self.game, self._get_offset() + self.offset['netvars']['m_bSpotted'], constant.STATE_SPOTTED if status else constant.STATE_NOT_SPOTTED, 'b') return True
def set_view_angle(self, x, y): if not self.is_alive(): return False win32.write_memory( self.game, self._get_engine_pointer() + self.offset['signatures']['dwClientState_ViewAngles'], x, 'f') win32.write_memory( self.game, self._get_engine_pointer() + self.offset['signatures']['dwClientState_ViewAngles'] + constant.TYPE_FLOAT_SIZE, y, 'f') return True
def set_string(self, value): convar_string_entry = win32.read_memory(self.pycsapi.game, self.address + 0x24, 'i') win32.write_memory(self.pycsapi.game, convar_string_entry, value, 'c', len(value)) for i in range(len(value), constant.CONVAR_STRING_SIZE): char = win32.read_memory(self.pycsapi.game, convar_string_entry + i, 'c') if char != b'\x00': win32.write_memory(self.pycsapi.game, convar_string_entry + i, 0, 'b') else: break return True
def set_int(self, value): win32.write_memory(self.pycsapi.game, self.address + 0x30, value + self.address, 'i') return True
def set_float(self, value): win32.write_memory(self.pycsapi.game, self.address + 0x2C, value + self.address, 'f') return True
def set_glow(self, color=(255, 255, 255, 255)): if not self.player.is_alive() or not self.is_alive( ) or not self.player.get_team_id(): return False if len(color) == 3: color = (color[0], color[1], color[2], 255) elif len(color) != 4: color = (255, 255, 255, 255) r, g, b, a = color[0] / 255, color[1] / 255, color[2] / 255, color[ 3] / 255 if r > 1.0 or r < 0.0: r = 1.0 if g > 1.0 or g < 0.0: g = 1.0 if b > 1.0 or b < 0.0: b = 1.0 if a > 1.0 or a < 0.0: a = 1.0 entity_glow_index = win32.read_memory( self.game, self._get_offset() + self.offset['netvars']['m_iGlowIndex'], 'i') glow_pointer = win32.read_memory( self.game, self.client + self.offset['signatures']['dwGlowObjectManager'], 'i') win32.write_memory( self.game, glow_pointer + (entity_glow_index * constant.GLOW_INDEX_SIZE) + constant.TYPE_FLOAT_SIZE, r, 'f') win32.write_memory( self.game, glow_pointer + (entity_glow_index * constant.GLOW_INDEX_SIZE) + constant.TYPE_FLOAT_SIZE * 2, g, 'f') win32.write_memory( self.game, glow_pointer + (entity_glow_index * constant.GLOW_INDEX_SIZE) + constant.TYPE_FLOAT_SIZE * 3, b, 'f') win32.write_memory( self.game, glow_pointer + (entity_glow_index * constant.GLOW_INDEX_SIZE) + constant.TYPE_FLOAT_SIZE * 4, a, 'f') win32.write_memory( self.game, glow_pointer + (entity_glow_index * constant.GLOW_INDEX_SIZE) + 0x24, 1, 'i') win32.write_memory( self.game, glow_pointer + (entity_glow_index * constant.GLOW_INDEX_SIZE) + 0x25, 0, 'i') return True