Ammo Press Help

Player on my server can "make" ammo with the use of scrap, But... no scrap spawns in the server at all.. they have to use a tier crafting system to craft components up into scrap eventually, and like Matt L mentioned you can incorporate a fail percentage or interuption, maybe even have the ammo blow up in your face as a lack of skills to "Press the Ammo" *evil grin*;)

You have to watch as players don't discard "anthing" they find, tin cans, toilet paper, trash is gold lol...

How did you set that up.... that would be awesome on my server
 
Eumz,
Could it be me,
or is it also possible to make mags WITHOUT the scrap metal?

or did i screw something up? :p
(didn't alter anything in the ammopress files so far, only did some random testing and came to the conclusion that you're able to make mags without the scrap)
 
Eumz,
Could it be me,
or is it also possible to make mags WITHOUT the scrap metal?

or did i screw something up? :p
(didn't alter anything in the ammopress files so far, only did some random testing and came to the conclusion that you're able to make mags without the scrap)
I need to rework that fn_selfaction script. Try using this instead:
Code:
// AMMO PRESS ON 
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressfn < 0) then {
            s_player_pressfn = player addAction ["Activate Ammo Press (FAL Mags)","scripts\fnmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressfn;
        s_player_pressfn = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressstn < 0) then {
            s_player_pressstn = player addAction ["Activate Ammo Press (STNAG Mags)","scripts\stnagmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressstn;
        s_player_pressstn = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressAKM < 0) then {
            s_player_pressAKM = player addAction ["Activate Ammo Press (AKM Mags)","scripts\AKMMag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressAKM;
        s_player_pressAKM = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressAK < 0) then {
            s_player_pressAK = player addAction ["Activate Ammo Press (AK Mags)","scripts\AKMag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressAK;
        s_player_pressAK = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressDMR < 0) then {
            s_player_pressDMR = player addAction ["Activate Ammo Press (DMR Mags)","scripts\DMRmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressDMR;
        s_player_pressDMR = -1;
    };    
// AMMO PRESS OFF
Press turns on at the top of the stack.
 
Was able to compare it...
been a bad boy...
i've messed with your code :eek:

following should have the production on the red door AND work correctly..i hope

Code:
// ---------------------------------------AMMO PRESS ON----------------------------------
private["_playerPosX","_playerPosY","_playerPosZ","_canPress"];
 
_playerPosX = getPosASL player select 0;
_playerPosY = getPosASL player select 1;
_playerPosZ = getPosASL player select 2;
_canPress = _playerPosX > 10410 and _playerPosX < 10412 and _playerPosY > 2596 and _playerPosY < 2598 and _playerPosZ > 29 and _playerPosZ < 30 && ("PartGeneric" in magazines player);
 
if ( _canPress ) then {
            if (s_player_pressstn < 0) then {
            s_player_pressstn = player addAction ["Activate Ammo Press (STNAG Mags)","scripts\ammopress\stnagmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressstn;
        s_player_pressstn = -1;
    };
 
if ( _canPress ) then {
            if (s_player_pressfn < 0) then {
            s_player_pressfn = player addAction ["Activate Ammo Press (FAL Mags)","scripts\ammopress\fnmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressfn;
        s_player_pressfn = -1;
    };
 
if ( _canPress ) then {
            if (s_player_pressAKM < 0) then {
            s_player_pressAKM = player addAction ["Activate Ammo Press (AKM Mags)","scripts\ammopress\AKMMag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressAKM;
        s_player_pressAKM = -1;
    };
 
if ( _canPress ) then { 
            if (s_player_pressAK < 0) then {
            s_player_pressAK = player addAction ["Activate Ammo Press (AK Mags)","scripts\ammopress\AKMag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressAK;
        s_player_pressAK = -1;
    };
 
if ( _canPress ) then {
            if (s_player_pressDMR < 0) then {
            s_player_pressDMR = player addAction ["Activate Ammo Press (DMR Mags)","scripts\ammopress\DMRmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressDMR;
        s_player_pressDMR = -1;
    };
// ---------------------------------------AMMO PRESS OFF---------------------------------

i've just added the following after _canPress = && ("PartGeneric" in magazines player)
Code:
_canPress = _playerPosX > 10410 and _playerPosX < 10412 and _playerPosY > 2596 and _playerPosY < 2598 and _playerPosZ > 29 and _playerPosZ < 30 && ("PartGeneric" in magazines player);

So basicly.. you don't get the menu unless you have a scrap metal in your inventory.
 
Very nice, Inattentive. Thanks for the help, I have my hands full trying to upgrade my mod sized mission file to 1.8. So who knows when I would have had time for this. I'll update the release and everything with your changes.
 
Was thanks to you xp, without your original code i've never could adjusted it ^^.
I'm running an overwatch server atm, i was thinking to adjust the magtypes towards overwatch, if thats okay, i will upload it.

I realy like this addon xp!
 
True, but clark17 was responsible for the proper door placement, not me. This is why I enjoy these forums. Anyway, please feel free to modify whatever you need for Overwatch. Post it here if you like so I can update everything. And thanks again.
 
I may have missed something, but I added everything in for Taviana. I go to the smokestacks there and get no option to activate the press. Any help would be greatly appreciated.

I did mod the fn_selfactions to include more types of ammo by copying the previous lines and changing the ammo type. I created the new sqfs for the ammo types as well.
 
Hi, sorry I missed your message. I don't run Tavi, but if you paste the modified code you're using, I can take a look and see what's going wrong. If you're trying to add ammo types, make sure you have modified the player self action, not just the ammo type. For example: the action to press STANAG magazines is s_player_pressstn. So if you have two actions assigned to s_player_pressstn, because you copy pasted, neither will show up. Hope that makes sense.
 
Code:
if ( _canPress ) then {
            if (s_player_pressSCAR < 0) then {
            s_player_pressSCAR = player addAction ["Activate Ammo Press (SCAR Mags)","scripts\ammopress\scar.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressSCAR;
        s_player_pressSCAR = -1;
    };
   
if ( _canPress ) then {
            if (s_player_press417 < 0) then {
            s_player_pressSCAR = player addAction ["Activate Ammo Press (417 Mags)","scripts\ammopress\417mag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_press417;
        s_player_press417 = -1;
    };
// ---------------------------------------AMMO PRESS OFF---------------------------------
That is what I added in at the bottom of what you had added. I created the .sqf for the new ammo as well.
 
I think I see what the problem is. Your code is fine, but the recent fix added to make the scrap load at a particular part of the stack will only work in Chernarus. It looks for the player's position on the map, and since the factory is in a different place in Tavi, the script is looking in the wrong spot. You'll need to find the stack's location on your map, or use this earlier version of the script. Sorry for the trouble.

Code:
// AMMO PRESS ON
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressfn < 0) then {
            s_player_pressfn = player addAction ["Activate Ammo Press (FAL Mags)","scripts\fnmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressfn;
        s_player_pressfn = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressstn < 0) then {
            s_player_pressstn = player addAction ["Activate Ammo Press (STNAG Mags)","scripts\stnagmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressstn;
        s_player_pressstn = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressAKM < 0) then {
            s_player_pressAKM = player addAction ["Activate Ammo Press (AKM Mags)","scripts\AKMMag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressAKM;
        s_player_pressAKM = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressAK < 0) then {
            s_player_pressAK = player addAction ["Activate Ammo Press (AK Mags)","scripts\AKMag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressAK;
        s_player_pressAK = -1;
    };
    if (cursorTarget isKindOf "Land_Ind_Stack_Big" && ("PartGeneric" in magazines player) and (player distance cursorTarget < 8) and _canDo) then {
            if (s_player_pressDMR < 0) then {
            s_player_pressDMR = player addAction ["Activate Ammo Press (DMR Mags)","scripts\DMRmag.sqf",cursorTarget, 5, false, true, "",""];
        };
    } else {
        player removeAction s_player_pressDMR;
        s_player_pressDMR = -1;
    }; 
// AMMO PRESS OFF
 
Sweet, I'll look into it. I just swapped to Epoch with Tavi so I am working on getting all my scripts running again. As soon as I get a chance I will test it and let you know the results.
 
I have tried to install this script. I have done the install to the tee. But does not work . the questions is will it work on dayz eopoch.
 
I have tried to install this script. I have done the install to the tee. But does not work . the questions is will it work on dayz eopoch.
I don't know if it will work with Epoch, I never tested that. Try the code I posted above instead, the one posted with the release is just for vanilla chernarus servers.
 
It works on my Epoch server.

Smokey,
Is there a way to make this work on vending machines? I've tried fiddling with the script but truthfully I don't know much about scripting so I'm not having any luck.
My issue is just trying to get the option when I step up to a vending machine.
 
It works on my Epoch server.

Smokey,
Is there a way to make this work on vending machines? I've tried fiddling with the script but truthfully I don't know much about scripting so I'm not having any luck.
My issue is just trying to get the option when I step up to a vending machine.

I'm so sorry I missed this post all those many years ago. Yes, I do have a working vending machine script. It's yours if you're still around and want it. Sorry for bumping this dead thread otherwise.
 
Back
Top