Advertisement
Nahtryx

Warp.cs

Jun 28th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.18 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System;
  3. using System.Reflection;
  4. using System.Data;
  5. using UnityEngine;
  6. using Oxide.Core;
  7. using Oxide.Core.Plugins;
  8. using RustProto;
  9.  
  10. namespace Oxide.Plugins
  11. {
  12.    
  13.     [Info("Warp", "Ezki", "1.0", ResourceId = 1337)]
  14.     class Warp : RustLegacyPlugin
  15.     {
  16.         public Vector3[] smallArray = new Vector3[5];
  17.         public Vector3[] hackerArray = new Vector3[5];
  18.         public Vector3[] hangarArray = new Vector3[5];
  19.         public Vector3[] factoryArray = new Vector3[5];
  20.         public Vector3[] nextArray = new Vector3[5];
  21.         public Vector3[] bigArray = new Vector3[5];
  22.         System.Random rnd = new System.Random();
  23.         public NetUser cachedUser;
  24.         RustServerManagement mana;
  25.         int random;
  26.        
  27.         void OnServerInitialized()
  28.         {
  29.             mana = RustServerManagement.Get();
  30.         }
  31.        
  32.         [ChatCommand("small")]
  33.         void cmdChatSmall(NetUser netuser, string command, string[] args)
  34.         {
  35.             if (TPcheck(netuser) ){
  36.             smallArray[0] = new Vector3(6051.788f, 376.3509f, -3593.894f);
  37.             smallArray[1] = new Vector3(6053.698f, 376.35f, -3540.705f);
  38.             smallArray[2] = new Vector3(6087.951f, 375.9772f, -3508.944f);
  39.             smallArray[3] = new Vector3(6128.661f, 376.4142f, -3489.541f);
  40.             smallArray[4] = new Vector3(6117.65f, 376.35f, -3572.279f);
  41.             random = rnd.Next(5);
  42.                         cachedUser = netuser;
  43.                         mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, smallArray[random]);
  44.             SendReply(netuser, "You teleported to Small Radtown.");
  45.         }    
  46.     }      
  47.         [ChatCommand("hacker")]
  48.         void cmdChatHacker(NetUser netuser, string command, string[] args)
  49.         {
  50.             if (TPcheck(netuser) ){
  51.             hackerArray[0] = new Vector3(5217f, 438f, -2910f);
  52.             hackerArray[1] = new Vector3(5189f, 442f, -2778f);
  53.             hackerArray[2] = new Vector3(5283f, 434f, -2839f);
  54.             hackerArray[3] = new Vector3(5392f, 457f, -2969f);
  55.             hackerArray[4] = new Vector3(5324f, 435f, -2890f);
  56.                         random = rnd.Next(5);
  57.                         cachedUser = netuser;
  58.                         mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, hackerArray[random]);
  59.             SendReply(netuser, "You teleported to Hacker Valley.");
  60.  
  61.             }
  62.         }  
  63.     [ChatCommand("hangar")]
  64.         void cmdChatHangar(NetUser netuser, string command, string[] args)
  65.         {
  66.             if (TPcheck(netuser) ){
  67.             hangarArray[0] = new Vector3(6632f, 364f, -4333f);
  68.             hangarArray[1] = new Vector3(6644f, 354f, -4235f);
  69.             hangarArray[2] = new Vector3(6737f, 349f, -4258f);
  70.             hangarArray[3] = new Vector3(6791f, 335f, -4351f);
  71.             hangarArray[4] = new Vector3(6584f, 364f, -4252f);
  72.                 random = rnd.Next(5);
  73.                         cachedUser = netuser;
  74.                         mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, hangarArray[random]);
  75.             SendReply(netuser, "You teleported to Hangar.");
  76.             }
  77.         }  
  78.     [ChatCommand("factory")]
  79.         void cmdChatFactory(NetUser netuser, string command, string[] args)
  80.         {
  81.             if (TPcheck(netuser) ){
  82.             factoryArray[0] = new Vector3(6444f, 361f, -4603f);
  83.             factoryArray[1] = new Vector3(6393f, 361f, -4652f);
  84.             factoryArray[2] = new Vector3(6425f, 360f, -4747f);
  85.             factoryArray[3] = new Vector3(6294f, 358f, -4661f);
  86.             factoryArray[4] = new Vector3(6343f, 361f, -4684f);
  87.                 random = rnd.Next(5);
  88.                         cachedUser = netuser;
  89.                         mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, factoryArray[random]);
  90.             SendReply(netuser, "You teleported to Factory.");
  91.             }
  92.         }  
  93.     [ChatCommand("next")]
  94.         void cmdChatNext(NetUser netuser, string command, string[] args)
  95.         {  
  96.  
  97.             if (TPcheck(netuser) ){
  98.  
  99.             nextArray[0] = new Vector3(4858f, 430f, -3892f);
  100.             nextArray[1] = new Vector3(4937f, 417f, -3752f);
  101.             nextArray[2] = new Vector3(4792f, 430f, -3745f);
  102.             nextArray[3] = new Vector3(5017f, 419f, -3943f);
  103.             nextArray[4] = new Vector3(5119f, 416f, -3920f);
  104.                 random = rnd.Next(5);
  105.                         cachedUser = netuser;
  106.                         mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, nextArray[random]);
  107.             SendReply(netuser, "You teleported to Next Valley.");          
  108.             }
  109.          }  
  110.     [ChatCommand("ghj")]
  111.         void cmdChatBig(NetUser netuser, string command, string[] args)
  112.         {
  113.             if (TPcheck(netuser) ){
  114.             nextArray[0] = new Vector3(5147f, 386f, -4667f);
  115.             nextArray[1] = new Vector3(5111f, 4974f, -4974f);
  116.             nextArray[2] = new Vector3(5294f, 362f, -4902f);
  117.             nextArray[3] = new Vector3(5342f, 362f, -4772f);
  118.             nextArray[4] = new Vector3(5286f, 372f, -4680f);
  119.                 random = rnd.Next(5);
  120.                         cachedUser = netuser;
  121.                         mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, bigArray[random]);
  122.             SendReply(netuser, "You teleported to Big Radtown.");
  123.  
  124.             }
  125.         }
  126.        
  127.         bool TPcheck(NetUser netuser){
  128.  
  129. object thereturn = Interface.GetMod().CallHook("canTeleportt", new object[] { netuser });
  130.  
  131.             if (thereturn != null){
  132. ConsoleNetworker.SendClientCommand(netuser.networkPlayer, "chat.add ✖ " + Facepunch.Utility.String.QuoteSafe(string.Format("[color red]/gg to leave")));
  133.  
  134. //Puts("noe");
  135.                 return false;   }
  136.  
  137. //Puts("ja");
  138. return true;
  139.  
  140. }
  141.        
  142.         void SendHelpText(NetUser netuser)
  143.         {
  144.             SendReply(netuser, "/small to teleport Small Radtown.");
  145.             SendReply(netuser, "/hacker to teleport to Hacker Valley.");
  146.             SendReply(netuser, "/hangar to teleport to Hangar.");
  147.             SendReply(netuser, "/factory to teleport to Factory.");
  148.             SendReply(netuser, "/next to teleport to Next Valley.");
  149.             SendReply(netuser, "/big to teleport to Big Radtown.");
  150.         }
  151.     }
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement