# setQueuePriority (Server)

> Sets an account's priority in a full server's queue. A higher priority goes first.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Players and accounts
- **URL**: https://wiki.mymp.gg/en/setQueuePriority

## Syntax

```lua
bool setQueuePriority(string accountId, int priority)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `accountId` | `string` | The MYMP account id, the `id` of `getPlayerAccount` or the `accountId` of `onPlayerQueue`. |
| `priority` | `int` | The priority. `0` clears the account's priority. |

## Returns

`true` once the priority is kept. An empty id gives a warning and `false`.

## Example

```lua
local vips = { ["c3f1a2"] = 10, ["9b7e04"] = 5 }

for accountId, priority in pairs(vips) do
    setQueuePriority(accountId, priority)
end
```

## See also

- [getQueuePriority (Server)](https://wiki.mymp.gg/en/getQueuePriority.md): Reads an account's priority in a full server's queue.
- [onPlayerQueue (Server)](https://wiki.mymp.gg/en/onPlayerQueue.md): Fired when an account is about to join the queue of a full server. Cancelling the event refuses it.
- [getPlayerAccount (Server)](https://wiki.mymp.gg/en/getPlayerAccount.md): Returns the MYMP account the player joined with.
