Jump to content
Sign in to follow this  
profcupcake

Dead Simple Vehicle Restrictor Script

Recommended Posts

A script that will restrict certain vehicles to certain drivers/gunners/commanders (or pilots/copilots, etc.). If a unit which is not allowed to be the driver, gunner or commander of a vehicle attempts to go into those spots, they are removed, and get a warning message. Two sentences is all my mind can cope with.

Download link

Armaholic page

(Made on request for a squadmate)

Edited by ProfCupcake
  • Like 1

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Edited by Guest
mirror updated with the below version

Share this post


Link to post
Share on other sites

UPDATE

  • It now also checks the commander spot, which I had overlooked.
  • It now uses "Eject" instead of "GetOut", due to most "GetOut" animations being too slow. Never mind, reverted it. It doesn't skip the animation when the vehicle is stationary, seemingly. Gah. Aha! I knew it existed somewhere. It now uses moveOut, which does instantly eject units without animation.
  • It now also supports player UIDs for the 'allowed drivers' list.

Edited by ProfCupcake

Share this post


Link to post
Share on other sites

Like your simple scripts! Especially for someone new to arma scripting.

However, the copilot can still take controls and this position is accessible by those whom aren't on the list. I'm looking for the name of the that position but it's taking me awhile to find the list in the config viewer.

Share this post


Link to post
Share on other sites
Like your simple scripts! Especially for someone new to arma scripting.

However, the copilot can still take controls and this position is accessible by those whom aren't on the list. I'm looking for the name of the that position but it's taking me awhile to find the list in the config viewer.

use ControlsShifted event and you will know who has taken control...

http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers

Share this post


Link to post
Share on other sites

Thanks 51Mariodu62,

I setup this in the init of one of the heli's

this addEventHandler ["ControlsShifted", {null = [] execVM "Scripts\coPilot.sqf"}]

this is in the coPilot.sqf

if (typeof player != "B_Helipilot_F")then
{
moveOut player;
hint "You are not authorized to fly";
};

Which works, however, I'd like to be able to just switch controls back without moving the player out. I have not the slightest idea on how to do that.

Share this post


Link to post
Share on other sites
Like your simple scripts! Especially for someone new to arma scripting.

However, the copilot can still take controls and this position is accessible by those whom aren't on the list. I'm looking for the name of the that position but it's taking me awhile to find the list in the config viewer.

Uh, are you sure? It checks all positions on the vehicle except cargo, so that shouldn't be possible.

Is there a specific vehicle this happens in? Can you reproduce it with the latest version?

---------- Post added at 14:35 ---------- Previous post was at 14:33 ----------

UPDATE

  • You can now choose which seats are checked
  • You can now set the message shown when a player is ejected
  • You can now call the script multiple times to effectively make multiple separate whitelists
  • Slightly optimised

Details on how to use the above features are in the USAGE.txt

---------- Post added at 14:44 ---------- Previous post was at 14:35 ----------

...someone new to arma scripting...

That's pretty much exactly why I started on really simple stuff :D

Share this post


Link to post
Share on other sites
Guest

Newest version frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Sorry have not got around to testing the new version since it's just a small group of us playing the mission as of now.

However, I realized that I disabled the gunner check and that's most likely the reason I was able to sit in the copilot seat and take controls. When I get some more time and the mission is nearing public ready I'll test it out again.

Share this post


Link to post
Share on other sites

Was reading through the command list for something and found one for enableCoPilot!

So, all that has to be done for the copilot issue is to add

this enableCopilot false;

To the vehicle's init or similar.

Share this post


Link to post
Share on other sites

I am unable to get this to work either.

init.sqf

[s]if (!isDedicated) then {
      waitUntil {!isNull player}; // waitUntil the player variable exists[/s]

[["O_MBT_02_cannon_F"],["O_crew_F"], "Only a Tank Crewman can operate the tank.",true,true,true]
execVM "scripts\restrictVehicles.sqf";

EDIT: Works Now.

Edited by Rellikplug
Crossed out part was preventing

Share this post


Link to post
Share on other sites
I am unable to get this to work either.

init.sqf

[s]if (!isDedicated) then {
      waitUntil {!isNull player}; // waitUntil the player variable exists[/s]

[["O_MBT_02_cannon_F"],["O_crew_F"], "Only a Tank Crewman can operate the tank.",true,true,true]
execVM "scripts\restrictVehicles.sqf";

EDIT: Works Now.

Yeah, looks like you missed a } there. Other than that, it seems solid.

Share this post


Link to post
Share on other sites
Uh, are you sure? It checks all positions on the vehicle except cargo, so that shouldn't be possible.

Is there a specific vehicle this happens in? Can you reproduce it with the latest version?

the scripts works perfectly on the hellcat. it does not include the copilot seat on the rest of the choppers.. but does include the left door gunner of a ghost hawk..

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  

×