本文整理汇总了C#中UnturnedPlayer类的典型用法代码示例。如果您正苦于以下问题:C# UnturnedPlayer类的具体用法?C# UnturnedPlayer怎么用?C# UnturnedPlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnturnedPlayer类属于命名空间,在下文中一共展示了UnturnedPlayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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.");
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:7,代码来源:Party.cs
示例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.");
}
}
}
}
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:34,代码来源:CommandTransfer.cs
示例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);
}
}
}
开发者ID:RocketModPlugins,项目名称:EasyAmmo,代码行数:26,代码来源:CommandDropAmmo.cs
示例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.");
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:28,代码来源:CommandKick.cs
示例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;
}
开发者ID:cartman-2000,项目名称:TeleportUtil,代码行数:7,代码来源:Extensions.cs
示例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;
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:7,代码来源:CommandTeleport.cs
示例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;
}
开发者ID:Trojaner25,项目名称:Rocket-Regions,代码行数:7,代码来源:GodmodeFlag.cs
示例8: OnRegionEnter
public override void OnRegionEnter(UnturnedPlayer player)
{
if (Value == null)
return;
var val = GetValue<ushort>(Region.GetGroup(player));
player.TriggerEffect(val);
}
开发者ID:Trojaner25,项目名称:Rocket-Regions,代码行数:7,代码来源:EnterEffectFlag.cs
示例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.");
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:7,代码来源:CommandBalance.cs
示例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);
}
开发者ID:Trojaner25,项目名称:Rocket-Regions,代码行数:8,代码来源:EnterMessageFlag.cs
示例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);
}
}
开发者ID:RocketModPlugins,项目名称:EasyAmmo,代码行数:9,代码来源:CommandDropAmmo.cs
示例12: e_OnPlayerUpdateHealth
private void e_OnPlayerUpdateHealth(UnturnedPlayer player, byte health)
{
if (health < 95)
{
Player.Heal(100);
Player.Bleeding = false;
Player.Broken = false;
}
}
开发者ID:UB1AFU,项目名称:Rocket.Unturned,代码行数:9,代码来源:UnturnedPlayerFeatures.cs
示例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;
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:9,代码来源:PlayerState.cs
示例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);
}
开发者ID:Trojaner25,项目名称:Rocket-Regions,代码行数:9,代码来源:EnterURLFlag.cs
示例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);
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:10,代码来源:Party.cs
示例16: Execute
public void Execute(UnturnedPlayer caller, string[] command)
{
if (command.Length != 0)
{
DGPlugin.messagePlayer(caller, "Incorrect format. Format is \"/listevents\".");
}
else
{
EventScheduler.listEvents(caller);
}
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:11,代码来源:CommandListEvents.cs
示例17: ExecuteFreeze
public static void ExecuteFreeze(UnturnedPlayer player)
{
Actions.FrozenPlayers.stop = false;
Core.Core.FrozenPlayersList.Add(
new FrozenPlayerConstructor
{
Player = player,
FrozenPos = player.Position,
LastPos = player.Position
});
}
开发者ID:RocketLOL,项目名称:BattleRoyale,代码行数:11,代码来源:Freeze.cs
示例18: valueOfPlayer
public static int valueOfPlayer(UnturnedPlayer player)
{
int minutesAlive = (int) (Time.realtimeSinceStartup-player.Player.PlayerLife.lastRespawn)/60;
int playersKilledSinceSpawn = (killsSinceSpawn.ContainsKey(player.CSteamID) ? killsSinceSpawn[player.CSteamID] : 0);
int valueOfPlayer = Math.Min(minutesAlive, 10) + playersKilledSinceSpawn * 5;
if (ArenaEvent.isOccurring)
return Math.Max(valueOfPlayer, 10);
return valueOfPlayer;
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:11,代码来源:Currency.cs
示例19: Trigger
public void Trigger(UnturnedPlayer player)
{
if (!Global)
{
SDG.Unturned.EffectManager.Instance.SteamChannel.send("tellEffectPoint", player.CSteamID, ESteamPacket.UPDATE_UDP_BUFFER, new object[] { EffectID, player.Player.transform.position });
}
else
{
SDG.Unturned.EffectManager.Instance.SteamChannel.send("tellEffectPoint", ESteamCall.CLIENTS, player.Player.transform.position, 1024, ESteamPacket.UPDATE_UDP_BUFFER, new object[] { EffectID, player.Player.transform.position });
}
}
开发者ID:Kirollos,项目名称:Rocket.Unturned,代码行数:11,代码来源:UnturnedEffectManager.cs
示例20: transferCredits
public static bool transferCredits(UnturnedPlayer from, UnturnedPlayer to, int amount)
{
string src = DGPlugin.getConstantID(from), dest = DGPlugin.getConstantID(to);
if (amount > 0 && balances[src] >= amount)
{
balances[src] -= amount;
balances[dest] += amount;
return true;
}
return false;
}
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:11,代码来源:Currency.cs
注:本文中的UnturnedPlayer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论