This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
generated from K4ryuu/Project_Template
-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,522 additions
and
1,579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
namespace K4SharedApi | ||
using CounterStrikeSharp.API.Core; | ||
|
||
namespace K4SharedApi | ||
{ | ||
public interface IK4SharedApi | ||
public interface IPlayerAPI | ||
{ | ||
int PlayerPoints { get; } | ||
int PlayerRankID { get; } | ||
bool IsLoaded { get; } | ||
bool IsValid { get; } | ||
bool IsPlayer { get; } | ||
CCSPlayerController Controller { get; } | ||
int Points { get; set; } | ||
int RankID { get; } | ||
string RankName { get; } | ||
string RankClanTag { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
using CounterStrikeSharp.API; | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Modules.Commands; | ||
using static K4System.ModuleRank; | ||
using static K4System.ModuleStat; | ||
using static K4System.ModuleTime; | ||
|
||
namespace K4System.Models; | ||
|
||
public class K4Player | ||
{ | ||
//** ? Main */ | ||
private readonly Plugin Plugin; | ||
|
||
//** ? Player */ | ||
public readonly CCSPlayerController Controller; | ||
public readonly ulong SteamID; | ||
public readonly string PlayerName; | ||
|
||
//** ? Data */ | ||
public RankData? rankData { get; set; } | ||
public StatData? statData { get; set; } | ||
public TimeData? timeData { get; set; } | ||
public (int killStreak, DateTime lastKillTime) KillStreak = (0, DateTime.MinValue); | ||
|
||
public K4Player(Plugin plugin, CCSPlayerController playerController) | ||
{ | ||
Plugin = plugin; | ||
|
||
Controller = playerController; | ||
SteamID = playerController.SteamID; | ||
PlayerName = playerController.PlayerName; | ||
} | ||
|
||
public bool IsValid | ||
{ | ||
get | ||
{ | ||
return Controller?.IsValid == true && Controller.PlayerPawn?.IsValid == true && Controller.Connected == PlayerConnectedState.PlayerConnected; | ||
} | ||
} | ||
|
||
public bool IsPlayer | ||
{ | ||
get | ||
{ | ||
return !Controller.IsBot && !Controller.IsHLTV; | ||
} | ||
} | ||
|
||
public string ClanTag | ||
{ | ||
get { return Controller.Clan; } | ||
set | ||
{ | ||
Controller.Clan = value; | ||
Utilities.SetStateChanged(Controller, "CCSPlayerController", "m_szClan"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.