Реагирует на событие атаки и показывает, кого и насколько ударили.
from rockstar import Module, event
class HitNotify(Module):
name = "HitNotify"
category = "Combat"
description = "Уведомления при ударе по противнику"
def __init__(self):
super().__init__()
self.sound = self.add_bool("Звук", default=True)
@event("attack")
def on_attack(self, entity):
self.notify(f"Удар по {entity.name} — осталось {entity.health:.1f} hp")
if self.sound.value:
self.client.play_sound("hit")Пример HUD-отрисовки: выводит координаты игрока в углу экрана.
from rockstar import Module, event
class CoordsHUD(Module):
name = "CoordsHUD"
category = "Render"
def __init__(self):
super().__init__()
self.color = self.add_color("Цвет текста", default=0x6A6AE0)
@event("render2d")
def on_render(self, ctx):
p = self.client.player.position
ctx.text(10, 10, f"XYZ: {p.x:.1f} {p.y:.1f} {p.z:.1f}", color=self.color.value)Рисует боксы вокруг всех игроков в мире. Пример отрисовки в 3D.
from rockstar import Module, event
class EntityESP(Module):
name = "EntityESP"
category = "Render"
def __init__(self):
super().__init__()
self.color = self.add_color("Цвет бокса", default=0xE93A57)
self.distance = self.add_slider("Дистанция", default=64, min=16, max=128)
@event("render3d")
def on_render(self, ctx):
for entity in self.client.world.players:
if entity.distance < self.distance.value:
ctx.box(entity, color=self.color.value)