Graz 1 Posted December 13, 2012 (edited) I've got a script to force first person if you are in a helicopter. The trouble is Helicopters spawn throughout the mission and AI helicopter can be stolen by players. I'm unsure how to run this script effectively, it's in the dircetory .pbo/scripts/force_firstperson.sqf Two questions 1. How can I get this script to run on all players constantly throughout the mission 2. Will it repeat (Ie the get in a helicopter and get out, will the script run when they get in another helicopter??) //force first_person.sqf while {vehicle player isKindOf "Helicopter} do { if(cameraView == "EXTERNAL" || cameraView == "GROUP") then { vehicle player switchCamera "INTERNAL"; }; sleep 0.1; }; This script was found here (Thanks Bon) : http://forums.bistudio.com/showthread.php?115454-force-1st-person&highlight=force+1st+person Edited December 13, 2012 by Graz Share this post Link to post Share on other sites
lifted86 10 Posted December 13, 2012 (edited) this might work while {true} do { if((cameraView == "EXTERNAL" || cameraView == "GROUP") && (vehicle player isKindOf "Helicopter)) then { vehicle player switchCamera "INTERNAL"; }; sleep 0.1; }; put this in the unit init _nvm = [] execVM "scripts/force_firstperson.sqf"; Edited December 13, 2012 by Lifted86 Share this post Link to post Share on other sites
iceman77 19 Posted December 13, 2012 There, I fixed a small typo :p while {true} do { if((cameraView == "EXTERNAL" || cameraView == "GROUP") && (vehicle player isKindOf "Helicopter")) then { vehicle player switchCamera "INTERNAL"; }; sleep 0.1; }; Share this post Link to post Share on other sites
Graz 1 Posted December 14, 2012 Awesome, unfortunately putting it in the vehicle init line doesn't seem to be an option as there is vehicle's spawned mid mission. I'm uncomfortable cracking open someone elses mod to place init lines either. The code is awesome, is there anywhere else I can use it apart from the vehicle init? Share this post Link to post Share on other sites
cuel 25 Posted December 14, 2012 You shouldn't put it in the vehicle init. Put it in the init.sqf if (!isDedicated) then { 0 spawn { while {true} do { if((cameraView == "EXTERNAL" || cameraView == "GROUP") && (vehicle player isKindOf "Helicopter")) then { vehicle player switchCamera "INTERNAL"; }; sleep 0.1; }; }; }; Share this post Link to post Share on other sites
Graz 1 Posted December 16, 2012 works perfectly. Thanks again Cuel Share this post Link to post Share on other sites