Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
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 1.1k 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.
  • 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
    • toastyundefined toasty

      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 Offline
      FragsAreUsundefined Offline
      FragsAreUs
      Plutonium Staff
      wrote 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
          • fedundefined fed

            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 Offline
            toastyundefined Offline
            toasty
            wrote on last edited by
            #5

            fed thank you so much. exactly what i needed.

            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