The naive but more correct way of doing it would be:
UFUNCTION(exec)
void Item(FString ItemName, int32 Quantity = 1);
// replicated version
UFUNCTION(Server, Reliable)
void Server_Item(const FString& ItemName, int32 Quantity = 1);
void UMyCheatManager::Item(FString ItemName, int32 Quantity)
{
Server_Item(ItemName, Quantity);
}
but that still won’t work because UCheatManager is a uobject and you can’t call RPCs on those. you need to go through some sort of actor, in this case the player controller. So you have to get the player controller, call a server function on that, which can then execute or route back to the server version of the cheat manager