Jump to content

Pattoh

Member
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Pattoh

  1. On 11/08/2017 at 3:07 AM, Runewulv said:

    had it installed for about an hour now. Tested several vehicles with claiming. I can confirm it does not bounce a vehicle any more. Even tested it on the helis that killed me before, and no bounce. Well done mate. That interface is great too, would love to see it added to the vehicle unlock/lock script for choosing a vehicle to use the script with.

    I like that idea. very possible.

  2. Also if you use Overpoch, the animations can also cancel the bury/butcher which will be exploited. The only thing I can think of is adding disableUserInput, that will keep people locked down until the script has finished. People will be more exposed while disableUserInput is true, because they will not be able to move their camera to sweep the area.

    Quote
    
    private ["_action","_backPackMag","_backPackWpn","_crate","_corpse","_cross","_gain","_humanity","_humanityAmount","_isBury","_grave","_name","_backPack","_position","_sound"];
    
    if (dayz_actionInProgress) exitWith {"You are already performing an action, wait for the current action to finish." call dayz_rollingMessages;};
    disableUserInput true;
    dayz_actionInProgress = true;
    
    _corpse = (_this select 3) select 0;
    _action = (_this select 3) select 1;
    
    player removeAction s_player_bury_human;
    s_player_bury_human = -1;
    player removeAction s_player_butcher_human;
    s_player_butcher_human = -1;
    
    if (isNull _corpse) exitWith {dayz_actionInProgress = false; disableUserInput false; systemChat "cursorTarget isNull!";};
    
    _humanityAmount = 25; // Amount of humanity you will gain by buring a body and the amount you will lose if you butcher a body.
    
    _corpse setVariable["isBuried",true,true];
    
    _isBury = _action == "bury";
    _position = getPosATL _corpse;
    _backPack = typeOf (unitBackPack _corpse);
    
    _crate = createVehicle ["USOrdnanceBox_EP1",_position,[],0,"CAN_COLLIDE"];
    _crate setposATL [(_position select 0)+1,(_position select 1)+1.5,_position select 2];
    _crate setVariable ["permaLoot",true,true];
    _crate setVariable ["bury",true,true];
    
    _grave = createVehicle ["Grave",_position,[],0,"CAN_COLLIDE"];
    _grave setposATL [(_position select 0)+1,_position select 1,_position select 2];
    _grave setVariable ["bury",true,true];
    
    if (_isBury) then {
        _name = _corpse getVariable["bodyName","unknown"];
        _cross = createVehicle ["GraveCross1",_position,[],0,"CAN_COLLIDE"];
        _cross setposATL [(_position select 0)+1,(_position select 1)-1.2,_position select 2];
        _cross setVariable ["bury",true,true];
    };
    
    clearWeaponCargoGlobal _crate;
    clearMagazineCargoGlobal _crate;
    
    {_crate addWeaponCargoGlobal [_x, 1]} forEach weapons _corpse;
    {_crate addMagazineCargoGlobal [_x ,1]} forEach magazines _corpse;
    
    if (_backPack != "") then {
        _backPackWpn = getWeaponCargo unitBackpack _corpse;
        _backPackMag = getMagazineCargo unitBackpack _corpse;
    
        if (count _backPackWpn > 0) then {{_crate addWeaponCargoGlobal [_x,(_backPackWpn select 1) select _forEachIndex]} forEach (_backPackWpn select 0);};
        if (count _backPackMag > 0) then {{_crate addMagazineCargoGlobal [_x,(_backPackMag select 1) select _forEachIndex]} forEach (_backPackMag select 0);};
    
        _crate addBackpackCargoGlobal [_backPack,1];
    };
    
    _sound = _corpse getVariable ["sched_co_fliesSource",nil];
    if (!isNil "_sound") then {
        detach _sound;
        deleteVehicle _sound;
    };
    
    deleteVehicle _corpse;
    
    player playActionNow "Medic";
    uiSleep 8;
    
    if (_isBury) then {
        if (_name != "unknown") then {
            format["Rest in peace, %1...",_name] call dayz_rollingMessages;
        } else {
            "Rest in peace, unknown soldier...." call dayz_rollingMessages;
        };
    };
    
    _humanity = player getVariable ["humanity",0];
    _gain = if (_isBury) then {+_humanityAmount} else {-_humanityAmount};
    player setVariable ["humanity",(_humanity + _gain),true];
    
    dayz_actionInProgress = false;
    disableUserInput false;
    

     

  3. Reworked this script a bit with a big help from @salival. Safezone loyalty benefits removed (thinking maybe rewards could be halved or quartered instead), Different levels of the multiplier with humanity, standard currency variable. Thanks for making the script, and for the Safezone ideas in the thread.

     

    Quote

    private ["_multiplyer","_i","_reward","_humanity","_serverName","_multiplierLoop"];

    _serverName = "Skeleton"; //Edit this to your own server
    _i = 0;
    _multiplierLoop = 1;
    _multiplier = 1;

    while {_i <= 7} do {
        if (_i == 2) then {
            _humanity = player getVariable ["humanity",0];
            switch (true) do {
                //Friendly
                case (_humanity >= -5000 && _humanity <= 5000): {_multiplier = 1.0};
                //Bandit
                case (_humanity <= -5000): {_multiplier = 1.2};
                //Hero
                case (_humanity >= 5000): {_multiplier = 1.3};
                //Super Bandit
                case (_humanity <= -50000): {_multiplier = 1.5};
                //Super Hero
                case (_humanity >= 30000): {_multiplier = 1.8};
                //Ultra Bandit
                case (_humanity <= -100000): {_multiplier = 1.7};
                //Ultra Hero
                case (_humanity >= 60000): {_multiplier = 2};
            };

            if (isInTraderCity) then {
                format ["Loyalty time reward! %1 thank you for playing on %2! You are in a Safezone! No reward this time!",name player,_serverName] call dayz_rollingMessages;
            } else {
                _reward = (2500 * (_multiplier * _multiplierLoop));
                format ["Loyalty time reward! %1 thank you for playing on %2! Your loyalty has been rewarded with: %3 %4",name player,_serverName,_reward,currencyName]call dayz_rollingMessages;
                player setVariable [Z_moneyVariable,((player getVariable [Z_moneyVariable, 0]) + _reward),true];
                _multiplierLoop = _multiplierLoop + 1;
            };
            _i = 0;
        };
        uisleep 1800;
        _i = _i + 1;
    };
     

     

×
×
  • Create New...