Jump to content

MattL

Recommended Posts

What this does:

 

It spawns a carepackage above the player that floats down around the player. It can be filled with whatever you want. By default the carepackage costs two brief cases to buy.

 

 

Using http://epochservers.com/viewtopic.php?f=14&t=13 add this to your extra_rc.hpp 

	class ItemBriefcase100oz {
		class carepackage {
			text = "Call carepackage";
			script = "execVM 'scripts\carepackage.sqf'";
		};
	};

change the filepath as necessary. 

 

Now find the hacker check in your server_functions.sqf and replace 

if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

with

if(vehicle _x != _x && (vehicle _x getVariable ["Mission",0] != 1) && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

save and repack. 

 

Download link - contains all three versions. for any of the map click versions you will need to make the extra_rc point to the clickpackage.sqf

You can change the _cost (how many briefs it requires), you can change the _distance until the box is deleted, you can change the _smoke color, you can change the items and weapon types also. You can change the way the box is arranged on the chute, but I wouldn't touch it as it can mess with the chute or make the box float above the ground. You can also change the height that the carepackage spawns at, on line 23 

_position = [_getPos select 0, _getPos select 1, 25];

change the 25 at the end. 

 

EDIT: You may have to whitelist a few things in the createvehicle.txt like 

!="USVehicleBox_EP1"
!="ParachuteMediumEast"
!="SmokeShellBlue"

I don't use BE personally so I can't really help any more than that.

 

and

 

If you are running infistar antihack remove:
onMapSingleClick '';
from AH.sqf

 

 

Enjoy.

 

To view a video of this system click HERE

 

If you like the script, please consider donating below.

 

 

Credits : Infistar, he helped majorly with weapon mag selection. 

Link to comment
Share on other sites

i already did something like this a while back ...

 

my version is called from a laptop, that is be placed in all airfield control towers on startup works for any map (required it has the default airfield control towers), also icluding planes/helis delivering the package, hint info about the plane/heli, random vehicle drops, whoever has a radio can get delayed plane/heli info, click on map for delivery and many more features.

 

i currently working on a version that will create everything serverside, so the player is not spawning in all this stuff, meaning it will be a lot easier to whitelist for antihacks

 

i might release the serverside version soon, but until then you could try this:

 

Link to comment
Share on other sites

I'll be attempting a way to make this less... spammable. 

 

hey matt or anyone for that matter is it possible or do you know  a way to make it where this package only gives the option to spawn on new players (players that join the server for the first time) if so could someone help me out with this

remove anything related to briefcases as the cost so make it look like 

// Carepackage script by Matt L
//Special thanks to Infinistar for helping with mag selection for the weapons

private ["_cost","_hasBriefs","_display","_distance","_boxtype","_unit","_getPos","_position","_box","_chute","_smoke","_var","_textt","_tools","_items","_walls","_supplies","_weapon","_weapon2","_weapon3","_weapon4","_weapon5","_weapon6","_giveWep","_possibleMags","_mag","_whichBuild","_crateItems","_text"];

/**
_cost = 2;
_hasBriefs = {"ItemBriefCase100oz" == _x} count (magazines player);

if (_hasBriefs >= _cost) then {

for "_i" from 0 to _cost - 1 do {
player removeMagazine "ItemBriefcase100oz";
};

**/
disableSerialization;
_display = findDisplay 24;
(_display) closeDisplay 0;

_distance = 500;
_boxtype = "USVehicleBox_EP1";
_unit = player;
_getPos = getPos _unit;
_position = [_getPos select 0, _getPos select 1, 25];
_box = _boxtype createVehicle _position;
_box setVariable ["Mission",1,true];
_box setVariable ["permaLoot",1,true];
_box setVariable ["ObjectID",""];
_chute = createVehicle ["ParachuteMediumEast", getPos _box, [], 0, "FLY"];
_box attachTo [_chute, [0,0,3]];
_smoke = "SmokeShellBlue" createVehicle (getPos _box);
_smoke attachTo [_box, [0,0,0]];
_var = floor((random 2) + 1);

//display text to alert user
_textt = format ["\nCarepackage is above you!",10];
titleText [_textt,"PLAIN DOWN"];

//define items

_tools = ["ItemEtool","ItemKnife","ItemGPS","ItemFishingPole","ItemHatchet_DZE","ItemMatchbox_DZE","ItemCrowbar"];
_items = ["ItemSodaPepsi","FoodCanCorn","FoodNutmix","ItemSodaClays","FoodCanSardines","ItemKiloHemp"];
_walls = ["ItemWoodWallGarageDoor","ItemWoodWallWithDoorLg","ItemWoodWallLg","ItemWoodWallGarageDoor","ItemWoodFloor","metal_floor_kit Z","CinderWallDoorSmall_DZ"];
_supplies = ["CinderBlocks","MortarBucket","ItemTankTrap","PartWoodPlywood","PartWoodLumber","ItemPole","PartGlass"];

//weapon lists
_weapon = "DMR";
_weapon2 = "AK_47_M";
_weapon3 = "BAF_L85A2_RIS_Holo";
_weapon4 = "RPK_74";
_weapon5 = "M14_EP1";
_weapon6 = "M249_DZ";
_giveWep = [_weapon,_weapon2,_weapon3,_weapon4,_weapon5,_weapon6] call BIS_fnc_selectRandom;
_possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
_mag = _possibleMags select 0;

//select arrays to use
_crateItems = [_walls,_supplies,_items] call BIS_fnc_selectRandom;
uisleep 1;

clearweaponcargoglobal _box;
clearmagazinecargoglobal _box;

uisleep 1;

{_box addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
{_box addWeaponCargoGlobal [_x, 1];} forEach _tools;
_box addMagazineCargoGlobal [_mag, _var];
_box addWeaponCargoGlobal [_giveWep, 1];

uisleep 1;

waitUntil {(player distance _box) > _distance};
deleteVehicle _box;
deleteVehicle _chute;

/**
} else {
_text = format ["\nYou need two full briefs to call a carepackage!",10];
titleText [_text,"PLAIN DOWN"];
};
**/

Then in your init.sqf call it like 

pack = compile preprocessFileLineNumbers "scripts\carepackage.sqf";
waitUntil {!isNil ("PVDZE_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn pack;
};

at the bottom

Link to comment
Share on other sites

Here is a version with a use timer. I havn't tested it yet but as soon as I am able, I will. If you try it, and it works, let me know. Thanks.  FILE

tested and working fine. Updating OP download link

 

 

EDIT: link updated

Link to comment
Share on other sites

Hey MattL, so that I don't have to mess around with the server_functions file, I just replace:

 

_box setVariable ["Mission",1,true];

 

with:

 

_box setVariable ["permaLoot",true];

 

Not sure if you want to use this to save your script users a little time. 

 

I use this on all my custom missions and have never had a box or vehicle get cleaned up by the server :)

Link to comment
Share on other sites

Hey MattL, so that I don't have to mess around with the server_functions file, I just replace:

 

_box setVariable ["Mission",1,true];

 

with:

 

_box setVariable ["permaLoot",true];

 

Not sure if you want to use this to save your script users a little time. 

 

I use this on all my custom missions and have never had a box or vehicle get cleaned up by the server :)

both variable are included just to avoid any...unlucky happenings. I've had issues with permaLoot before so I don't fully trust it :)

