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.
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.
The script works great, thanks a lot everyone.
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
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.
when you create the vehicle -
_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];
[_veh] execVM "vehCtrlinit.sqf";
What is the difference between yours and F2k Sel last message with script ?
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.