Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Oxide.Plugins
- {
- [Info("Bag Homes", "Fisher", "1.0.0")]
- [Description("Spawns a sleeping bag that will teleport you to your home if your home cooldown is ready.")]
- public class WarCopter : RustPlugin
- {
- public Dictionary<Player,List> playerSleepingBags = new Dictionary<Player,List>();
- object OnPlayerDeath(BasePlayer player, HitInfo info)
- {
- if(GetCooldownRemaining(player, "home") == 0) {
- playerSleepingBags.Add(player, new List)
- Dictionary playerHomes = GetHomes(player.ID)
- foreach(var key in playerHomes.Keys) {
- SleepingBag sleepingbag = (SleepingBag) GameManager.server.CreateEntity("assets/bundled/prefabs/static/sleepingbag_static.prefab", default(Vector3), default(Quaternion)) as BaseNetworkable;
- sleepingbag.Spawn();
- sleepingbag.unlockTime = 0f;
- sleepingbag.name = playerHomes[key].name;
- sleepingbag.visible = false;
- }
- }
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement