How can I pause a game running on a dedicated server?

I created a simple code.

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "PausePlayerController.generated.h"

/**
 *
 */
UCLASS()
class PAUSETEST_API APausePlayerController : public APlayerController
{
	GENERATED_BODY()

	UFUNCTION(BlueprintCallable)
	void SetPauseState(bool paused);
};

// Fill out your copyright notice in the Description page of Project Settings.

#include "PausePlayerController.h"

void APausePlayerController::SetPauseState(bool paused)
{
	SetPause(paused);
}