Page 4 of 5 FirstFirst 12345 LastLast
Results 31 to 40 of 44

Thread: vehicle restriction

  1. #31
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    F2K...that's cool.

    I just removed it cause it didn't actually work the way I was checking for cargo.... did something stupid! I will test and update my post again.

    "Learn by doing!" - Quoted from a post by Imutep

    OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

  2. #32
    Quote Originally Posted by twirly View Post
    F2K...that's cool.

    I just removed it cause it didn't actually work the way I was checking for cargo.... did something stupid! I will test and update my post again.
    I see I thought I'd just imagined it

  3. #33
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    Quote Originally Posted by F2k Sel View Post
    I see I thought I'd just imagined it
    OK...it's back. Must be ju ju magic! Lol!

    assignedvehiclerole returns an array....that screwed me up!

  4. #34
    Sergeant matosinec's Avatar
    Join Date
    Apr 24 2011
    Location
    Croatia
    Posts
    143
    Author of the Thread
    The script works great, thanks a lot everyone.

  5. #35
    Gunnery Sergeant Mikie boy's Avatar
    Join Date
    Jun 20 2009
    Location
    United Kingdoom
    Posts
    472
    just a quick update on trial of event handlers for "getin" to vehicles. appears to work - haven't implemented the work of twirly and f2k_sel- used the first batch of code. change to suit

    tested below on mp editor - not checked on dedi

    init of the vehicle - vehctrl = [this] execVM "vehCtrlinit.sqf";


    vehCtrlinit.sqf
    Code:
    _vehicle=_this select 0;
    
    _vehicle addEventHandler ["GetIn", "if (player == (_this select 2)) then {[(_this select 0),(_this select 1),(_this select 2)] execVM 'vehRank.sqf';}"];

    vehRank.sqf
    Code:
    _vehicle = _this select 0;
    _vehseat = _this select 1;
    _unitin = _this select 0;
    hint "Got in Vehicle";
    
    hint format ["%1  in %2",_unitin,_vehicle];
    _vehlist = ["HMMWV_M998_crows_M2_DES_EP1","HMMWV_Ambulance","C H_47F_EP1","CH_47F_BAF","UH60M_MEV_EP1","BAF_Merli n_HC3_D"];
    
    while {_unitin ==_vehicle} do
    
    { 	
    //       waituntil {count playableUnits >= 1};
    	_vehchoice = vehicle player;
    		{	
    	waitUntil {(gunner _vehchoice == player)};
    	   if (gunner _vehchoice == player) then 
    			  {
    		 	if (_vehchoice iskindof _x) then          
    		 		{									 
                                if (typeOf player == "US_Soldier_Officer_EP1") then
    						{ 
    							
    							player action ["ENGINEOFF", _vehchoice];
    							player action ["eject", _vehchoice];
    							sleep 0.5;
    							_vehchoice engineOn false;
    							waituntil {vehicle player == player};	
    							hint format ["you cannot access the gun of %1 vehicles", _x];
    						};
    				};
    			   };
    		} foreach _vehlist;
    			sleep 0.5;
    	  }; //while
    [FOCK] Mikie J

    Looking for New Players at Fockersteam
    http://fockers.moonfruit.com/

    A2/OA
    COOP Most Wanted - [Fockers] Most Wanted Co-x v07-09-2012
    Fock IED - http://www.armaholic.com/page.php?id...highlight=FOCK
    Fock Recruit/Group Management - http://www.armaholic.com/page.php?id=20580

    A3
    TvTCache Hunt - [FOCK]ers Cache Hunt TvT-x [ALPHA]
    Scripting Tutotial -http://www.armaholic.com/page.php?id=20465#comments
    Fock Recruit/Group Management - http://www.armaholic.com/page.php?id=19041

  6. #36
    Sergeant matosinec's Avatar
    Join Date
    Apr 24 2011
    Location
    Croatia
    Posts
    143
    Author of the Thread
    I need restriction for vehicles when they spawn after players complete missions. So i dont know how can i put your code in init field.

  7. #37
    Gunnery Sergeant Mikie boy's Avatar
    Join Date
    Jun 20 2009
    Location
    United Kingdoom
    Posts
    472
    when you create the vehicle -

    _veh = createVehicle ["ah1w", position player, [], 0, "FLY"];
    [_veh] execVM "vehCtrlinit.sqf";

  8. #38
    Sergeant matosinec's Avatar
    Join Date
    Apr 24 2011
    Location
    Croatia
    Posts
    143
    Author of the Thread
    What is the difference between yours and F2k Sel last message with script ?

  9. #39
    Gunnery Sergeant Mikie boy's Avatar
    Join Date
    Jun 20 2009
    Location
    United Kingdoom
    Posts
    472
    nothing - really.

    best bet is to replace the code i used within the while loop with the code given by f2k-sel and twirly, but use the eventhandler to call it. this stops the while loop running until you get in the car. it stops when you get out of the car. uses less cpu regardless of the waituntil used - as far as im aware.

  10. #40
    Sergeant matosinec's Avatar
    Join Date
    Apr 24 2011
    Location
    Croatia
    Posts
    143
    Author of the Thread
    Its working, thanks.

Page 4 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Slot restriction
    By Frosties in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Sep 2 2011, 13:13
  2. Zone restriction
    By bulletoothdan in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 8
    Last Post: Aug 31 2011, 22:53
  3. Vehicle Restriction
    By Speederin in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 1
    Last Post: Mar 10 2011, 20:43
  4. Vehicle Restriction
    By Speederin in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 0
    Last Post: Mar 4 2011, 01:24
  5. Respawning vehicle crew restriction script
    By norrin in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 0
    Last Post: May 26 2007, 23:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •