Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Crew check script - v0.3
- Checks for crew in positions of vehicle
- Created by BearBison
- */
- /* Private variables */
- private ["_Vehicle","_Soldier","_Position","_CrewCheck"];
- /* Defines the variables */
- _Vehicle = _this select 0;
- _Position = _this select 1;
- _Soldier = _this select 2;
- /* Checks the crew */
- _CrewCheck =
- {
- switch (_Position) do
- {
- case "driver":
- {
- switch (true) do
- {
- case (_Vehicle isKindOf "LIB_Tank_Base"):
- {
- if (typeOf _Soldier == "LIB_GER_spg_lieutenant") exitWith {};
- _Vehicle vehicleChat "You need to be a tank crewman to use this vehicle";
- sleep 1;
- _Soldier action ["getout",_Vehicle];
- };
- default
- {
- if (typeOf _Soldier == "LIB_GER_spg_crew") exitWith {};
- _Vehicle vehicleChat "You need to be a tank crewman to use this vehicle";
- sleep 1;
- _Soldier action ["getout",_Vehicle];
- };
- };
- };
- case "gunner":
- {
- switch (true) do
- {
- case (_Vehicle isKindOf "LIB_Tank_Base"):
- {
- if (typeOf _Soldier == "LIB_GER_spg_lieutenant") exitWith {};
- _Vehicle vehicleChat "You need to be a tank crewman to use this vehicle";
- sleep 1;
- _Soldier action ["getout",_Vehicle];
- };
- default
- {
- if (typeOf _Soldier == "LIB_GER_spg_crew") exitWith {};
- _Vehicle vehicleChat "You need to be a tank crewman to use this vehicle";
- sleep 1;
- _Soldier action ["getout",_Vehicle];
- };
- };
- };
- case "Turret":
- {
- switch (true) do
- {
- case (_Vehicle isKindOf "LIB_Tank_Base"):
- {
- if (typeOf _Soldier == "LIB_GER_spg_lieutenant") exitWith {};
- _Vehicle vehicleChat "You need to be a tank crewman to use this vehicle";
- sleep 1;
- _Soldier action ["getout",_Vehicle];
- };
- default
- {
- if (typeOf _Soldier == "LIB_GER_spg_crew") exitWith {};
- _Vehicle vehicleChat "You need to be a tank crewman to use this vehicle";
- sleep 1;
- _Soldier action ["getout",_Vehicle];
- };
- };
- };
- };
- };
- /* Calls crew check */
- call _CrewCheck;
- /* Waits until position is changed */
- waitUntil {((assignedVehicleRole _Soldier) select 0 != "cargo")||(vehicle _Soldier == _Soldier)};
- sleep 1;
- /* Exits if no longer in a vehicle */
- if (vehicle _Soldier == _Soldier) exitwith {};
- /* Gets new position */
- _Position = (assignedVehicleRole _Soldier) select 0;
- /* Calls crew check */
- call _CrewCheck;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement