Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System;
- using System.Reflection;
- using System.Data;
- using UnityEngine;
- using Oxide.Core;
- using Oxide.Core.Plugins;
- using RustProto;
- namespace Oxide.Plugins
- {
- [Info("Warp", "Ezki", "1.0", ResourceId = 1337)]
- class Warp : RustLegacyPlugin
- {
- public Vector3[] smallArray = new Vector3[5];
- public Vector3[] hackerArray = new Vector3[5];
- public Vector3[] hangarArray = new Vector3[5];
- public Vector3[] factoryArray = new Vector3[5];
- public Vector3[] nextArray = new Vector3[5];
- public Vector3[] bigArray = new Vector3[5];
- System.Random rnd = new System.Random();
- public NetUser cachedUser;
- RustServerManagement mana;
- int random;
- void OnServerInitialized()
- {
- mana = RustServerManagement.Get();
- }
- [ChatCommand("small")]
- void cmdChatSmall(NetUser netuser, string command, string[] args)
- {
- if (TPcheck(netuser) ){
- smallArray[0] = new Vector3(6051.788f, 376.3509f, -3593.894f);
- smallArray[1] = new Vector3(6053.698f, 376.35f, -3540.705f);
- smallArray[2] = new Vector3(6087.951f, 375.9772f, -3508.944f);
- smallArray[3] = new Vector3(6128.661f, 376.4142f, -3489.541f);
- smallArray[4] = new Vector3(6117.65f, 376.35f, -3572.279f);
- random = rnd.Next(5);
- cachedUser = netuser;
- mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, smallArray[random]);
- SendReply(netuser, "You teleported to Small Radtown.");
- }
- }
- [ChatCommand("hacker")]
- void cmdChatHacker(NetUser netuser, string command, string[] args)
- {
- if (TPcheck(netuser) ){
- hackerArray[0] = new Vector3(5217f, 438f, -2910f);
- hackerArray[1] = new Vector3(5189f, 442f, -2778f);
- hackerArray[2] = new Vector3(5283f, 434f, -2839f);
- hackerArray[3] = new Vector3(5392f, 457f, -2969f);
- hackerArray[4] = new Vector3(5324f, 435f, -2890f);
- random = rnd.Next(5);
- cachedUser = netuser;
- mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, hackerArray[random]);
- SendReply(netuser, "You teleported to Hacker Valley.");
- }
- }
- [ChatCommand("hangar")]
- void cmdChatHangar(NetUser netuser, string command, string[] args)
- {
- if (TPcheck(netuser) ){
- hangarArray[0] = new Vector3(6632f, 364f, -4333f);
- hangarArray[1] = new Vector3(6644f, 354f, -4235f);
- hangarArray[2] = new Vector3(6737f, 349f, -4258f);
- hangarArray[3] = new Vector3(6791f, 335f, -4351f);
- hangarArray[4] = new Vector3(6584f, 364f, -4252f);
- random = rnd.Next(5);
- cachedUser = netuser;
- mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, hangarArray[random]);
- SendReply(netuser, "You teleported to Hangar.");
- }
- }
- [ChatCommand("factory")]
- void cmdChatFactory(NetUser netuser, string command, string[] args)
- {
- if (TPcheck(netuser) ){
- factoryArray[0] = new Vector3(6444f, 361f, -4603f);
- factoryArray[1] = new Vector3(6393f, 361f, -4652f);
- factoryArray[2] = new Vector3(6425f, 360f, -4747f);
- factoryArray[3] = new Vector3(6294f, 358f, -4661f);
- factoryArray[4] = new Vector3(6343f, 361f, -4684f);
- random = rnd.Next(5);
- cachedUser = netuser;
- mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, factoryArray[random]);
- SendReply(netuser, "You teleported to Factory.");
- }
- }
- [ChatCommand("next")]
- void cmdChatNext(NetUser netuser, string command, string[] args)
- {
- if (TPcheck(netuser) ){
- nextArray[0] = new Vector3(4858f, 430f, -3892f);
- nextArray[1] = new Vector3(4937f, 417f, -3752f);
- nextArray[2] = new Vector3(4792f, 430f, -3745f);
- nextArray[3] = new Vector3(5017f, 419f, -3943f);
- nextArray[4] = new Vector3(5119f, 416f, -3920f);
- random = rnd.Next(5);
- cachedUser = netuser;
- mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, nextArray[random]);
- SendReply(netuser, "You teleported to Next Valley.");
- }
- }
- [ChatCommand("ghj")]
- void cmdChatBig(NetUser netuser, string command, string[] args)
- {
- if (TPcheck(netuser) ){
- nextArray[0] = new Vector3(5147f, 386f, -4667f);
- nextArray[1] = new Vector3(5111f, 4974f, -4974f);
- nextArray[2] = new Vector3(5294f, 362f, -4902f);
- nextArray[3] = new Vector3(5342f, 362f, -4772f);
- nextArray[4] = new Vector3(5286f, 372f, -4680f);
- random = rnd.Next(5);
- cachedUser = netuser;
- mana.TeleportPlayerToWorld(netuser.playerClient.netPlayer, bigArray[random]);
- SendReply(netuser, "You teleported to Big Radtown.");
- }
- }
- bool TPcheck(NetUser netuser){
- object thereturn = Interface.GetMod().CallHook("canTeleportt", new object[] { netuser });
- if (thereturn != null){
- ConsoleNetworker.SendClientCommand(netuser.networkPlayer, "chat.add ✖ " + Facepunch.Utility.String.QuoteSafe(string.Format("[color red]/gg to leave")));
- //Puts("noe");
- return false; }
- //Puts("ja");
- return true;
- }
- void SendHelpText(NetUser netuser)
- {
- SendReply(netuser, "/small to teleport Small Radtown.");
- SendReply(netuser, "/hacker to teleport to Hacker Valley.");
- SendReply(netuser, "/hangar to teleport to Hangar.");
- SendReply(netuser, "/factory to teleport to Factory.");
- SendReply(netuser, "/next to teleport to Next Valley.");
- SendReply(netuser, "/big to teleport to Big Radtown.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement