Releases: partiusfabaa/cs2-VIPCore
Releases · partiusfabaa/cs2-VIPCore
v1.1.8
v1.1.7
For correct operation, please update all modules.
- Function registration has been redesigned a bit
- The writing of modules has been slightly improved.
If you write modules like this, you no longer need to write _api. or _vip. only the Name of the function, and no need to pass the Feature anywhere else. You specify it 1 time at the beginning of the class.
The most important thing if you will update VIPCore update all modules!
Module example:
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
using Modularity;
using VipCoreApi;
namespace VIP_KillScreen;
public class VipKillScreen : BasePlugin, IModulePlugin
{
public override string ModuleAuthor => "thesamefabius";
public override string ModuleName => "[VIP] Kill Screen";
public override string ModuleVersion => "v1.0.1";
private KillScreen _killScreen;
private IVipCoreApi _api = null!;
public void LoadModule(IApiProvider provider)
{
_api = provider.Get<IVipCoreApi>();
_killScreen = new KillScreen(this, _api);
_api.RegisterFeature(_killScreen);
}
public override void Unload(bool hotReload)
{
_api.UnRegisterFeature(_killScreen);
}
}
public class KillScreen : VipFeatureBase
{
public override string Feature => "Killscreen";
public KillScreen(VipKillScreen vipKillScreen, IVipCoreApi api) : base(api)
{
vipKillScreen.RegisterEventHandler<EventPlayerDeath>((@event, info) =>
{
var attacker = @event.Attacker;
if (!attacker.IsValid) return HookResult.Continue;
if (attacker == @event.Userid) return HookResult.Continue;
if (!IsClientVip(attacker)) return HookResult.Continue;
if (!PlayerHasFeature(attacker)) return HookResult.Continue;
if (GetPlayerFeatureState(attacker) is not IVipCoreApi.FeatureState.Enabled) return HookResult.Continue;
if(!GetFeatureValue<bool>(attacker)) return HookResult.Continue;
var attackerPawn = attacker.PlayerPawn.Value;
if (attackerPawn == null) return HookResult.Continue;
attackerPawn.HealthShotBoostExpirationTime = Server.CurrentTime + 1.0f;
Utilities.SetStateChanged(attackerPawn, "CCSPlayerPawn", "m_flHealthShotBoostExpirationTime");
return HookResult.Continue;
});
}
}
v1.1.6
Added a command to update from the website - css_reload_vip_player <steamid>
Now if you add a vip via WEB panel, you can immediately update the player via rcon
v1.1.5
Added 2 new events to the api:
PlayerLoaded
// Triggered when a VIP Player is authorizedPlayerRemoved
// Triggered when the VIP Player is removed
v1.1.4
Fixed PlayerHasFeature
method
v1.1.3
1. Bug fixes
2. Recompiled to CSSharp v142
v1.1.2
Fixed user deletions
v1.1.1
v1.1.0
1. Now the database connection is in vip_core.json. Cut it out of vip.json
and paste it into vip_core.json
as in the screenshot
2. Now you can use the name of the group here in your translations
{0} - the name of your group
{1} - time until the end of the VIP term
but you can also use plain text in place of {0}
, such as VIP
.
Please replace these 2 lines in your translations. Take them from the lang.example
folder
v1.0.9
- Now you can add a player with steamid 64.
- Now players receive VIP immediately without the need to re-enter the server.