Code:
neo_cleanup = {
{
deleteVehicle _x;
} forEach allDead;
{
deleteVehicle _x;
} forEach (position player nearObjects ["Land_CargoBox_V1_F",1000]);
neo_count = 0;
hintSilent format ["Entities: %1", neo_count];
};
neo_fnc_throw = {
_height = getPosASL player select 2;
_height = _height + 5;
_pos = [player, 5, getDir player] call BIS_fnc_relPos;
_pos set [2, _height];
_object = objNull;
switch (neo_type) do {
case 0 : {
_class = "Land_CargoBox_V1_F";
_object = createVehicle [_class, position player, [], 0, "NONE"];
_object allowDamage neo_damage;
_object setVectorUp [random 1, random 1, random 1];
_object setVectorDir [random 1, random 1, random 1];
_object setPosASL _pos;
};
};
_object setVelocity [(eyeDirection player select 0) * neo_force, (eyeDirection player select 1) * neo_force, (eyeDirection player select 2) * neo_force];
neo_count = neo_count + 1;
hintSilent format ["Entities: %1", neo_count];
};
neo_fnc_push = {
{
if (_x != player) then {
_dir = [player, _x] call BIS_fnc_dirTo;
_x setVelocity [sin _dir * neo_force, cos _dir * neo_force, neo_force / 10];
};
} forEach (position player nearObjects 100);};
neo_fnc_pull = {
{
if (_x != player) then {
_dir = [_x, player] call BIS_fnc_dirTo;
_pos = getposatl _x;
_z = _pos select 2;
if(_z < 10) then {
_x setVelocity [sin _dir * random 10, cos _dir * random 5, neo_force / 2];
} else {
_x setVelocity [sin _dir * random 10, cos _dir * random 5, 0];
};
};
} forEach (position player nearObjects ["Land_CargoBox_V1_F",200]);
};
//Params
neo_throwing = false;
neo_pushing = false;
neo_pulling = false;
neo_type = 0;
neo_damage = false;
neo_count = 0;
neo_force = 10;
//Input handler
findDisplay 46 displayAddEventHandler ["KeyDown", "if (_this select 1 == 2) then { neo_throwing = true; }; if (_this select 1 == 4) then { neo_pushing = true; }; if (_this select 1 == 3) then { neo_pulling = true; };"];
findDisplay 46 displayAddEventHandler ["KeyUp", "if (_this select 1 == 2) then { neo_throwing = false; }; if (_this select 1 == 4) then { neo_pushing = false; }; if (_this select 1 == 3) then { neo_pulling = false; };"];
//Loop
onEachFrame {
if (neo_throwing) then { [] call neo_fnc_throw; };
if (neo_pushing) then { [] call neo_fnc_push; };
if (neo_pulling) then { [] call neo_fnc_pull; };
};
//Actions
player addAction ["Force - LOW", {neo_force = _this select 3;}, 10, -1, false, true, "", "neo_force != 10"];
player addAction ["Force - MEDIUM", {neo_force = _this select 3;}, 50, -1, false, true, "", "neo_force != 50"];
player addAction ["Force - HIGH", {neo_force = _this select 3;}, 100, -1, false, true, "", "neo_force != 100"];
player addAction ["Force - HUGE", {neo_force = _this select 3;}, 500, -1, false, true, "", "neo_force != 500"];
player addAction ["Allow Damage", {neo_force = _this select 3;}, true, -1, false, true, "", "!neo_damage"];
player addAction ["Do Not Allow Damage", {neo_force = _this select 3;}, false, -1, false, true, "", "neo_damage"];
player addAction ["Clean Up", {[] spawn neo_cleanup;}, [], -1, false, true, "", "true"];
//Hint
hint "Welcome to the PhysX Hack\n\n\nPress 1 to spawn object with applied forces.\n\nPress 2 and 3 to apply forces to nearby objects.\n\n\nHave fun!";
The correct Creds Go here