Question / Help (Scripts/Codes)
-
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.
-
-
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.
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
-
-
im currently using it for private match, so i shouldn't have a problem. thanks for letting me know though.
-
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 timeYou can also find the list of functions and other stuff at
https://github.com/momo5502/open-iw5/blob/master/src/game/scripting/functions.cpp -
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 timeYou can also find the list of functions and other stuff at
https://github.com/momo5502/open-iw5/blob/master/src/game/scripting/functions.cppfed thank you so much. exactly what i needed.
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