Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. Question / Help (Scripts/Codes)

Question / Help (Scripts/Codes)

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
5 Posts 3 Posters 504 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • toastyundefined Offline
    toastyundefined Offline
    toasty
    wrote on last edited by toasty
    #1

    I have a few questions ( all for offline / server owner use )

    • i was wondering if its currently possible to bind a function / dvar to controller input.

    • is it possible to live update scripts while in game? or do i have to restart the game each time for it to update.

    • is it possible teleport players? (have bots/players teleport to certain spots, like a teleport all clients to crosshair / person).
      EDIT: Found Qbots by quaK [https://forum.plutonium.pw/topic/1592/release-qbots]

    • is there any way to give perks? like have quickdraw pro while using overkill?

    Also, since im trying to learn all this. is there a Chaiscript 'variable' / 'code' (idk the word im looking for), list for mw3? it would make things a lot easier to understand.

    Any help is appreciated, thanks.

    FragsAreUsundefined 1 Reply Last reply
    0
    • FragsAreUsundefined Offline
      FragsAreUsundefined Offline
      FragsAreUs Plutonium Staff
      replied to toasty on last edited by
      #2

      toasty if you going to use qbots for knife lunges and what not on a public server your going to run into issues and when it comes to saving locations it saves everyone location to where you set and not seperate

      1 Reply Last reply
      0
      • toastyundefined Offline
        toastyundefined Offline
        toasty
        wrote on last edited by
        #3

        im currently using it for private match, so i shouldn't have a problem. thanks for letting me know though.

        1 Reply Last reply
        0
        • fedundefined Offline
          fedundefined Offline
          fed
          wrote on last edited by
          #4

          To update scripts you just have to restart the map, even a simple fast_restart will do.
          For keybinds:

          def playerConnected(arguments) {
          	var player = arguments[0]
                  var thing = "thing"
                  //  player.notifyOnPlayerCommand(name, keybind);
                  player.notifyOnPlayerCommand("actionslot6", "+actionslot 6")
                  // other notifies are for example "spawned_player", "weapon_fired", "death", "killed_enemy"
                  player.onNotify("actionslot6", fun[thing/* pass variables here*/](arguments){
                       // do whatever...
                       player.iPrintLn(thing)
                  });
          }
          level.onNotify("connected", playerConnected);
          

          To teleport players, for example to yourself (you cannot tp them to where youre aiming unfortunately because the bulletTrace function that should be used for it doesn't work)

          def playerConnected(arguments) {
          	var player = arguments[0]
                  player.notifyOnPlayerCommand("actionslot6", "+actionslot 6")
                  player.onNotify("actionslot6", fun(arguments){
                      for (var i = 0; i < 18; ++i) {
                              // Players are the first 18 entities so you can just use gsc.getEntByNum() to get a player with a given clientslot
                          var playerEnt = gsc.getEntByNum(i);
                          if (playerEnt.getGuid() != player.getGuid()) {
                              playerEnt.setOrigin(player.getOrigin())
                          }
                  }
              });
          }
          level.onNotify("connected", playerConnected)
          
          

          To set perks

          // player.setperk(perk, true, true)
          player.setperk("specialty_scavenger", true, true)
          player.setperk("specialty_bulletaccuracy", true, true)
          player.setperk("specialty_fastreload", true, true)
          player.setperk("specialty_quickdraw", true, true)
          // Not sure if they all work at the same time
          

          You can also find the list of functions and other stuff at
          https://github.com/momo5502/open-iw5/blob/master/src/game/scripting/functions.cpp

          toastyundefined 1 Reply Last reply
          0
          • toastyundefined Offline
            toastyundefined Offline
            toasty
            replied to fed on last edited by
            #5

            fed thank you so much. exactly what i needed.

            1 Reply Last reply
            0

            • Login

            • Don't have an account? Register

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