Advertisement
fishermedders

sleep

Aug 19th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. namespace Oxide.Plugins
  2. {
  3. [Info("Bag Homes", "Fisher", "1.0.0")]
  4. [Description("Spawns a sleeping bag that will teleport you to your home if your home cooldown is ready.")]
  5. public class WarCopter : RustPlugin
  6. {
  7.  
  8. public Dictionary<Player,List> playerSleepingBags = new Dictionary<Player,List>();
  9.  
  10. object OnPlayerDeath(BasePlayer player, HitInfo info)
  11. {
  12. if(GetCooldownRemaining(player, "home") == 0) {
  13. playerSleepingBags.Add(player, new List)
  14. Dictionary playerHomes = GetHomes(player.ID)
  15. foreach(var key in playerHomes.Keys) {
  16. SleepingBag sleepingbag = (SleepingBag) GameManager.server.CreateEntity("assets/bundled/prefabs/static/sleepingbag_static.prefab", default(Vector3), default(Quaternion)) as BaseNetworkable;
  17. sleepingbag.Spawn();
  18. sleepingbag.unlockTime = 0f;
  19. sleepingbag.name = playerHomes[key].name;
  20. sleepingbag.visible = false;
  21. }
  22. }
  23. return null;
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement