Jump to content

Search the Community

Showing results for tags 'auto repack'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Arma Reforger
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • Exilemod (Unofficial)'s Problems & Bugs
  • Exilemod (Unofficial)'s Exilemod Tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Green Sea
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • TKO's Cam Lao Nam
  • MSOF A3 Wasteland's Server Game Play Features
  • MSOF A3 Wasteland's Problems & Bugs
  • MSOF A3 Wasteland's Maps in Rotation
  • SOS GAMING's Server
  • SOS GAMING's News on Server
  • SOS GAMING's Regeln / Rules
  • SOS GAMING's Ghost-Town-Team
  • SOS GAMING's Steuerung / Keys
  • SOS GAMING's Div. Infos
  • SOS GAMING's Small Talk
  • NAMC's Topics
  • NTC's New Members
  • NTC's Enlisted Members
  • The STATE's Topics
  • CREATEANDGENERATION's Intoduction
  • CREATEANDGENERATION's HAVEN EMPIRE (NEW CREATORS COMMUNITY)
  • HavenEmpire Gaming community's HavenEmpire Gaming community
  • Polska_Rodzina's Polska_Rodzina-ARGO
  • Carrier command tips and tricks's Tips and tricks
  • Carrier command tips and tricks's Talk about carrier command
  • ItzChaos's Community's Socials
  • Photography club of Arma 3's Epic photos
  • Photography club of Arma 3's Team pics
  • Photography club of Arma 3's Vehicle pics
  • Photography club of Arma 3's Other
  • Spartan Gamers DayZ's Baneados del Servidor
  • Warriors Waging War's Vigor
  • Tales of the Republic's Republic News
  • Operazioni Arma Italia's CHI SIAMO
  • [GER] HUSKY-GAMING.CC / Roleplay at its best!'s Starte deine Reise noch heute!
  • empire brotherhood occult +2349082603448's empire money +2349082603448
  • NET88's Twitter

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 1 result

  1. REPACK and AUTO REPACK scripts Hi all, Here are two scripts (addon is scheduled) for those you want to repack their magazines. First one is a simple auto-repack. No action needed. Based on a simple EH, the code runs when the player fires, so the auto-repack needs has a "one round latency" to work. Not a real problem. Second one is more "realistic". Player must open the inventory and double click on each kind of mags to be repacked. Parameters: NONE AUTO-REPACK to be placed in initPlayerLocal.sqf or in init.sqf when player is defined. player addEventHandler ["fired",{ if (player == _this select 0 && vehicle player == player) then { _mags = magazinesAmmo player; _inv = _mags select {(_x select 0) in getArray (configFile >> "cfgWeapons" >> currentWeapon player >> "magazines")}; if (count _inv > 1) then { _sort = [_inv,[],{_x select 1},"ASCEND"] call BIS_fnc_sortBy; _lowest_mag = _sort select 0 select 0; _lowest_cnt = _sort select 0 select 1; _mags_space = _sort select [1, count _sort - 1]; _full_tot = 0; _remain_tot = 0; {_full_tot = _full_tot + getnumber (configFile >> "cfgmagazines" >> _x select 0 >> "count")} forEach _mags_space; {_remain_tot = _remain_tot + (_x select 1)} forEach _mags_space; _full_space = _full_tot - _remain_tot; if (_lowest_cnt <= _full_space) then { for "_i" from 0 to count _mags_space - 1 do { if (_lowest_cnt > 0) then { _current_mag = _mags_space select _i select 0; _current_ammo = _mags_space select _i select 1; _current_space = getnumber (configFile >> "cfgmagazines" >> _current_mag >> "count") - _current_ammo; if (_current_space > 0) then { _mags_space set [_i,[_current_mag,_current_ammo + _lowest_cnt]]; _lowest_cnt = _lowest_cnt - _current_space; }; }; }; {player removeMagazineGlobal (_x select 0)} forEach (magazinesAmmo player select {(_x select 0) in getArray (configFile >> "cfgWeapons" >> currentWeapon player >> "magazines")}); {player addMagazine _x} forEach _mags_space; }; }}; }]; MAGAZINE REPACK to be placed in initPlayerLocal.sqf or in init.sqf when player is defined. MGI_fnc_repack = { _idc = ctrlIDC (_this select 0); _selectedIndex = _this select 1; player setVariable ["MGImags", +((magazinesAmmoFull player) select {(lbdata [_idc,_selectedIndex]) in _x})]; player setVariable ["MGIselect", true]; false }; 0 = [] spawn { while {true} do { waitUntil {!(isnull (finddisplay 602)) && isnil {player getVariable "MGIselect"}}; ((findDisplay 602) displayCtrl 619) ctrlSetEventHandler ["LBDblClick", "_this call MGI_fnc_repack"]; ((findDisplay 602) displayCtrl 633) ctrlSetEventHandler ["LBDblClick", "_this call MGI_fnc_repack"]; ((findDisplay 602) displayCtrl 638) ctrlSetEventHandler ["LBDblClick", "_this call MGI_fnc_repack"]; waitUntil {!isnil {player getVariable "MGIselect"} or isNull (findDisplay 602)}; if (!isnil {player getVariable "MGIselect"}) then { private ["_mag","_wpnType","_wpn"]; if (player getVariable ["MGImags",[]] isEqualTo []) then { _mag = ""; _wpn = "" } else { _cnts = 0; _mag = (player getVariable "MGImags") select 0 select 0; _fullcnt = getnumber (configFile >> "cfgmagazines" >>_mag >> "count"); if (_fullcnt > 0) then { { _wpnType = _x select 3; switch (_wpnType) do { case 1: {_wpn = primaryWeapon player}; case 2: {_wpn = handGunWeapon player}; case 4: {_wpn = secondaryWeapon player}; default {_wpn =""}; }; _cnts = _cnts + (_x select 1); player setammo [_wpn,0]; } count (player getVariable ["MGImags",[]]); _remainingShots = _cnts mod _fullcnt; {player removeMagazineGlobal _mag} count (player getVariable ["MGImags",[]]); player addMagazines [_mag, floor (_cnts/_fullcnt)]; if (_remainingShots >0) then { player addMagazine [_mag,_remainingShots]; }; reload player; }; }; player setVariable ["MGIselect", nil]; }; }; }; Double click on any magazine in your inventory.
×