Files
reallife-gamemode/ReallifeGamemode.Server.Core.API/IPlayer.cs
hydrant 1871a97122 fix
2020-03-29 17:36:58 +02:00

56 lines
1.4 KiB
C#

using ReallifeGamemode.Server.Types;
using ReallifeGamemode.Server.Common;
using System.Net;
namespace ReallifeGamemode.Server.Core.API
{
public interface IPlayer : IEntity
{
string Name { get; set; }
string SocialClubName { get; }
int Health { get; set; }
int Armor { get; set; }
IPAddress RemoteAddress { get; }
IVehicle Vehicle { get; }
bool IsInVehicle { get; }
VehicleSeat VehicleSeat { get; }
void SendMessage(string message, ChatPrefix prefix = ChatPrefix.None)
{
if (!message.EndsWith("!") && !message.EndsWith(".") && !message.EndsWith("?"))
{
message += prefix switch
{
ChatPrefix.Error => "!",
ChatPrefix.Usage => string.Empty,
_ => ".",
};
}
SendRawMessage(prefix.GetValue() + message);
}
void SendRawMessage(string message);
void TriggerEvent(string eventName, params object[] args) => TriggerEventRaw("SERVER:" + eventName, args);
void CancelAnimation();
void TriggerEventRaw(string eventName, params object[] args);
void SetIntoVehicle(IVehicle vehicle, VehicleSeat seat);
void Kick();
void SendNotification(string message, bool flashing = true);
void Spawn(Position position, float heading = 0.0f);
void PlayAnimation(string dict, string name, AnimationFlags flags, float speed = 8.0f);
}
}