> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Give keys to player ID

> Give vehicle keys to an online player server side.

```lua Export theme={null}
exports["vehicles_keys"]:giveVehicleKeysToPlayerId(playerId, plate, type)
```

### Parameters

| Name       | Data Type         | Description                                                                                              |
| ---------- | ----------------- | -------------------------------------------------------------------------------------------------------- |
| `playerId` | integer           | The target player server ID                                                                              |
| `plate`    | string            | The vehicle plate                                                                                        |
| `type`     | string (optional) | The vehicle type. Defaults to `"temporary"`. Available types: `"temporary"`, `"owned"`, `"other_player"` |

## Example

```lua theme={null}
RegisterNetEvent("vehicle_shop:playerBoughtVehicle", function(playerId, plate)
    exports["vehicles_keys"]:giveVehicleKeysToPlayerId(playerId, plate, "owned")
end)
```


## Related topics

- [Server](/vehicles-keys/server/index.md)
- [Remove keys from player ID](/vehicles-keys/server/remove-keys-from-player-id.md)
- [Get player ID keys](/vehicles-keys/server/get-player-id-keys.md)
- [Give keys to identifier](/vehicles-keys/server/give-keys-to-identifier.md)
- [Self give current vehicle plate](/vehicles-keys/client/self-give-current-vehicle-plate.md)
