# Kidnapping v2

{% hint style="info" %}
If you require assistance with the script, send me a direct message on the cfx forum or post your query in the forum thread.
{% endhint %}

## Script Preview

Want to see how the script looks in action? Watch the short preview video. I've written a small script that allows me to use the `/kidnap` command, but typically you'd need to create your own integration or look for more infos here [#integrations](#integrations "mention")

{% embed url="<https://youtu.be/0O1KdRqUVqo>" %}

## Integrations

<pre class="language-lua" data-title="Custom.lua" data-overflow="wrap" data-full-width="false"><code class="lang-lua">TriggerClientEvent("<a data-footnote-ref href="#user-content-fn-1">kidnap:startKidnap</a>", <a data-footnote-ref href="#user-content-fn-2">source</a>, <a data-footnote-ref href="#user-content-fn-3">{x = 0.0, y = 0.0, z = 0.0}</a>)
</code></pre>

{% code title="NPC.lua" overflow="wrap" %}

```
Incorporate an NPC onto your map that players can interact with to facilitate the kidnapping of another individual.
```

{% endcode %}

{% code title="Command.lua" overflow="wrap" %}

```lua
Allow admins to troll their players by kidnapping them with a command.
```

{% endcode %}

<pre data-title="RoadPhone.lua" data-overflow="wrap"><code>Support for <a data-footnote-ref href="#user-content-fn-4">RoadPhone</a> is being added in the upcoming <a data-footnote-ref href="#user-content-fn-4">RoadPhone</a> 1.1 update, which will be released soon.

This mechanics works as follows: Players can make use of a designated phone number established in the configuration file. Upon initiating a call, a player menu will appear, enabling the caller to pick an online player. Subsequently, the chosen player will be kidnapped and brought to the caller's location.
</code></pre>

## Installation

1. Download the Script via Tebex
2. Extract it to the resources folder on your server
3. Edit the configs on your needs
4. Run `refresh` and then `start Kidnapping_v2` in your Live Console

## Configs

<pre class="language-lua" data-title="Shared.lua" data-overflow="wrap"><code class="lang-lua">Config = {}

<a data-footnote-ref href="#user-content-fn-5">Config.Locale = 'en'</a>

<a data-footnote-ref href="#user-content-fn-6">Config.Intergations = {</a>
    <a data-footnote-ref href="#user-content-fn-7">["npc"] = {</a>
        <a data-footnote-ref href="#user-content-fn-8">enabled = true,</a>
        <a data-footnote-ref href="#user-content-fn-9">openKey = 38,</a>
        <a data-footnote-ref href="#user-content-fn-10">coords = {x = 232.9859, y = -880.9865, z =  29.50},</a>
        <a data-footnote-ref href="#user-content-fn-11">heading = 180.0,</a>
        <a data-footnote-ref href="#user-content-fn-12">ped = "s_m_y_blackops_01",</a>
        <a data-footnote-ref href="#user-content-fn-13">interactionDistance = 1.5,</a>
        <a data-footnote-ref href="#user-content-fn-14">["weapon"] = {</a>
            <a data-footnote-ref href="#user-content-fn-8">enabled = true,</a>
            <a data-footnote-ref href="#user-content-fn-15">hash = "WEAPON_ADVANCEDRIFLE",</a>
        <a data-footnote-ref href="#user-content-fn-16">},</a>
        <a data-footnote-ref href="#user-content-fn-17">["blip"] = {</a>
            <a data-footnote-ref href="#user-content-fn-8">enabled = true,</a>
            <a data-footnote-ref href="#user-content-fn-18">sprite = 458,</a>
            <a data-footnote-ref href="#user-content-fn-19">color = 1,</a>
            <a data-footnote-ref href="#user-content-fn-20">name = "Kidnapping Service",</a>
            <a data-footnote-ref href="#user-content-fn-21">scale = 0.8,</a> 
        <a data-footnote-ref href="#user-content-fn-17">},</a>
        <a data-footnote-ref href="#user-content-fn-22">["marker"] = {</a>
            <a data-footnote-ref href="#user-content-fn-8">enabled = true,</a>
            <a data-footnote-ref href="#user-content-fn-23">type = 1,</a>
            <a data-footnote-ref href="#user-content-fn-24">distance = 10.0,</a>
            <a data-footnote-ref href="#user-content-fn-25">scale = {x = 1.0, y = 1.0, z = 1.0}</a>,
            <a data-footnote-ref href="#user-content-fn-26">color = {r = 255, g = 0, b = 0, a = 100},</a>
        <a data-footnote-ref href="#user-content-fn-22">},</a>
    <a data-footnote-ref href="#user-content-fn-7">},</a>
    <a data-footnote-ref href="#user-content-fn-27">["command"] =  {</a>
        <a data-footnote-ref href="#user-content-fn-8">enabled = false,</a>
        <a data-footnote-ref href="#user-content-fn-28">command = "kidnap",</a>
        <a data-footnote-ref href="#user-content-fn-29">ace_perm = "kidnap.use"</a>
    <a data-footnote-ref href="#user-content-fn-27">},</a>
    <a data-footnote-ref href="#user-content-fn-30">["roadphone"] = {</a>
        <a data-footnote-ref href="#user-content-fn-8">enabled = false,</a>
        <a data-footnote-ref href="#user-content-fn-31">number = "1234567890"</a>
    <a data-footnote-ref href="#user-content-fn-30">},</a>
<a data-footnote-ref href="#user-content-fn-32">}</a>
</code></pre>

<pre class="language-lua" data-title="Server.lua" data-overflow="wrap"><code class="lang-lua"><a data-footnote-ref href="#user-content-fn-33">Config.Framework = {</a>
    <a data-footnote-ref href="#user-content-fn-34">["price"] = 5000</a>
<a data-footnote-ref href="#user-content-fn-33">}</a>

<a data-footnote-ref href="#user-content-fn-35">Config.Cooldown = {</a>
    <a data-footnote-ref href="#user-content-fn-8">["enabled"] = true,</a>
    <a data-footnote-ref href="#user-content-fn-36">["time"] = 300</a>
<a data-footnote-ref href="#user-content-fn-35">}</a>
</code></pre>

<pre class="language-lua" data-title="Client.lua" data-overflow="wrap"><code class="lang-lua">Config = {}
Config.Vehicle = {
    ["driver"] = {
        <a data-footnote-ref href="#user-content-fn-37">["peds"] = {</a>
            <a data-footnote-ref href="#user-content-fn-37">"mp_m_bogdangoon"</a>
        <a data-footnote-ref href="#user-content-fn-37">},</a>
        <a data-footnote-ref href="#user-content-fn-38">["weapons"] = {</a>
            <a data-footnote-ref href="#user-content-fn-38">"WEAPON_PISTOL",</a>
        <a data-footnote-ref href="#user-content-fn-38">}</a>
    },
    ["passenger"] = {
        <a data-footnote-ref href="#user-content-fn-39">["peds"] = {</a>
            <a data-footnote-ref href="#user-content-fn-39">"s_m_y_blackops_01"</a>
        <a data-footnote-ref href="#user-content-fn-39">},</a>
        <a data-footnote-ref href="#user-content-fn-38">["weapons"] = {</a>
            <a data-footnote-ref href="#user-content-fn-38">"WEAPON_PISTOL",</a>
        <a data-footnote-ref href="#user-content-fn-38">}</a>
    }
}
<a data-footnote-ref href="#user-content-fn-40">Config.DriveMode = "full"</a>
<a data-footnote-ref href="#user-content-fn-41">Config.maxTrys = 3</a>
</code></pre>

[^1]: Trigger Eventname

[^2]: Targeted User

[^3]: Coordinates to which the player should be transported.

[^4]: [RoadPhone](https://fivem.roadshop.org/package/4885785) is a feature-rich phone resource designed for FiveM servers. With built-in apps, dynamic island, real-time crypto, group chats, and more, it offers immersive communication and functionality experiences to enhance the server environment.

[^5]: Choose the language for script usage.

    Supported Language:

    * English (en)
    * German (de)
    * Spanish (es)
    * Italian (it)
    * French (fr)
    * Portuguese (pt)
    * Russian (ru)
    * Dutch (nl)

[^6]: Settings for the Intergations.

[^7]: Settings for the NPC.

[^8]: Enable/Disable this feature.

[^9]: Specify the [key](https://docs.fivem.net/docs/game-references/controls/) to access the Kidnapping Menu.

[^10]: The coordinates where the NPC will be positioned.

[^11]: Set the heading of the NPC.

[^12]: The provided [model name](https://docs.fivem.net/docs/game-references/ped-models/) will be assigned to the NPC.

[^13]: This entry defines the range within which players can interact with the NPC.

[^14]: Config for the NPC weapon.

[^15]: Assign a [weapon](https://wiki.rage.mp/index.php?title=Weapons) to the NPC.

[^16]: Config for the NPC weapon

[^17]: Settings for the NPC blip.

[^18]: Assign the [sprite](https://docs.fivem.net/docs/game-references/blips/) of the blip.

[^19]: Set a specific [color](https://docs.fivem.net/docs/game-references/blips/#blip-colors) for the blip.

[^20]: Set a name for the blip.

[^21]: Select the size of the blip.

[^22]: Settings for the NPC marker.

[^23]: Assign the [type](https://docs.fivem.net/docs/game-references/markers/) of marker.

[^24]: The distance at which the player can view the marker.

[^25]: Set the scale of the marker.

[^26]: Set the color of the marker in [RGBA](https://rgbacolorpicker.com/) format.

[^27]: Settings for the command.

[^28]: Set the command name will be usable like this `/kidnap ID`

[^29]: Set the ace permission which is needed to use this command.

[^30]: Not working yet

[^31]: Select the phone number which players have to calll to open the Kidnapping Menu.

[^32]: Config for the Intergations.

[^33]: Settings for QBCore & ESX.

[^34]: Select the price how much it costs to kidnap someone (QBCore & ESX Only)

[^35]: Settings for the Cooldown.

[^36]: Select the cooldown time in seconds

[^37]: When you add [model names](https://docs.fivem.net/docs/game-references/ped-models/) to this list, one of these names will be randomly selected and assigned to the driver.

[^38]: When you add [weapon names](https://wiki.rage.mp/index.php?title=Weapons) to this list, one of these names will be randomly selected and assigned for use.

[^39]: When you add [model names](https://docs.fivem.net/docs/game-references/ped-models/) to this list, one of these names will be randomly selected and assigned to the passenger.

[^40]: Choose from two drive modes:

    * Full: Follows the entire route.
    * Teleport: Instantly teleports near the destination coordinates.

[^41]: After how many fails should the vehicle be teleported? This is mainly needed for the "Full" drive mode, in case the vehicle gets stuck in a hole.


---

# 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://yeadev.gitbook.io/fivem/scripts/kidnappingv2.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.
