145 lines
4.1 KiB
C#
145 lines
4.1 KiB
C#
using CounterStrikeSharp.API;
|
|
using CounterStrikeSharp.API.Core;
|
|
using CounterStrikeSharp.API.Modules.Events;
|
|
using Microsoft.Extensions.Logging;
|
|
using NebulaMistCSS.Event.PlayerEvents;
|
|
//using NebulaMistCSS.Event.ServerEvents;
|
|
using NebulaMistCSS.Features;
|
|
using static CounterStrikeSharp.API.Core.Listeners;
|
|
|
|
namespace NebulaMistCSS
|
|
{
|
|
public class NebulaMistCSS : BasePlugin
|
|
{
|
|
//事件名定义
|
|
//{
|
|
|
|
|
|
|
|
|
|
//注册玩家加入事件的定义
|
|
//{
|
|
private PlayerJoin _playerJoin;
|
|
//}
|
|
|
|
//换图事件的定义
|
|
//{
|
|
private MapChanger _mapChanger;
|
|
|
|
|
|
//机器人事件的定义
|
|
//{
|
|
private BotController _botController;
|
|
//}
|
|
|
|
//浮游信息事件的定义
|
|
//{
|
|
private PlayerInfoDisplay _playerInfoDisplay;
|
|
//}
|
|
//击杀回血事件的定义
|
|
//{
|
|
private KillHealthshot _killHealthshot;
|
|
//}
|
|
|
|
////手雷连锁事件的定义
|
|
////{
|
|
//private GrenadeChain _grenadeChain;
|
|
////}
|
|
|
|
public override string ModuleName => "NebulaMistCSS";
|
|
|
|
public override string ModuleVersion => "0.0.1a";
|
|
|
|
public override void Load(bool hotReload)
|
|
|
|
{
|
|
|
|
|
|
Server.ExecuteCommand("sv_enablebunnyhopping 0");
|
|
Server.ExecuteCommand("sv_autobunnyhopping 0");
|
|
Server.ExecuteCommand("sv_airaccelerate 100");
|
|
Server.ExecuteCommand("sv_accelerate 5.5");
|
|
Server.ExecuteCommand("sv_friction 5.2");
|
|
Server.ExecuteCommand("sv_maxspeed 320");
|
|
Server.ExecuteCommand("sv_staminajumpcost 1");
|
|
Server.ExecuteCommand("sv_staminalandcost 1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//控制台显示
|
|
Console.WriteLine("Nebulamist CSS已加载");
|
|
//写入日志
|
|
Logger.LogInformation("Nebulamist CSS已加载");
|
|
|
|
|
|
//注册玩家加入事件
|
|
//{
|
|
_playerJoin = new PlayerJoin(this);
|
|
RegisterEventHandler<EventPlayerConnectFull>(_playerJoin.OnPlayerConnectFull);
|
|
//}
|
|
|
|
|
|
//换图的事件
|
|
//{
|
|
_mapChanger = new MapChanger(this);
|
|
RegisterEventHandler<EventPlayerChat>(_mapChanger.OnPlayerChat);
|
|
//}
|
|
|
|
//机器人的事件
|
|
//{
|
|
_botController = new BotController(this);
|
|
RegisterEventHandler<EventPlayerChat>(_botController.OnPlayerChat);
|
|
//}
|
|
|
|
|
|
//浮游信息的事件
|
|
//{
|
|
_playerInfoDisplay = new PlayerInfoDisplay(this);
|
|
RegisterEventHandler<EventPlayerSpawn>(_playerInfoDisplay.OnPlayerSpawn);
|
|
RegisterEventHandler<EventPlayerDeath>(_playerInfoDisplay.OnPlayerDeath);
|
|
RegisterListener<OnTick>(_playerInfoDisplay.OnTick);
|
|
RegisterEventHandler<EventPlayerChat>(_playerInfoDisplay.OnPlayerChat);
|
|
//}
|
|
|
|
//击杀回血的事件
|
|
//{
|
|
_killHealthshot = new KillHealthshot(this);
|
|
RegisterEventHandler<EventPlayerChat>(_killHealthshot.OnPlayerChat); // 血针功能
|
|
RegisterEventHandler<EventPlayerDeath>(_killHealthshot.OnPlayerDeath);
|
|
RegisterEventHandler<EventPlayerHurt>(_killHealthshot.OnPlayerHurt);
|
|
RegisterEventHandler<EventPlayerSpawn>(_killHealthshot.OnPlayerSpawn);
|
|
RegisterEventHandler<EventPlayerDisconnect>(_killHealthshot.OnPlayerDisconnect);
|
|
//}
|
|
|
|
|
|
|
|
|
|
////手雷连锁事件的事件
|
|
////{
|
|
//_grenadeChain = new GrenadeChain(this);
|
|
//RegisterEventHandler<EventPlayerChat>(_grenadeChain.OnPlayerChat); // 连锁手雷
|
|
//RegisterEventHandler<EventGrenadeThrown>(_grenadeChain.OnGrenadeThrown); // 手雷投掷事件
|
|
//RegisterEventHandler<EventPlayerDisconnect>(_grenadeChain.OnPlayerDisconnect);
|
|
////}
|
|
|
|
|
|
}
|
|
|
|
public override void Unload(bool hotReload)
|
|
{
|
|
//控制台显示
|
|
Console.WriteLine("Nebulamist CSS已卸载");
|
|
//写入日志
|
|
Logger.LogInformation("Nebulamist CSS已卸载");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
}
|