diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
| commit | 68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch) | |
| tree | 6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Client/Functions/Client_RespawnBag.sqf | |
| download | a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2 a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip | |
init
Diffstat (limited to '')
| -rw-r--r-- | Client/Functions/Client_RespawnBag.sqf | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Client/Functions/Client_RespawnBag.sqf b/Client/Functions/Client_RespawnBag.sqf new file mode 100644 index 0000000..dd20527 --- /dev/null +++ b/Client/Functions/Client_RespawnBag.sqf @@ -0,0 +1,33 @@ +private ["_add"];
+
+if !(isNil 'respawnBag') then {
+ _add = false;
+ /* Player did purchase a backpack and have one by default */
+ if !(isNull (unitBackPack player)) then {
+ /* If the backpack type is different from the current one, then we remove it */
+ if (typeOf (unitBackPack player) != respawnBag) then {
+ removeBackpack player;
+ _add = true;
+ };
+ } else {
+ _add = true;
+ };
+
+ /* We give a new backpack to the player */
+ if (_add) then {player addBackpack respawnBag};
+
+ /* We clear the new backpack content */
+ clearMagazineCargo (unitBackpack player);
+
+ /* We add the player's backpack content inside the new one */
+ if (count (respawnBagContent select 0) > 0) then {
+ for '_u' from 0 to count(respawnBagContent select 0)-1 do {
+ (unitBackpack player) addMagazineCargo [(respawnBagContent select 0) select _u, (respawnBagContent select 1) select _u];
+ };
+ };
+} else {
+ /* Player did not purchase a backpack but have one by default */
+ if !(isNull (unitBackPack player)) then {
+ removeBackpack player;
+ };
+};
\ No newline at end of file |
