---
title: "ForceClassSelection | open.mp"
description: "Forces a player to go back to class selection."
canonical: https://omp.itsneufox.com/docs/scripting/functions/ForceClassSelection
language: en
---

# ForceClassSelection

## Description

Forces a player to go back to class selection.

| Name | Description |
| --- | --- |
| playerid | The player to send back to class selection. |

## Returns

This function does not return any specific values.

## Examples

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/class", true))
    {
        ForceClassSelection(playerid);
        TogglePlayerSpectating(playerid, true);
        TogglePlayerSpectating(playerid, false);
        return 1;
    }
    return 0;
}
```

## Notes

warning

-   The player will not return to class selection until they re-spawn. This can be achieved with [TogglePlayerSpectating](https://omp.itsneufox.com/docs/scripting/functions/TogglePlayerSpectating), as seen in the example above.
-   This function does not perform a state change to `PLAYER_STATE_WASTED` when combined with TogglePlayerSpectating (see example above), as is listed here.

## Related Functions

-   [AddPlayerClass](https://omp.itsneufox.com/docs/scripting/functions/AddPlayerClass): Add a class.
-   [SetPlayerSkin](https://omp.itsneufox.com/docs/scripting/functions/SetPlayerSkin): Set a player's skin.
-   [GetPlayerSkin](https://omp.itsneufox.com/docs/scripting/functions/GetPlayerSkin): Get a player's current skin.

## Related Callbacks

-   [OnPlayerRequestClass](https://omp.itsneufox.com/docs/scripting/callbacks/OnPlayerRequestClass): Called when a player changes class at class selection.
