# In C++, how to check if it's the Client or the Server that is running?

**URL:** <https://forums.unrealengine.com/t/in-c-how-to-check-if-its-the-client-or-the-server-that-is-running/1943326>\
**Category:** C++\
**Tags:** Server, authority, unreal-engine, local-multiplayer, Multiplayer, CPP, question\
**Created:** [July 19, 2024, 6:53pm UTC](https://forums.unrealengine.com/t/in-c-how-to-check-if-its-the-client-or-the-server-that-is-running/1943326 "2024-07-19T18:53:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcinkcinkcinnick](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kcinkcinkcinnick](https://forums.unrealengine.com/u/kcinkcinkcinnick)\
**Post date:** [July 19, 2024, 6:53pm UTC](https://forums.unrealengine.com/t/in-c-how-to-check-if-its-the-client-or-the-server-that-is-running/1943326/1 "2024-07-19T18:53:13Z")

</div>

Hello my fellow enthousiasts!

I am looking at the BeginPlay() of my PlayerCharacter and other Actors.

I can find lots of documentation for Blueprint, but not really for C++.

Blueprint has Kismet’s _**IsServer()**_, _**IsLocallyControlled()**_ & _**IsLocalPlayerController(**_).  
Are there any alternatives for C++ for this?

I have found _**HasAuthority()**_ which will return true when it’s the one that spawned the Object, but I don’t want to have my hopes up that it’s always going to be the server.

Is there another / better way were I can be certain that it’s actually the server and not the client?

Kind Regards,

Nick
