Hey guys, i made simple mod which is called SpectateMod
This plugin is for server admins and mods only,
activating this plugin will enable the admin or mode to enable the spectate mode
Changes
This plugin is for server admins and mods only,
activating this plugin will enable the admin or mode to enable the spectate mode
Changes
Code:
Now the command is only visible to the admin or mods when they type
Code:
!spectate
PHP Code:
using Addon;
using System;
namespace plugin_test
{
public class plugin_test : CPlugin
{
public bool hud_enabled = true;
private ServerClient Client;
public override void OnServerLoad()
{
base.ServerPrint("\n NoClip Switcher plugin loaded. \n Creator: 'God Of War");
}
public override ChatType OnSay(string Message, ServerClient Client, bool TeamChat)
{
if (Message == "!spectate")
{
if (this.hud_enabled)
{
base.iPrintLnBold("^2Spectate Mode is now ^1ON", Client);
Client.Other.NoClip = true;
this.disable2();
}
else
{
base.iPrintLnBold("^2Spectate Mode is now ^1OFF", Client);
Client.Other.NoClip = false;
this.enable2();
}
}
return ChatType.ChatNone;
}
public void disable2()
{
this.hud_enabled = false;
}
public void enable2()
{
this.hud_enabled = true;
}
}
}