Jump to content

Wraith_last

Member
  • Content Count

    7
  • Joined

  • Last visited

  • Medals

Everything posted by Wraith_last

  1. Hello, I have the following script from an old post and it works about 50%. It is for saving loadout and position when logging. The Problem is it saves pos data but the loadouts are reset every time I log back in. Meaning I could log out in an area where enemies spawn with high powered rifles and I am running around with the starter pistol. He she is: TAG_fnc_loadClientData = { _this params ["_loadout", "_positionASL", "_dir"]; player setUnitLoadout _loadout; player setDir _dir; player setPosASL _positionASL; }; if(isServer) then { addMissionEventHandler [ "HandleDisconnect", { params ["_body", "_id", "_uid", "_name"]; if(!isNull _body) then { //Init storage var if(isNil "TAG_disconnectedLoadouts") then { TAG_disconnectedLoadouts = []; }; //Get data private _loadout = getUnitLoadout _body; private _position = getPos _body; private _direction = getDir _body; //Find in storage private _uidIndex = TAG_disconnectedLoadouts find _uid; if(_uidIndex > -1) then { //Found -> update private _loadoutIndex = _uidIndex + 1; TAG_disconnectedLoadouts set [_loadoutIndex, [_loadout, _position, _direction]]; } else { //Not found -> Add new TAG_disconnectedLoadouts pushBack _uid; TAG_disconnectedLoadouts pushBack [_loadout, _position, _direction]; }; }; false } ]; addMissionEventHandler [ "PlayerConnected", { params ["_id", "_uid", "_name", "_jip", "_owner"]; if(_jip) then { private _clientData = missionNamespace getVariable ["TAG_disconnectedLoadouts", []]; private _uidIndex = _clientData find _uid; if(_uidIndex > -1) then { private _loadoutIndex = _uidIndex + 1; (_clientData select _loadoutIndex) remoteExec ["TAG_fnc_loadClientData", _owner]; }; }; } ]; }; Any help would be gladly recived.
  2. Wraith_last

    Help with a Loadout script I have

    Never mind I solved it. Thanks anyway if you had a look.
  3. Wraith_last

    Respawning loot

    Awesome, you guys are the best! One last question (that I can think of), is it possible to add a player specific Arsenal/Storage box? For example a box assigned to a slot or a box simular to the save player inventory script on logout that will act like a personal locker for the individual players to store extra equipment in? This one is way out of my skills to even attempt TBH but it would add a nice finishing touch to the player base.
  4. So I pulled this script and am building a little persistant map for me and some friends to play on and have got stuck with the loot spawning. (Its a warhammer 40k mod pack in case that makes a difference.) Here is what I got so far... gun = ["arifle_MX_F", "arifle_MX_GL_F", "arifle_MXC_F", "arifle_TRG20_F", "arifle_TRG21_F", "arifle_TRG21_GL_F", "arifle_MXM_F", "srifle_EBR_F", "LMG_Mk200_F", "hgun_P07_F", "arifle_Khaybar_F", "arifle_Khaybar_C_F", "arifle_Khaybar_GL_F", "hgun_rook40_F"] call BIS_fnc_selectRandom; Waffe1 = "groundweaponholder" createVehicle getpos this; Waffe1 addWeaponCargo [gun,1]; Waffe1 setPos [getPos this select 0,getPos this select 1,0.00]; (I know none of those are from a 40k mod pack but it is the code I used to test and it works) I put that into something like an invisible helipad and I spawn a random weapon from the list. My problem begins when I try to get the script to repeat after say an hour. I have tried, unsuccessfully, to pack it in an execVM only to have it slap me with errors. What I really want is loot boxes that spawn and despawn when the player is 500m away every 60 minutes. But baby steps as I am new to scripting. Can anyone help?
  5. Wraith_last

    Respawning loot

    Interesting.. will give it a go, though I gotta admit I have no idea what the new commands do or how they influence the way gear spawns. Would you explain the [_magazine, [0,3] select (round (random 1) isEqualTo 1)]; part to me? Why is there no whole number after _magazine? Spawn percentage chance? The other two I have no idea.
  6. Wraith_last

    Respawning loot

    Thanks! I ended up using this in a .sqf params["_box"]; while {true} do { clearMagazineCargo _box; _Magazine = ["TIOW_OCC_CarbineMag_40rnd","TIOW_OCC_CarbineMag_40rnd_Tracer","M36KantRifle_mag","TIOW_LongLas_Mag"] call BIS_fnc_selectRandom; _box addMagazineCargo [_Magazine, 3]; sleep 5400; }; With the variations for medical, weapons ect. How would I add an empty slot? as if there is a chance nothing would spawn in the box. "", For example? I figured I could further randomise the loot by making the compo spawn in and have only a 40% chance that the boxes would be there. That way every time I restart the server the boxes would be organised as if in different buildings and as many of the buildings are the same, I could copy and paste the compo to save time. So the next set will be working out how to save the designated equipment boxes between server restarts. I found a code for player inventory between logings (not tried it yet.) I have timed respawning enemies now too for the enemy bases, timed to about twenty five mins to allow for looting but not so fast they will respawn while the players are still there.
  7. Wraith_last

    Respawning loot

    When a player is 500m away, the box is empty/not there. when they are within 500m loot spawns in a box/the box spawns in. Each time it respawns there is a different loot list in said box. I know how to make a loot list, and that I can use addItemCargo to achive at least part of this, though I am not sure how yet. I am still learning and need all the help I can get, but a point in the right direction would be enough. I also wanna save the players inventory on logout using saveNameSpace but have not figured out what you actually do with it yet.
×