Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //RTG prototype script
- _thisVehicle setVariable ["helplift", 0, true];
- [
- _thisVehicle,
- "Unflip Vehicle",
- "\a3\ui_f\data\GUI\Cfg\KeyframeAnimation\IconCurve_CA.paa",
- "\a3\ui_f\data\GUI\Cfg\KeyframeAnimation\IconCurve_CA.paa",
- "_this distance _target < 8 and ((vectorUp _target) vectorCos (surfaceNormal getPos _target) <0.5 && _target == vehicle _target && (vehicle player) == player && alive _target)",
- "_caller distance _target < 8",
- {
- _target setVariable ["helplift", ((_target getVariable "helplift") + 1), true];
- systemchat "Attempt to unflip the vehicle, ask more players to also hold this action with you";
- },
- {
- //unflip possibility
- if !(((vectorUp _target) vectorCos (surfaceNormal getPos _target) <0.5 && _target == vehicle _target && (vehicle player) == player && alive _target)) exitwith {};
- _help = (_target getVariable "helplift");
- _vehicleMass = (getmass _target);
- _helpMassDiscount = 500*_help;
- _WholeValue = _vehicleMass;
- _MyNumber = _helpMassDiscount;
- _fraction = (_MyNumber/_WholeValue);
- _pecentage = floor (200*_fraction);
- _text = format ["You have %1%2 of chance to unflip this vehicle by holding this action", _pecentage, "%"];
- titleText [_text, "PLAIN",0.1, true, true];
- if ((random 100) < _pecentage) then {
- systemchat "vehicle unfliped";
- _vehicle = _target;
- _safeposs = [getPosATL _vehicle, 0, 50, 8, 0, 0.7, 0, [], []] call BIS_fnc_findSafePos;
- if (count _safeposs != 3) then {_safeposs = getposatl _vehicle};
- _normalVec = surfaceNormal getPos _vehicle;
- if (!local _vehicle) then {
- [_vehicle,_normalVec] remoteExec ["setVectorUp",_vehicle];
- } else {
- _vehicle setVectorUp _normalVec;
- };
- _vehicle setPosATL [_safeposs select 0, _safeposs select 1, 0];
- };
- _vehicle setVelocity [0, 0, 0];
- },
- {
- systemchat "Unfliping canceled";
- _target setVariable ["helplift", ((_target getVariable "helplift") - 1), true];
- },
- {
- systemchat "Unfliping canceled";
- _target setVariable ["helplift", ((_target getVariable "helplift") - 1), true];
- },
- [],
- 20,
- 0,
- false,
- false
- ] remoteExec ["BIS_fnc_holdActionAdd", 0, true];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement