Jump to content
Sign in to follow this  
spanishsurfer

3rd Person Vehicle 1st Person Infantry LOCK (working, kinda)

Recommended Posts

Greetings! This is my first foray into the scripting forums, I hope you guys can help me! So thanks to Bl!P's guidance I implemented my first script into BECTI. The code BL!P gave me DOES work, if you're infantry it forces you to go back to 3rd person view, if you're in a vehicle you can switch around no problem. The only issue I'm having is that as soon as the player runs he can go into 3rd person w/no problems, as soon as you slow down though it goes back to first person view.

Can anyone with some expereince look at the code and figure out why it's doing this? It would be very much appreciated! Thanks guys.

   gameplayLimit3dview = 1;

   if (difficultyEnabled "3rdPersonView") then
   {
                   switch (gameplayLimit3dview) do
           {
           case 1://vehicles only
                   {
                           while {(true)} do
                           {
                                   if (cameraView == "External") then
                                   {
                                           if ((vehicle player) == player) then
                                           {
                                           player switchCamera "Internal";
                                           };
                                   };
                                   sleep 0.1;
                           };
                   };
           case 2://infantry only
                   {
                           while {(true)} do
                           {
                                   if (cameraView == "External") then
                                   {
                                           if ((vehicle player) != player) then
                                           {
                                           (vehicle player) switchCamera "Internal";
                                           };
                                   };
                                   sleep 0.1;
                           };
                   };
           case 3://disabled
                   {
                           while {(true)} do
                           {
                                   if (cameraView == "External") then
                                   {
                                           if ((vehicle player) == cameraOn) then
                                           {
                                           (vehicle player) switchCamera "Internal";
                                           };
                                   };
                                   sleep 0.1;
                           };
                   };
           };
   };

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×