Link to comment
Share on other sites

both variable are included just to avoid any...unlucky happenings. I've had issues with permaLoot before so I don't fully trust it :)

 

That's wise. 

 

Just out of curiosity, why do you put the ,1, in the variable? Just in case i'm missing a trick ;)

Link to comment
Share on other sites

That's wise. 

 

Just out of curiosity, why do you put the ,1, in the variable? Just in case i'm missing a trick ;)

figured this out. in server_functions.sqf look at  

(vehicle _x getVariable ["Mission",0] != 1)

so the 1 is there so it won't get deleted 

Link to comment
Share on other sites

tested it right now, but its a bit bugged for me

 

 

it show the items in there but I cant get anything out there or place something in it

also cargo check sayys that there is nothing in it

I also have this issue

Link to comment
Share on other sites

Maybe because I'm a giant douche and enjoy watching people suffer. Would it be possible add to this script so that you have the option to call for a care package for 2 briefs for yourself or call for a booby trapped care package for 3 briefs for someone else lol? I have a HEAVY PVP based server that keeps me thinking of new creative ways to kill people.

 

Thoughts? 

Link to comment
Share on other sites

Great script bro. My question is, in the define items, do those items spawn in with random quantity when you call the carepackage?

you can add random quantities easy, though _crateItems and _mag already have a random quantity. 

tested it right now, but its a bit bugged for me

 

 

it show the items in there but I cant get anything out there or place something in it

also cargo check sayys that there is nothing in it

I had this issue only on 112555 and could only replicate it on that beta patch. 

 

I also have this issue

see above

 

Maybe because I'm a giant douche and enjoy watching people suffer. Would it be possible add to this script so that you have the option to call for a care package for 2 briefs for yourself or call for a booby trapped care package for 3 briefs for someone else lol? I have a HEAVY PVP based server that keeps me thinking of new creative ways to kill people.

 

Thoughts? 

That'd be extremely hard as you would have to populate a list of players and have it show on some sort of menu...The carepackage part, or at least the booby trap part of it, would not be hard at all but the menu would be where I wouldn't be able to help. I could probably add a random chance to spawn a grenade or other large explosive shell when the player who called it comes near it

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...