Cancel GameEvent
Cancel GameEvent
Is there currently a way to cancel/block/stop broadcast on a game event?
I just now realized that those 2 scripts won't fully work with the newest version of SP. There have been some name changes since then. GameEventManager has been changed to game_event_manager. Also, both Argument and Return have been combined into DataType. So, it would now look more like this:
Syntax: Select all
from memory import get_object_pointer
from memory import make_object
from memory import Convention
from memory import DataType
from events import GameEvent
from events.manager import game_event_manager
from memory.hooks import PreHook
from core import PLATFORM
FIRE_EVENT_FUNC = get_object_pointer(
game_event_manager).make_virtual_function(
7 if PLATFORM == 'windows' else 8,
Convention.THISCALL,
(DataType.POINTER, DataType.POINTER, DataType.BOOL),
DataType.VOID
)
@PreHook(FIRE_EVENT_FUNC)
def pre_fire_event(arguments):
game_event = make_object(GameEvent, arguments[1])
if game_event.get_name() == 'player_death':
arguments[2] = True
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 117 guests