Skip to content

Instantly share code, notes, and snippets.

@BrentFarris
Created August 27, 2015 09:35
Show Gist options
  • Save BrentFarris/5d54b099a5c2bc4bb3df to your computer and use it in GitHub Desktop.
Save BrentFarris/5d54b099a5c2bc4bb3df to your computer and use it in GitHub Desktop.
Forge Networking: Ban Players For Time Period
using UnityEngine;
using System.Collections;
using BeardedManStudios.Network;
public class BanPlayersForTimePeriod : SimpleNetworkedMonoBehavior
{
protected override void Update()
{
base.Update();
if (!OwningNetWorker.IsServer)
return;
if (Input.GetKeyDown(KeyCode.Space))
OwningNetWorker.BanPlayer(OwningNetWorker.Players[0], 5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment