Hello there. I'm very very new to this entire thing and stuck on a rather "simple" issue. I have been looking for ages for a solution to an issue but to no avail so I decided to just adapt a plugin I bought recently to do what I want. Basicaly:

When a player presses a button, I want the plugin to create a temporary boolean called "respawnAtArena". Then, on calling the onPlayerRespawn function I want the plugin to check if the variable is true and if so then respawn the player at a given location. I'd like to incorporate this into this bit:

[ConsoleCommand("respawnatarena")]
void cmdDeath(ConsoleSystem.Arg args)
{
var player = args.Player();
if (player != null)
{
var points = ServerRewards?.Call("CheckPoints", player.userID);
if ((int?) points >= config.RespawnPrice)
{
if (deathsPlayers.ContainsKey(player))
{
DEFINE NEW BOOLEAN HERE;
timer.Once(1f, () =>
{
player.EndSleeping();
ServerRewards.Call("TakePoints", player.userID, config.RespawnPrice);
});
}
}
DestroyDeathUI(player);
}
}

private object OnPlayerRespawn(BasePlayer player)
{
if (player == null || !player.userID.IsSteamId()) return null;
if (deathsPlayers.ContainsKey(player))

CREATE NEW IF STATEMENT HERE
deathsPlayers.Remove(player);
DestroyDeathUI(player);
return null;

 

So basicaly when the boolean is true it then fires a function that respawns the player at a specified location.

Can someone help me with this?