Jump to content
tobias-ripper

on loadout selection, save loadout, set saved loadout on respawn.

Recommended Posts

hello everyone, 1st post here. been looking for a way to have players respawn with the last loadout they had selected, and have it be fresh. im just getting my feet wet with making scenarios. i tried to search for it but by god the forum is overcrowded with posts and tbh, i don't want to feel that discouraged on day one. so, basically the idea would be to save a loadout when selected in arsenal, and apply that saved loadout on respawn. is there a "onLoadoutSelection.sqf" kind of thing i can use? i already have tried the onplayerkilled / onrespawn .sqf and the usual code that goes with it, but its not what i actually want. unless there is more code i can add to those, that would make it work as i intent.

well yes, im pretty much asking for a handout but its not just me being lazy, im trully lost in all the options and info available. im sorry if this was asked a million times before 😞

Share this post


Link to post
Share on other sites

In initPlayerLocal.sqf.

 

[missionnamespace,"arsenalClosed", {
	[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;
	titletext ["Arsenal loadout saved.", "PLAIN DOWN"];
}] call bis_fnc_addScriptedEventhandler;

[missionnamespace,"arsenalOpened", {
	cuttext [format ["Welcome %1, your role is: %2.",profileNameSteam ,getText(configFile >> "CfgVehicles" >> (typeOf player) >> "displayName")],"PLAIN", 3];
}] call bis_fnc_addScriptedEventhandler;

In the onPlayerRespawn.sqf file.

 

[player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory;

This will save the loadout when closing the arsenal and reload it when they respawn. This is very simple.

  • Like 2

Share this post


Link to post
Share on other sites

thank so much! both of you!

@Gunter Severloh hey man. been watching your videos. it's been very helpful. i keep em at hand for some of the stuff i tend to forget. thank you very much.

@jakeplissken thats amazing. i'll be using  that one thank you so much!

one would think the editor would come with most of this stuff baked in. shoulnd't be surprised.
i've made some mods and maps for battlefield 2 back in the day but this is a whole new level for me. its like moving from windows to linux hahahahaha-
 

  • Thanks 1

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

×