TheDog 0 Posted April 2, 2009 hey guys, ive been going up and down forums and websites and cant figure it out, i want to script it to where the player CAN NOT move but still can use his mouse. disableinput or what it is does not work since it takes out the mouse. i want to disable a players movement for 30 seconds but still let him use his action menu/ mouse controls. before the mission starts the player spawns and stands still for 30 seconds, he can use his mouse to scroll into his action menu where he will find load out classes for example, rifleman, automatic rifleman etc. once he selects it he receives the loadout after 30 seconds the mission starts. any ideas around my problem or any pin point solutions? thanks guys Dog Share this post Link to post Share on other sites
Rav_Raven 8 Posted April 3, 2009 (edited) Hello. I made a special script. Run for each player you want to freeze. Maintains position, direction and animation before the use of the script . You can use the Actions menu and the mouse, which always displays a dialog box before activating this script. Greetings. ******************************************************************************* // ** * * * Funcion: Freeze.sqf // ** * Descripcion: Immobilises unit temporarily // ******************************************************************************* // ** * * * * Autor: RAVEN // ** * * * * * Use: nil = [name_unit/this, seconds/freeze] execVM "freeze.sqf" // ** * * * Example: nil = [this, 10] execVM "freeze.sqf" // ******************************************************************************* private ["_man", "_retro", "_tempo","_pos","_dir","_mov"]; _man = _this select 0; _retro = _this select 1; _pos = position _man; _dir = direction _man; _mov = animationState _man; _tempo = (time + _retro); while {time < _tempo} do { _man setpos _pos; _man setdir _dir; _man switchmove _mov; sleep 0.01; }; Edited April 13, 2009 by W0lle Share this post Link to post Share on other sites
TheDog 0 Posted April 3, 2009 (edited) wow can you cook? cuz if you can will you marry me? ill try this out first thing tomorrow and let you know how it goes thanks man EDIT: THIS WORKS PERFECT, thank you so much man Edited April 13, 2009 by W0lle Share this post Link to post Share on other sites
UNN 0 Posted April 5, 2009 (edited) Using Nil like this is bad, as Worldeater already mentioned on the wiki: // ** * * * * * Use: nil = [name_unit/this, seconds/freeze] execVM "freeze.sqf" // ** * * * Example: nil = [this, 10] execVM "freeze.sqf" Not sure who first suggested it, but it just causes problems for anyone who wants to use Nil to remove variables. It's easy enough to create a variable that does not screw up other peoples scripts. sP=[this, 10] execVM "freeze.sqf" Edited April 13, 2009 by UNN Share this post Link to post Share on other sites
Curatalo 0 Posted April 13, 2009 I checked this script out, and it worked, except for the fact that if the unit dies, he is still standing up completely still. Is there a simple way to change that? I made this "detain" civilian script in sqs, and now that i ported it over to sqf, specificly for this script to work with it, I would like for this script to work well with it. So please help me out. Thanks. Good script. Share this post Link to post Share on other sites
snkman 351 Posted April 13, 2009 Simply check, if the unit is alive. ******************************************************************************* // ** * * * Funcion: Freeze.sqf // ** * Descripcion: Immobilises unit temporarily // ******************************************************************************* // ** * * * * Autor: RAVEN // ** * * * * * Use: nil = [name_unit/this, seconds/freeze] execVM "freeze.sqf" // ** * * * Example: nil = [this, 10] execVM "freeze.sqf" // ******************************************************************************* private ["_man", "_retro", "_tempo","_pos","_dir","_mov"]; _man = _this select 0; _retro = _this select 1; _pos = position _man; _dir = direction _man; _mov = animationState _man; _tempo = (time + _retro); while {alive _man && time < _tempo} do { _man setpos _pos; _man setdir _dir; _man switchmove _mov; sleep 0.01; }; Share this post Link to post Share on other sites
Curatalo 0 Posted April 14, 2009 Thanks for the quik response. it works! Much thanks! Share this post Link to post Share on other sites