Jump to content
Sign in to follow this  
Phantom Six

Enable/Disable Ammobox Param Help

Recommended Posts

Does anyone know how to make a param where you can choose to enable or disable a certain ammobox? For example, if an ammobox is set to Enable in MP Params, it will appear in the mission, if Disable, it will not appear in the mission

Share this post


Link to post
Share on other sites

bump. Does anyone know how to do this? I still need some help with this.

Share this post


Link to post
Share on other sites

In description.ext :

class d_mybigammobox {
	title = "Extra Ammo:";
	values[] = {0,1};
	default = 0;
	texts[] = {"No","Yes"};
};

mybigammobox.sqf :

if (!isServer) exitWith{};

waitUntil {time > 1};

if (d_mybigammobox == 0) exitWith{};

if (d_mybigammobox == 1) then {
     _myammobox1 = createVehicle ["USBasicWeaponsBox",getMarkerPos "myammomarker1", [], 0, "NONE"];
     };

in init.sqf :

[] execVM "mybigammobox.sqf";

then just create a marker called "myammomarker1", where you would like the ammobox to spawn.

This is not tested, but I think that is right.

Edited by Riouken
Small syntax error

Share this post


Link to post
Share on other sites

nothing seemed to happen. Is there a code that do a deleteVehicle command on the ammobox instead? Like I already placed the ammobox with custom weapons in it. Instead be like if disabled deleteVehicle baf_ammobox or if enable, nothin happens and it will still be there?

Share this post


Link to post
Share on other sites

well, i gave the script u sent me a try, didn't work, I can choose Yes & No but it didn't make a difference, any suggestion?

Share this post


Link to post
Share on other sites

description.ext:

class BAFAmmobox 
{
	title = "BAF Ammobox:";
	values[] = {0,1};
	default = 1;
	texts[] = {"Disabled","Enabled"};
};

bafammobox.sqf

if (!isServer) exitWith{};

waitUntil {time > 1};

if (bafammobox == 0) then {
_baf_ammobox = deleteVehicle ["BAFVehicleBox_EP1",getMarkerPos "BAF", [], 0, "NONE"];
};

if (bafammobox == 1) exitWith{};

init.sqf

[] execVM "bafammobox.sqf";

ammobox's name: baf_ammobox

This is what I have and when I set the ammobox to disable or enable, nothing seem to happen

Edited by Phantom Six

Share this post


Link to post
Share on other sites

My new bafammobox.sqf, it is still not working. The ammobox will not spawn even if I set the parameters to turn it on, please help :(

if (!isServer) exitWith{};

waitUntil {time > 1};

if (bafammobox == 0) exitWith{};

if (bafammobox == 1) then {
_baf = createVehicle ["BAFVehicleBox_EP1",getMarkerPos "BAF", [], 0, "NONE"];
_null = _baf execVM "ammo-oabaf.sqf";
};

Share this post


Link to post
Share on other sites
"ammo-oabaf.sqf"

i think this will mess up your script.

use this instead:

"ammo_oabaf.sqf"

Share this post


Link to post
Share on other sites

I got that one off the BAF/PMC ammobox script. I changed the - to the _ but it made no difference. The ammobox won't spawn either way.

Share this post


Link to post
Share on other sites

ugh sorry guys, but I still need help with this. I'm also trying to do a workaround and spawning the ammoboxes off the map and if enabled they will be setPos to the point, getting script error off this one so far :( help please anyone?

Share this post


Link to post
Share on other sites

Try this,

description.ext

titleParam1 = "Extra Ammo ?";
valuesParam1[] = {1,0};
defValueParam1 = 0;
textsParam1[] = {"Yes", "No"};

Place the extra ammoboxes on the map where you want them, and in each of their init place,

if (Param1 == 0) then { deletevehicle this};

When you start the mission in mp, select the parameters options and select whether you want the extra ammo or not. Was tested with just myself on my little dedi server and seemed to work.

Hope this helps.

Share this post


Link to post
Share on other sites

ahhhh thanks blake, it works, but the old params messed up the new ones so it would always be night time when I start the mission. Reverse engineering sure do the trick. So this is what I got

description.ext

class BAFAmmobox
{
	title = "BAF Ammobox:";
	values[] = {0,1};
	texts[] = {"Disabled", "Enabled"};		
	default = 1;
};

on the ammobox init i put this...

if (paramsArray select 3 == 0) then {deletevehicle this};

that is my 4th arrray & it works :D thanks blake.

By the way, does anyone know how to do the AI skill or AI amount params?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×