Jump to content

Cancel animation


godmode8

Recommended Posts

 

Tell me, how can this script to cancel the animation? It is necessary that the analysis of the case was immediate.

epoch_returnChange.sqf

Spoiler

// Made for DayZ Epoch by vbawol 

private ["_trade_total","_part_inWorth","_part_in_configClass","_total_currency","_part","_worth","_return_change","_total","_briefcase_100oz","_gold_10oz_a","_gold_10oz_b","_gold_10oz","_gold_1oz_a","_gold_1oz_b","_gold_1oz","_silver_10oz_a","_silver_10oz_b","_silver_10oz","_silver_1oz_a","_silver_1oz_b","_silver_1oz","_successful","_buyOrSell","_total_items"];
_successful = false;
_canAfford = false;

_buyOrSell = (_this select 1);

//diag_log format["DEBUG TRADER INPUT: %1", (_this select 0)];

// buying in currency
_trade_total = (_this select 0) call epoch_itemCost;

//diag_log format["DEBUG TRADER INPUT TOTAL: %1", _trade_total];

_total_currency_dry = call epoch_totalCurrency;

_return_change_dry = 0;
if (_buyOrSell == 0) then {
    //buy
    _return_change_dry = _total_currency_dry - _trade_total; 
} else {
    //sell
    _return_change_dry = _total_currency_dry + _trade_total; 
};

//diag_log format["DEBUG TRADER DRY: %1", _return_change_dry];

if (_return_change_dry >= 0) then {
    _canAfford = true;
};

if (_canAfford) then {

    // total currency
    _total_currency = 0;
    {
        _part =  (configFile >> "CfgMagazines" >> _x);
        _worth =  (_part >> "worth");
        if isNumber (_worth) then {
            if (([player,_part,1] call BIS_fnc_invRemove) == 1) then {
                _total_currency = _total_currency + getNumber(_worth);
            };
        };

    } count (magazines player);

    //diag_log format["DEBUG TRADER INPUT CURRENCY TOTAL: %1", _total_currency];

    _return_change = 0;
    if (_buyOrSell == 0) then {
        //buy
        _return_change = _total_currency - _trade_total; 
    } else {
        //sell
        _return_change = _total_currency + _trade_total; 
    };

    //diag_log format["DEBUG TRADER CHANGE: %1", _return_change];

    if (_return_change >= 0) then {
        
        // total currency
        _total = _return_change;

        _briefcase_100oz = floor(_total / 10000);

        _gold_10oz_a = floor(_total / 1000);
        _gold_10oz_b = _briefcase_100oz * 10;
        _gold_10oz = (_gold_10oz_a - _gold_10oz_b);

        _gold_1oz_a = floor(_total / 100);
        _gold_1oz_b = _gold_10oz_a * 10;
        _gold_1oz = (_gold_1oz_a - _gold_1oz_b);

        _silver_10oz_a = floor(_total / 10);
        _silver_10oz_b = _gold_1oz_a * 10;
        _silver_10oz = (_silver_10oz_a - _silver_10oz_b);

        _silver_1oz_a = floor(_total);
        _silver_1oz_b = _silver_10oz_a * 10;
        _silver_1oz = (_silver_1oz_a - _silver_1oz_b);


        if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };
        if (_gold_10oz > 0) then {
            if (_gold_10oz == 1) then {
                player addMagazine "ItemGoldBar10oz";
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _gold_10oz, "ItemGoldBar10z"];
            } else {
                player addMagazine format["ItemBriefcase%1oz",floor(_gold_10oz*10)];
                //diag_log format["DEBUG TRADER CHANG MADE: ItemBriefcase%1oz", floor(_gold_10oz*10)];
            };
        };
        if (_gold_1oz > 0) then {
            if (_gold_1oz == 1) then {
                player addMagazine "ItemGoldBar";
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _gold_1oz, "ItemGoldBar"];
            } else {
                player addMagazine format["ItemGoldBar%1oz",_gold_1oz];
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _gold_1oz, "ItemGoldBar"];
            };
        };
        if (_silver_10oz > 0) then {
            if (_silver_10oz == 1) then {
                player addMagazine "ItemSilverBar10oz";
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _silver_10oz, "ItemSilverBar10oz"];
            } else {
                player addMagazine format["ItemBriefcaseS%1oz",floor(_silver_10oz*10)];
                //diag_log format["DEBUG TRADER CHANG MADE: ItemBriefcaseS%1oz", floor(_silver_10oz*10)];
            };
        };
        if (_silver_1oz > 0) then {
            if (_silver_1oz == 1) then {
                player addMagazine "ItemSilverBar";
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _silver_1oz, "ItemSilverBar"];
            } else {
                player addMagazine format["ItemSilverBar%1oz",_silver_1oz];
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _silver_1oz, "ItemSilverBar"];
            };
        };
        _successful = true;
    };
};
_successful

 

Link to comment
Share on other sites

On 10/9/2016 at 2:28 PM, godmode8 said:

No. It is necessary to cancel the animation when removed gold from the suitcase

you can try add a close display in each case (bellow each "addMagazine" )

for example

Spoiler

if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                (FindDisplay 106) closeDisplay 1;
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };

 

Link to comment
Share on other sites

18 hours ago, juandayz said:

you can try add a close display in each case (bellow each "addMagazine" )

for example

  Hide contents

if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                (FindDisplay 106) closeDisplay 1;
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };

 

unfortunately it does not work :sad:

Link to comment
Share on other sites

26 minutes ago, godmode8 said:

unfortunately it does not work :sad:

do you wanna close inventory once you extract the gold from briefcase right?

why you not try using the seleenaparat way in your old post?  something like:

Spoiler

  if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                 if( !isNull (FindDisplay 106) ) then {
        
            (FindDisplay 106) closeDisplay 1;

           sleep 1;
            systemChat format["Inventory was closed to prevent any dupe"];//put your own text
        };
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };

 

Link to comment
Share on other sites

1 hour ago, juandayz said:

do you wanna close inventory once you extract the gold from briefcase right?

yes! 
or cancel the animation "Medic"

1 hour ago, juandayz said:

why you not try using the seleenaparat way in your old post?

I understand very bad scripts

1 hour ago, juandayz said:

  if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                 if( !isNull (FindDisplay 106) ) then {
        
            (FindDisplay 106) closeDisplay 1;

           sleep 1;
            systemChat format["Inventory was closed to prevent any dupe"];//put your own text
        };
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };

not worked again

Link to comment
Share on other sites

3 hours ago, godmode8 said:

yes! 
or cancel the animation "Medic"

I understand very bad scripts

not worked again

but thers no animation in this script.. Where is locate this script?

cuz if ure taking it from dayz_code.pbo   any changes do not suffer efect until you drop out this sqf from dayz_code and change the call.  Just like when you do a custom compiles.sqf, variables.sqf or fn_SelfActions.sqf

Link to comment
Share on other sites

9 hours ago, godmode8 said:

@DayZ_Epoch\addons\dayz_code\compile\

well as i say,, u need drop out the sqf from here..to mpmissions\instance\        and find wheres the call for this file and change the path. The call can be into compiles.sqf, fn_selfactions.sqf, variables.sqf  i dnt know... once you do it... then yes make the changes for this file

Spoiler

  if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                 if( !isNull (FindDisplay 106) ) then {
        
            (FindDisplay 106) closeDisplay 1;

           sleep 1;
            systemChat format["Inventory was closed to prevent any dupe"];//put your own text
        };
                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };

 

Link to comment
Share on other sites

well i found the call for this sqf @godmode8 .. is into compiles.sqf (but you will need make a custom compiles.sqf)

If you dont have a custom compiles.sqf  open your @Epoch\dayz_code\init\  copy and paste compiles.sqf to Mpmissions\your instance\   then open your init.sqf  find this line:

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

Change by:

call compile preprocessFileLineNumbers "compiles.sqf";

 

 

Once you have it.. open your custom compiles.sqf and find:

epoch_returnChange =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
 

change this line by:

epoch_returnChange =            compile preprocessFileLineNumbers "epoch_returnChange.sqf";

Now copy and paste "epoch_returnChange.sqf" to Mpmissions\yourinstance\

Then open "epoch_returnChange.sqf" and make the change to test:

Spoiler

if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                 if( !isNull (FindDisplay 106) ) then {
        
            (FindDisplay 106) closeDisplay 1;

           sleep 1;
            systemChat format["Inventory was closed to prevent any dupe"];//put your own text
        };

                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };


  

Link to comment
Share on other sites

2 hours ago, juandayz said:

well i found the call for this sqf @godmode8 .. is into compiles.sqf (but you will need make a custom compiles.sqf)

If you dont have a custom compiles.sqf  open your @Epoch\dayz_code\init\  copy and paste compiles.sqf to Mpmissions\your instance\   then open your init.sqf  find this line:

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

Change by:

call compile preprocessFileLineNumbers "compiles.sqf";

 

 

Once you have it.. open your custom compiles.sqf and find:

epoch_returnChange =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
 

change this line by:

epoch_returnChange =            compile preprocessFileLineNumbers "epoch_returnChange.sqf";

Now copy and paste "epoch_returnChange.sqf" to Mpmissions\yourinstance\

Then open "epoch_returnChange.sqf" and make the change to test:

  Hide contents

if (_briefcase_100oz > 0) then {
            for "_x" from 1 to _briefcase_100oz do {
                player addMagazine "ItemBriefcase100oz";
                 if( !isNull (FindDisplay 106) ) then {
        
            (FindDisplay 106) closeDisplay 1;

           sleep 1;
            systemChat format["Inventory was closed to prevent any dupe"];//put your own text
        };

                //diag_log format["DEBUG TRADER CHANG MADE: %1 x %2", _briefcase_100oz, "ItemBriefcase100oz"];
            };
        };


  


Friend, I know how to make a custom compiles the file and know how to make changes . This code is not running. If you doubt this , here are screenshots and videos .

Spoiler

 

c6S8mpI.png

 

lgBGMcR.png

 

 


 

 

Link to comment
Share on other sites

11 hours ago, godmode8 said:


Friend, I know how to make a custom compiles the file and know how to make changes . This code is not running. If you doubt this , here are screenshots and videos .

  Reveal hidden contents

 

c6S8mpI.png

 

lgBGMcR.png

 

 

 

 

 

 

no, no i dont hve doubts about you... i tell you this cuz when i ask you for the location of the script you tell me is in @DayZ_Epoch\addons\dayz_code\compile\  : )

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...