Beispiel #1
0
        void OnPlayerSpawn(PlayerClient player)
        {
            if (player.GetComponent <P250arena>())
            {
                timer.Once(2f, () => {
                    if (player.rootControllable == null)
                    {
                        return;
                    }
                    player.rootControllable.rootCharacter.takeDamage.SetGodMode(true);
                    timer.Once(5f, () => {
                        if (player.rootControllable == null)
                        {
                            return;
                        }
                        player.rootControllable.rootCharacter.takeDamage.SetGodMode(false);
                    });
                    TeleportPlayer(player.netUser);
                    var Inv = player.netUser.playerClient.rootControllable.idMain.GetComponent <Inventory>();
                    Inv.Clear();
                    var message = GetMessage("Go, Go, Go | P250 spawn", player.netUser.userID.ToString());
                    rust.Notice(player.netUser, message, "ッ");
                    GiveKit(player.netUser, "kitp250");
                });
            }
            var messages = GetMessage("Go, Go, Go", player.netUser.userID.ToString());

            rust.Notice(player.netUser, messages, "ッ");
            timer.Once(timeSpawn, () => GiveSpawns(player.netUser));
        }
Beispiel #2
0
        /////////////////////////
        // OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        // Called when a player spawns (after connection or after death)
        /////////////////////////
        void OnPlayerSpawn(PlayerClient player, bool useCamp, RustProto.Avatar avatar)
        {
            if (hasPermission(player.netUser))
            {
                return;
            }
            PlayerHandler phandler = player.GetComponent <PlayerHandler>();

            if (phandler == null)
            {
                phandler = player.gameObject.AddComponent <PlayerHandler>(); phandler.timeleft = GetPlayerData(player);
            }
            timer.Once(0.1f, () => phandler.StartCheck());
        }
Beispiel #3
0
 static void Punish(PlayerClient player, string reason)
 {
     if (player.netUser.CanAdmin())
     {
         Debug.Log(string.Format("Ignored punish on {0} because he is an admin.", player.userName));
         if (player.GetComponent <PlayerHandler>() != null)
         {
             GameObject.Destroy(player.GetComponent <PlayerHandler>());
         }
         return;
     }
     if (punishByBan)
     {
         AntiCheatBan(player.userID, player.userName, reason);
         Interface.CallHook("cmdBan", player.userID.ToString(), player.userName, reason);
         Debug.Log(string.Format("{0} {1} was auto banned for {2}", player.userID.ToString(), player.userName.ToString(), reason));
     }
     AntiCheatBroadcast(string.Format(playerHackDetectionBroadcast, player.userName.ToString()));
     if (punishByKick || punishByBan)
     {
         player.netUser.Kick(NetError.Facepunch_Kick_Violation, true);
         Debug.Log(string.Format("{0} {1} was auto kicked for {2}", player.userID.ToString(), player.userName.ToString(), reason));
     }
 }
Beispiel #4
0
        void CheckPlayer(PlayerClient player, bool forceAdmin)
        {
            PlayerHandler phandler = player.GetComponent <PlayerHandler>();

            if (phandler == null)
            {
                phandler = player.gameObject.AddComponent <PlayerHandler>();
            }
            if (!forceAdmin && hasPermission(player.netUser))
            {
                phandler.timeleft = 0f;
            }
            else
            {
                phandler.timeleft = timetocheck;
            }
            timer.Once(0.1f, () => phandler.StartCheck());
        }