StopScript
Sends a request to stop a specific running script by its index.
ScriptIndex — zero-based index of the script in the scripts pool.
The stop is performed asynchronously via the character event queue.
Use GetScriptsCount (Python: GetScriptCount) and GetScriptsList to find the index of the target script.
Отправляет запрос на остановку конкретного скрипта по его индексу.
ScriptIndex — индекс скрипта (с нуля) в пуле скриптов.
Остановка выполняется асинхронно через очередь событий персонажа.
Используйте GetScriptsCount (Python: GetScriptCount) и GetScriptsList для определения индекса целевого скрипта.
procedure StopScript(ScriptIndex: Word);
def StopScript(ScriptIndex: int) -> None: ...
var
I: Integer;
begin
// Stop the last script in the pool
I := GetScriptsCount - 1;
if I > 0 then
begin
AddToSystemJournal('Stopping script #' + IntToStr(I));
StopScript(I);
end;
end.
count = GetScriptCount()
if count > 1:
AddToSystemJournal(f'Stopping script #{count - 1}')
StopScript(count - 1)