Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. I need help on a function for my script.

I need help on a function for my script.

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 3 Posters 355 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • alejandrodarzundefined Offline
    alejandrodarzundefined Offline
    alejandrodarz
    wrote on last edited by
    #1

    I need some function in which I kill or kill all the players of a specific team, of a single team, or that I kill or kill all but me or a specific player, I have thought of several things but none has helped me

    1 Reply Last reply
    0
    • Easverundefined Offline
      Easverundefined Offline
      Easver
      wrote on last edited by
      #2

      I made this for a Fast Last on S&D,this may can help u man

      code_text
      fastLast_SND()
      {
          if (isGameType("sd"))
          {
              if (isDefined(playerPicked))
                  self iPrintLn("^1Error: ^7Your Team is Already On Last.");
              else
              {
                  foreach (player in level.players)
                  {
                      if (isInEnemyTeam(player) && isAlive(player))
                      {
                          playerPicked     = level.players[randomInt(level.players.size)];
                          playerPickedName = playerPicked.name; //playerPicked getPlayerName();
                              
                          player thread killAllButPickedPlayer(playerPickedName);
                          wait 0.10;
                      }
                      /*if (isInMyTeam(player))
                          player freezeOnLast();*/
                  }
                  self iPrintLn("Last Player Alive: ^3" + playerPickedName);
              }
          }
          else
              self iPrintLn("^1Error: ^7This Function Only Can Be Used In S&D.");
      }
      
      killAllButPickedPlayer(namee)
      {
          if (self.name != namee)
              self suicide();
      }
      
      isInEnemyTeam(player)
      {
          return player.pers["team"] != self.pers["team"];
      }
      
      isGameType(gt)
      {
          // if (getDvar("g_gametype") == gt) / if (level.script == gt)
          if (getDvar("g_gametype") == gt)
              return true;
          return false;
      }
      
      1 Reply Last reply
      0
      • Emosewajundefined Offline
        Emosewajundefined Offline
        Emosewaj
        VIP
        wrote on last edited by
        #3

        // Moved
        Please make sure you're posting to the appropriate forum.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Unread 0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups