Trying to get a "cancel" effect working on deploy bike script.

DangerRuss

OpenDayZ Rockstar!
That moment when you're trying to open the door, or get in a vehicle, and you accidentally click deploy bike... and you're stuck... then you have to repack the damn bike and all you wanted to do was get in the car because you're being shot at.... Anyone running the deploy bike script probably knows these feels..... So Im looking for something that would work similar to Krixe's self blood bag, if you move it cancels the build....
I found this
http://epochmod.com/forum/index.php?/topic/3339-deployable-bike-scrollwheel-issue/?p=21051

The option is on the scroll wheel, clicking it does nothing.

Any help would be much appreciated.
 
Code:
} else {
        // this is for handling if interrupted
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
bump.. someones gotta have something like this out there....
This is the deploy bike script Im using and Im confused because it has
Code:
if (false) then {
    cutText [format["You are in combat and cannot build a bike."], "PLAIN DOWN"];
} else {
    player removeAction s_player_deploybike;
    closeDialog 602;
    player removeWeapon "ItemToolbox";
    player playActionNow "Medic";
    r_interrupt = false;
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
    sleep 6;
 
    _object = "Old_bike_TK_INS_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
 
    player reveal _object;
 
    cutText [format["You've used your toolbox to build a bike! How magical!"], "PLAIN DOWN"];
 
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
 
    sleep 10;
 
    cutText [format["Warning: Spawned bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
 
};
//bike deploy script by Player2 - OpenDayz Release Coming Soon!

Code:
r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";

Which looks almost exactly like how Krixe's self blood bag cancels when you move.. the only difference is.. Krixes looks like this
Code:
} else {
        // this is for handling if interrupted
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
 
Last edited:
Something like this?
Code:
if (dayz_combat == 1) then {
    cutText [format["You can not do this while in combat!"], "PLAIN DOWN"];
} else {
    player removeAction s_player_deploybike;
    player removeWeapon "ItemToolbox";
    player removeMagazine "PartGeneric";
 
    player playActionNow "Medic";
    [player,"repair",0,false,10] call dayz_zombieSpeak;
    [player,10,true,(getPosATL player)] spawn player_alertZombies;

    r_interrupt = false;
    r_doLoop = true;

    _finished = false;
    _finishedTime = diag_tickTime+3;

    while {r_doLoop} do {
        if (diag_tickTime >= _finishedTime) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };

    if (_finished) then {
        _posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
        _dirplr = getDir player;

        _object = "MMT_Civ" createVehicle (_posplr);
        _object setVariable ["ObjectID", "1", true];
        _object setVariable ["ObjectUID", "1", true];
        _object setVariable ["Sarge",1,true];

        player reveal _object;

        cutText [format["You have used your toolbox and scrap metal to build a a bike"], "PLAIN DOWN"];
        sleep 10;
        cutText [format["WARNING: Deployed vehicles do not save after restart!"], "PLAIN DOWN"];
    } else {
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
        player addWeapon "ItemToolbox";
        player addMagazine "PartGeneric";
        cutText ["\n\n Building cancelled", "PLAIN DOWN"];
    };
};
 
Something like this?
Code:
if (dayz_combat == 1) then {
    cutText [format["You can not do this while in combat!"], "PLAIN DOWN"];
} else {
    player removeAction s_player_deploybike;
    player removeWeapon "ItemToolbox";
    player removeMagazine "PartGeneric";
 
    player playActionNow "Medic";
    [player,"repair",0,false,10] call dayz_zombieSpeak;
    [player,10,true,(getPosATL player)] spawn player_alertZombies;
 
    r_interrupt = false;
    r_doLoop = true;
 
    _finished = false;
    _finishedTime = diag_tickTime+3;
 
    while {r_doLoop} do {
        if (diag_tickTime >= _finishedTime) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
 
    if (_finished) then {
        _posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
        _dirplr = getDir player;
 
        _object = "MMT_Civ" createVehicle (_posplr);
        _object setVariable ["ObjectID", "1", true];
        _object setVariable ["ObjectUID", "1", true];
        _object setVariable ["Sarge",1,true];
 
        player reveal _object;
 
        cutText [format["You have used your toolbox and scrap metal to build a a bike"], "PLAIN DOWN"];
        sleep 10;
        cutText [format["WARNING: Deployed vehicles do not save after restart!"], "PLAIN DOWN"];
    } else {
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
        player addWeapon "ItemToolbox";
        player addMagazine "PartGeneric";
        cutText ["\n\n Building cancelled", "PLAIN DOWN"];
    };
};
I think I tried that one, and the option was on my scroll wheel, but no bike spawned. I did chop it up a little bit because I don't want players to need scrap metal, just a toolbox... so I deleted the lines about the scrap metal being required and changed the classname of the bike.. didn't work for some reason.
 
I got it working fine. I'm using right click on tool box to deploy, one scrap metal to build and I'm spawning bikes from server side but you should get the cancel idea from this.
Code:
closeDialog 0;

if ("PartGeneric" in magazines player) then {
    player playActionNow "Medic";
    player removeMagazine "PartGeneric";
   
    [player,"repair",0,false,10] call dayz_zombieSpeak;
    [player,10,true,(getPosATL player)] spawn player_alertZombies;
   
    r_interrupt = false;
    r_doLoop = true;
    _finished = false;
    _finishedTime = diag_tickTime +8;
   
    while { r_doLoop } do {
        if (diag_tickTime >= _finishedTime) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
   
    if (_finished) then {
        _object = "MMT_Civ";
        _dir = getdir (vehicle player);
        _pos = getPos (vehicle player);
        _pos = [(_pos select 0)+4*sin(_dir),(_pos select 1)+4*cos(_dir),0];
        PVDZ_OBJ_DEPLOY = [_pos,player,_object];
        publicVariableServer "PVDZ_OBJ_DEPLOY";
   
        if (floor (random 50) < 2) then {
            r_player_infected = true;
            player setVariable["USEC_infected",true,true];
            [0.6,1] call fnc_usec_pitchWhine;
            addCamShake [55, 0.6, 111];
            cutText ["You used your scrap metal to build a bike! It looks like you cut yourself in the process.. You feel the infection setting in..","PLAIN DOWN"];
        } else { cutText ["You used your scrap metal to build a bike!", "PLAIN DOWN"];
        };
       
        sleep 10;
        cutText ["WARNING: "+name player+"! Deployed vehicles do Not Save after server restart!", "PLAIN DOWN"];
        systemChat ("WARNING: "+name player+"! Deployed vehicles do Not save after server restart!");
    } else {
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
    player addMagazine "PartGeneric";
    cutText ["Deploying cancelled!", "PLAIN DOWN"];
    };
} else {
_txt = "You need: 1x(Scrap Metal) to build this.";
cutText [_txt, "PLAIN DOWN"];
systemChat (_txt);
};
 
This is where Im confused.. Im out of my league here so feel free to correct me but
Code:
 } else {
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
    player addMagazine "PartGeneric";
    cutText ["Deploying cancelled!", "PLAIN DOWN"];
    };

looks remarkably similar to this
Code:
} else {
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
which I tried and the deploy bike option is on the scroll wheel but no bike spawns when you press it.
 
Here
Code:
if (false) then {
    cutText [format["You are in combat and cannot build a bike."], "PLAIN DOWN"];
} else {
    player removeAction s_player_deploybike;
    closeDialog 602;
    player removeWeapon "ItemToolbox";
    player playActionNow "Medic";
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
  
    r_interrupt = false;
    r_doLoop = true;
    _finished = false;
    _finishedTime = diag_tickTime +8;
  
    while { r_doLoop } do {
        if (diag_tickTime >= _finishedTime) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
if (_finished) then {
    _object = "Old_bike_TK_INS_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
    player reveal _object;
    cutText [format["You've used your toolbox to build a bike! How magical!"], "PLAIN DOWN"];
    sleep 10;
    cutText [format["Warning: Spawned bikes DO NOT SAVE after server restart!"], "PLAIN DOWN"];
} else {
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
    player addWeapon "ItemToolbox";
    cutText ["Building cancelled!", "PLAIN DOWN"];
    };
};
 
can I just cut the
Code:
} else {
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
    player addWeapon "ItemToolbox";
    cutText ["Building cancelled!", "PLAIN DOWN"];
and add edit my existing file with it? Or do I need to use this file? I'd like to keep the deploy bike on the scroll wheel so that people can see it. I know you said you added a button, so I wasn't sure if this code was specifically for that or not. Anyways I'll give it a try
 
it was very annoying when you're in a rush, trying to get into a car or something , and you misclick.. and now you're stuck building your bike while you're being eaten/shot
 
Back
Top