本文整理汇总了C#中UnturnedPlayer类的典型用法代码示例。如果您正苦于以下问题:C# UnturnedPlayer类的具体用法?C# UnturnedPlayer怎么用?C# UnturnedPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnturnedPlayer类属于命名空间,在下文中一共展示了UnturnedPlayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: chat
public void chat(UnturnedPlayer caller, string text)
{
if (isMember(caller))
tellParty(caller.CharacterName + (isLeader(caller) ? "[L]: " : "[P]: ") + text);
else
DGPlugin.messagePlayer(caller, "Error, you are not in this party.");
}
示例2: Execute
public void Execute(UnturnedPlayer caller, string[] command)
{
if (command.Length < 2)
DGPlugin.messagePlayer(caller,
"Invalid amount of parameters. Format is \"/transfer amount playerName\".");
else
{
int amount;
if (!int.TryParse(command[0], out amount))
DGPlugin.messagePlayer(caller, "Invalid amount.");
else
{
var playerName = string.Join(" ", command.Skip(1).ToArray());
UnturnedPlayer player;
if ((player = DGPlugin.getPlayer(playerName)) == null)
DGPlugin.messagePlayer(caller, "Failed to find player named \"" + playerName + "\"");
else
{
if (amount < 1)
DGPlugin.messagePlayer(caller, "You cannot send negative credits!");
else if (Currency.transferCredits(caller, player, amount))
{
DGPlugin.messagePlayer(caller,
"You sent " + amount + " credits to " + player.CharacterName + ".");
DGPlugin.messagePlayer(player, caller.CharacterName + " just gave you $" + amount + "!");
}
else
{
DGPlugin.messagePlayer(caller, "Insufficient funds.");
}
}
}
}
}
示例3: DropMagsWithLimit
public void DropMagsWithLimit(ushort ammoAmountToSpawn, IRocketPlayer caller, SDG.Unturned.ItemGunAsset currentWeapon, UnturnedPlayer Uplayer, string[] command)
{
if (ammoAmountToSpawn <= (ushort)EasyAmmo.Instance.Configuration.Instance.ClipLimit || caller.HasPermission("easyammo.bypasslimit"))
{
UnturnedChat.Say(caller, EasyAmmo.Instance.Translate("dropping_mags", ammoAmountToSpawn.ToString(), UnturnedItems.GetItemAssetById(GetMagId(Uplayer, currentWeapon, command)).Name, GetMagId(Uplayer, currentWeapon, command).ToString()));
for (int ii = 0; ii < (int)ammoAmountToSpawn; ii++)
{
ItemManager.dropItem(new Item(GetMagId(Uplayer, currentWeapon, command), true), Uplayer.Position, true, true, true);
}
}
else
{
UnturnedItems.GetItemAssetById(1);
ushort amountoverlimit = ammoAmountToSpawn;
ammoAmountToSpawn = (ushort)EasyAmmo.Instance.Configuration.Instance.ClipLimit;
UnturnedChat.Say(caller, EasyAmmo.Instance.Translate("over_clip_spawn_limit_dropping", amountoverlimit.ToString(), EasyAmmo.Instance.Configuration.Instance.ClipLimit, UnturnedItems.GetItemAssetById(GetMagId(Uplayer, currentWeapon, command)).Name, GetMagId(Uplayer, currentWeapon, command).ToString()));
for (int ii = 0; ii < (int)ammoAmountToSpawn; ii++)
{
ItemManager.dropItem(new Item(GetMagId(Uplayer, currentWeapon, command), true), Uplayer.Position, true, true, true);
}
}
}
示例4: Execute
public void Execute(UnturnedPlayer caller, string[] command)
{
//check for parameter vaidity
if (command.Length == 0)
{
DGPlugin.messagePlayer(caller, "Invalid amount of players. Format is \"/kick PlayerName\".");
return;
}
var playerName = string.Join(" ", command);
//check for player existence
var player = DGPlugin.getPlayer(playerName);
if (player == null)
{
DGPlugin.messagePlayer(caller, "Failed to find player named \"" + playerName + "\"");
return;
}
var party = Parties.getParty(caller);
if (party != null)
{
party.kickMember(caller, player);
DGPlugin.messagePlayer(player, "You have been removed from the party.");
}
else
DGPlugin.messagePlayer(caller, "You are not in a party.");
}
示例5: TeleportCar
internal static bool TeleportCar(this InteractableVehicle vehicle, UnturnedPlayer player, Vector3 Location)
{
if (player.CurrentVehicle.passengers[0].player != null)
return false;
vehicle.transform.position = Location;
return true;
}
示例6: playerDied
public static void playerDied(UnturnedPlayer player)
{
if (nextTP.ContainsKey(player.CSteamID))
nextTP[player.CSteamID] = Math.Max(Time.realtimeSinceStartup + cooldownTime / 2, nextTP[player.CSteamID]);
else
nextTP[player.CSteamID] = Time.realtimeSinceStartup + cooldownTime / 2;
}
示例7: OnRegionEnter
public override void OnRegionEnter(UnturnedPlayer player)
{
if(!_lastHealth.ContainsKey(player.CSteamID.m_SteamID))
_lastHealth.Add(player.CSteamID.m_SteamID, player.Health);
if (!GetValueSafe(Region.GetGroup(player))) return;
player.Features.GodMode = true;
}
示例8: OnRegionEnter
public override void OnRegionEnter(UnturnedPlayer player)
{
if (Value == null)
return;
var val = GetValue<ushort>(Region.GetGroup(player));
player.TriggerEffect(val);
}
示例9: Execute
public void Execute(UnturnedPlayer caller, string[] command)
{
if (command.Length > 0)
DGPlugin.messagePlayer(caller, "Invalid amount of parameters. Format is \"/balance\".");
else
DGPlugin.messagePlayer(caller, "You currently have " + Currency.getBalance(caller) + " credits.");
}
示例10: OnRegionEnter
public override void OnRegionEnter(UnturnedPlayer player)
{
var parsedValue = GetValue<string>(Region.GetGroup(player));
if (parsedValue == null)
return;
parsedValue = parsedValue.Replace("{0}", Region.Name);
UnturnedChat.Say(player, parsedValue);
}
示例11: DropMags
public void DropMags(ushort ammoAmountToSpawn, IRocketPlayer caller, SDG.Unturned.ItemGunAsset currentWeapon, UnturnedPlayer Uplayer, string[] command)
{
UnturnedChat.Say(caller, EasyAmmo.Instance.Translate("dropping_mags", ammoAmountToSpawn.ToString(), UnturnedItems.GetItemAssetById(GetMagId(Uplayer, currentWeapon, command)).Name, GetMagId(Uplayer, currentWeapon, command).ToString()));
for (int ii = 0; ii < (int)ammoAmountToSpawn; ii++)
{
ItemManager.dropItem(new Item(GetMagId(Uplayer, currentWeapon, command), true), Uplayer.Position, true, true, true);
}
}
示例12: e_OnPlayerUpdateHealth
private void e_OnPlayerUpdateHealth(UnturnedPlayer player, byte health)
{
if (health < 95)
{
Player.Heal(100);
Player.Bleeding = false;
Player.Broken = false;
}
}
示例13: clearStats
public static void clearStats(UnturnedPlayer player)
{
player.Hunger = 0;
player.Infection = 0;
player.Thirst = 0;
player.Heal(100);
player.Bleeding = false;
player.Broken = false;
}
示例14: OnRegionEnter
public override void OnRegionEnter(UnturnedPlayer player)
{
var group = Region.GetGroup(player);
var val = GetValue<string>(group);
if(val == null)
return;
string msg = RegionsPlugin.Instance.Configuration.Instance.UrlOpenMessage;
PlayerUtil.OpenUrl(player, msg, val);
}
示例15: addMember
public void addMember(UnturnedPlayer player)
{
//add the player to the steam group for this party
player.Player.SteamChannel.SteamPlayer.playerID.SteamGroupID = steamGroup;
members.Add(player);
tellParty(player.CharacterName + " has joined the party!", player);
DGPlugin.messagePlayer(player, "You have joined the party!", chatColor);
}