# Hostages

`Hostage System` is a FiveM hostage placement resource that allows players to spawn surrendering NPC hostages directly in the world.

It is designed for robberies, criminal scenes, police situations, and immersive roleplay interactions. Players can place hostages using an item, preview their position before confirming, choose from multiple surrender animations, and later free them through a target interaction.

With automatic cleanup, server-side validation, state bag support, and configurable models and animations, the system is lightweight, immersive, and easy to manage.

### Features

* Spawnable NPC hostages
* Camera-based placement preview
* Selectable surrender animations
* Item-based usage
* Target interaction to free hostages
* Automatic cleanup and removal
* Server-side placement validation
* Server-side resolve validation
* State bag support
* Random NPC model selection

### How it works

Players use the configured hostage item to enter placement mode.

A transparent preview ped appears, allowing the player to position the hostage in the world, rotate it, and switch between surrender animations. Once confirmed, the resource consumes the item and spawns a synced hostage NPC.

The hostage stays in place until it is freed, killed, or reaches its maximum stay duration. Players can approach a hostage and use the configured target interaction to free it, after which it flees and is removed automatically later.

### Included Pages

* Installation
* Configuration

### Requirements

Before using this resource, make sure all required dependencies are installed and started correctly.

### Notes

* Hostages are spawned using a usable item
* Placement uses a preview ped before confirmation
* Hostages can be freed through a target interaction
* All important actions are validated server-side
* Spawned hostages are cleaned up automatically


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mskscripts.gitbook.io/mskscripts/scripts/hostages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
