-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experiment on disarming #1621
Open
nicolasbadano
wants to merge
1
commit into
KoffeinFlummi:master
Choose a base branch
from
nicolasbadano:disarmTest
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Experiment on disarming #1621
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* | ||
Author: CAA-Picard | ||
|
||
Description: | ||
Disarm the player | ||
|
||
Arguments: | ||
0: The local unit being disarmed | ||
1: The unit doing the disarming | ||
|
||
Return value: | ||
None | ||
*/ | ||
|
||
private ["_unit", "_guard", "_allGear", "_wh"]; | ||
|
||
_unit = _this select 0; | ||
_guard = _this select 1; | ||
|
||
_allGear = [ | ||
(headgear _unit), | ||
(goggles _unit), | ||
(uniform _unit), | ||
(uniformItems _unit), | ||
(vest _unit), | ||
(vestItems _unit), | ||
(backpack _unit), | ||
(backpackItems _unit), | ||
(primaryWeapon _unit), | ||
(primaryWeaponItems _unit), | ||
(primaryWeaponMagazine _unit), | ||
(secondaryWeapon _unit), | ||
(secondaryWeaponItems _unit), | ||
(secondaryWeaponMagazine _unit), | ||
(handgunWeapon _unit), | ||
(handgunItems _unit), | ||
(handgunMagazine _unit), | ||
(assignedItems _unit), | ||
(binocular _unit) | ||
]; | ||
|
||
// Make the unit drop it's backpack | ||
_unit addBackpack "Bag_Base"; | ||
removeBackpack _unit; | ||
|
||
// Remove the uniform items | ||
removeUniform _unit; | ||
_unit forceAddUniform (_allGear select 2); | ||
|
||
// Remove the vest and all it's content | ||
removeVest _unit; | ||
|
||
// Remove the rest of the stuff | ||
removeAllWeapons _unit; | ||
removeAllAssignedItems _unit; | ||
|
||
|
||
_wh = createVehicle ["WeaponHolderSimulated", [0,0,0], [], 0, "CAN_COLLIDE"]; | ||
|
||
// Store vest and vest items | ||
if (_allGear select 4 != "") then { | ||
_wh addItemCargoGlobal [_allGear select 4,1]; | ||
{ | ||
_wh addItemCargoGlobal [_x,1]; | ||
}forEach (_allGear select 5); | ||
}; | ||
|
||
// Store main weapon and accesories | ||
if (_allGear select 8 != "") then { | ||
_wh addItemCargoGlobal [_allGear select 8,1]; | ||
{ | ||
if (_x != "") then { | ||
_wh addItemCargoGlobal [_x,1]; | ||
}; | ||
}forEach (_allGear select 9); | ||
{ | ||
if (_x != "") then { | ||
_wh addItemCargoGlobal [_x,1]; | ||
}; | ||
}forEach (_allGear select 10); | ||
}; | ||
|
||
// Store secondary weapon and accesories | ||
if (_allGear select 11 != "") then { | ||
_wh addItemCargoGlobal [_allGear select 11,1]; | ||
{ | ||
if (_x != "") then { | ||
_wh addItemCargoGlobal [_x,1]; | ||
}; | ||
}forEach (_allGear select 12); | ||
{ | ||
if (_x != "") then { | ||
_wh addItemCargoGlobal [_x,1]; | ||
}; | ||
}forEach (_allGear select 13); | ||
}; | ||
|
||
// Store pistol and accesories | ||
if (_allGear select 14 != "") then { | ||
_wh addItemCargoGlobal [_allGear select 14,1]; | ||
{ | ||
if (_x != "") then { | ||
_wh addItemCargoGlobal [_x,1]; | ||
}; | ||
}forEach (_allGear select 15); | ||
{ | ||
if (_x != "") then { | ||
_wh addItemCargoGlobal [_x,1]; | ||
}; | ||
}forEach (_allGear select 16); | ||
}; | ||
|
||
// Store uniform items | ||
{ | ||
_wh addItemCargoGlobal [_x,1]; | ||
}forEach (_allGear select 3); | ||
|
||
// Store assigned items | ||
{ | ||
_wh addItemCargoGlobal [_x,1]; | ||
}forEach (_allGear select 17); | ||
|
||
_wh setPos getPos _unit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder: Move AGM_Respawn_fnc_getAllGear to Core.