MasterPuffin 21 Posted February 27, 2017 When executed, this script will holster your weapon, or puts it on your back. You can draw your weapon again using 1 or 2 on your keyboard. player action ["SWITCHWEAPON",player,player,-1]; waitUntil {currentWeapon player == "" or {primaryWeapon player == "" && handgunWeapon player == ""}}; You can either use addaction or a keyhandler to execute the script. If you have any questions or need help with your mission feel free to ask! Cheers Puffin 4 Share this post Link to post Share on other sites
Silberpfeil95 0 Posted July 5, 2022 Hey, i tried to use your script for my private stratis trainingsfield server for me and my friendds. I used copy and paste for the script into my addAction.sqf but it doesn't work .... did i forget something else? Please help me 😵 sincerely, Kilian Share this post Link to post Share on other sites
Harzach 2518 Posted July 5, 2022 1 hour ago, Silberpfeil95 said: I used copy and paste There's an invisible/corrupt character present when you copy the code above: When pasted into a code block, they appear as red dots. You can simply delete them. Here's a clean version: player action ["SWITCHWEAPON",player,player,-1]; waitUntil {currentWeapon player == "" or {primaryWeapon player == "" && handgunWeapon player == ""}}; 1 Share this post Link to post Share on other sites
Silberpfeil95 0 Posted July 5, 2022 Hey Harzach, thank you so much for your fast reply! I use your clean version for my addAction.sqf ... but i cant find any options inGame for weapon holster o.O Share this post Link to post Share on other sites
Harzach 2518 Posted July 5, 2022 3 hours ago, Silberpfeil95 said: my addAction.sqf Show your code. Also, how are you calling the script? Share this post Link to post Share on other sites
Silberpfeil95 0 Posted July 6, 2022 I used your code 1:1 into my addActions.sqf ... what do you mean with "how are you calling" ? Did i have to edit an other folder oder sqf file? player action ["SWITCHWEAPON",player,player,-1]; waitUntil {currentWeapon player == "" or {primaryWeapon player == "" && handgunWeapon player == ""}}; Share this post Link to post Share on other sites
Harzach 2518 Posted July 6, 2022 An .sqf file sitting in your mission folder does nothing until it is called - with the exception of event scripts, which we'll use below. If you have an .sqf file in your mission folder named "addAction.sqf" then it needs to be called (I.E. run/executed/etc.) in some way. Since this is for your multiplayer scenario, it would probably be fine to call it from both initPlayerLocal.sqf and onPlayerRespawn.sqf (if you have respawns enabled.) If those event scripts don't already exist in your mission folder, you must create them. initPlayerLocal.sqf: params ["_player", "_didJIP"]; _player execVM "addAction.sqf"; onPlayerRespawn.sqf: params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"]; _newUnit execVM "addAction.sqf"; addAction.sqf: params ["_player"]; _player action ["SWITCHWEAPON", _player, _player, -1]; waitUntil {currentWeapon _player == "" or {primaryWeapon _player == "" && handgunWeapon player == ""}}; Note that "player" is now the local variable "_player" in addAction.sqf. 1 Share this post Link to post Share on other sites
Silberpfeil95 0 Posted July 7, 2022 Thank you so much for your help and your time !!! 😰 Your script worked perfectly! but i need a script like the holster script in wasteland ... with your script, the player holstered the weapon instantly after joining the server. but my wish is it to holster weapon whenever i want it. Do you understand what i mean? 😄 Share this post Link to post Share on other sites
Ibragim A 163 Posted July 8, 2022 15 hours ago, Silberpfeil95 said: Thank you so much for your help and your time !!! 😰 Your script worked perfectly! but i need a script like the holster script in wasteland ... with your script, the player holstered the weapon instantly after joining the server. but my wish is it to holster weapon whenever i want it. Do you understand what i mean? 😄 If so, you must use the addaction command in your addAction.sqf script Like: params ["_player"]; _player addAction ["Text you like", {(_this select 0) action ["SWITCHWEAPON", (_this select 0), (_this select 0), -1];}]; It seems to me that for your idea, the waitUntil loop is useless. 2 Share this post Link to post Share on other sites
Silberpfeil95 0 Posted July 10, 2022 Okay thank you for your help! I`ll test asap! But i have a other question .... i got this error report every time i start my private wasteland server: Quote No entry 'bin\confic.bin/CfgWorlds.Tanoa-dev' But i cant find the right solution -.- can you help me pls? 🤕 Share this post Link to post Share on other sites
Harzach 2518 Posted July 10, 2022 What is your mission .pbo's full file name? To the point, it seems that you have sourced a Wasteland file that was built on the pre-release version of Tanoa/Apex. http://forums.a3wasteland.com/index.php?topic=2749.0 Your full mission .pbo file name should be MissionName.Tanoa.pbo 1 Share this post Link to post Share on other sites