UltimateBawb
Member-
Content Count
250 -
Joined
-
Last visited
-
Medals
Everything posted by UltimateBawb
-
Keeping groups from automatically going int formation.
UltimateBawb replied to UltimateBawb's topic in ARMA - MISSION EDITING & SCRIPTING
Thank you, that's exactly what I needed! :) -
Replacing Weapons and Inheriting Traits
UltimateBawb posted a topic in ARMA : CONFIGS AND SCRIPTING (addons)
I'm trying to replace default weapons with the modded weapons (RH) so that NPC's will by default use them. I figured it would be easier to replace the weapon configs than the actual NPC 'vehicles,' so I've done the following to replace the AK-74 with an RH_74: class AK_74 { scope = public; opticsZoomInit = 0.375; dexterity = 1.5; model = "\RH_aks\RH_ak74.p3d"; picture = "\RH_aks\inv\ak74.paa"; UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa"; displayName = "AK-74"; reloadMagazineSound[] = {"\RH_aks\sound\ak74_reload.wss", 0.056234, 1, 20}; modes[] = {"Single", "FullAuto"}; magazines[] = {"30Rnd_545x39_AK","RH_30Rnd_545x39_AK74_SP","RH_30Rnd_545x39_AK74_PP","RH_30Rnd_545x39_AK74_TR","RH_30Rnd_545x39_AK74_SD","RH_45Rnd_545x39_mag"}; descriptionShort = "The AK-74 is an assault rifle designed by Izhmash.<br/>Caliber: 5.45x39mm"; weaponInfoType = "RscWeaponZeroing"; discreteDistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000}; discreteDistanceInitIndex = 3; class Single : Mode_SemiAuto { begin1[] = {"\RH_aks\Sound\ak74.wss", 1.77828, 1, 1000}; soundBegin[] = {"begin1", 1}; reloadTime = 0.075; recoil = "RH_AKS74URecoil"; recoilProne = "RH_AKS74URecoilProne"; dispersion = 0.00175; minRange = 2; minRangeProbab = 0.5; midRange = 250; midRangeProbab = 0.9; maxRange = 400; maxRangeProbab = 0.1; }; class FullAuto : Mode_FullAuto { begin1[] = {"\RH_aks\Sound\ak74.wss", 1.77828, 1, 1000}; soundBegin[] = {"begin1", 1}; reloadTime = 0.075; ffCount = 30; recoil = "RH_AKS74URecoil"; recoilProne = "RH_AKS74URecoilProne"; dispersion = 0.00175; minRange = 0.1; minRangeProbab = 0.9; midRange = 60; midRangeProbab = 0.7; maxRange = 100; maxRangeProbab = 0.4; }; class Library { libTextDesc = "The AK-74 is a 5.45 mm assault rifle developed in the early 1970s in the Soviet Union by Mikhail Kalashnikov. It was the first Soviet rifle to be chambered in an intermediate rifle caliber. It was introduced into service in 1974 (used to equip, among others, Soviet forces engaged in the Afghanistan conflict). The weapon’s name is an abbreviation for Avtomat Kalashnikova model 1974."; }; }; Strangely, however, it seems that the units that should by default have this weapon spawn without ammo, and numerous errors regarding "displayNameShort" and reload animations appear. Certain other weapons don't even spawn with the units they should. Why is this, and if this is the incorrect way of replacing weapons, what should I do? -
Replacing Weapons and Inheriting Traits
UltimateBawb replied to UltimateBawb's topic in ARMA : CONFIGS AND SCRIPTING (addons)
I understand that, but when I change the class, any units that should have that weapon (the AK-74 in this case) spawn with the default weapon and no ammo (which had its class modified as well). -
Keeping groups from automatically going int formation.
UltimateBawb replied to UltimateBawb's topic in ARMA - MISSION EDITING & SCRIPTING
I'd like for them to not go into any formation, rather stay where I placed them in the editor. -
Keeping groups from automatically going int formation.
UltimateBawb replied to UltimateBawb's topic in ARMA - MISSION EDITING & SCRIPTING
No ideas? -
Unworking 'While' Statement
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Argh. For some reason adding in 'thens' in the if statements fixed it this time, don't know why it didn't work before. I've been writing too much Java. >_> Thanks for the help! -
Unworking 'While' Statement
UltimateBawb posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Trying to make a loop that's called by the server which spawns groups at certain areas and tells them to move somewhere every 60 seconds. Calling the script works, but anything inside the 'while' statement is ignored. Any suggestions? hint "Call Works"; while {true} do { hint "While Works"; if (a == 1) { indAttackGroup = createGroup resistance; _indAttacker = indAttackGroup createUnit ["TK_GUE_Soldier_5_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "RH_t56"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker = indAttackGroup createUnit ["TK_GUE_Soldier_5_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "RH_t561"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addWeapon "RPG7V"; _indAttacker addMagazine "PG7V"; _indAttacker addMagazine "PG7V"; _indAttacker addMagazine "PG7V"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker = indAttackGroup createUnit ["TK_GUE_Soldier_Sniper_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "huntingrifle"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker = indAttackGroup createUnit ["TK_GUE_Bonesetter_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "LeeEnfield"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; indAttackGroup addWaypoint [getMarkerPos "DeryaNPCAttack", 20]; sleep 60; }; if (b == 1) { indAttackGroup2 = createGroup resistance; _indAttacker = indAttackGroup2 createUnit ["TK_GUE_Soldier_5_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "RH_t56"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker = indAttackGroup2 createUnit ["TK_GUE_Soldier_5_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "RH_t561"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addMagazine "30Rnd_762x39_AK47"; _indAttacker addWeapon "RPG7V"; _indAttacker addMagazine "PG7V"; _indAttacker addMagazine "PG7V"; _indAttacker addMagazine "PG7V"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker = indAttackGroup2 createUnit ["TK_GUE_Soldier_Sniper_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "huntingrifle"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addMagazine "5x_22_LR_17_HMR"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker = indAttackGroup2 createUnit ["TK_GUE_Bonesetter_EP1", getMarkerPos "DeryaNPCSpawn", [], 1, "NONE"]; removeAllWeapons _indAttacker; _indAttacker addWeapon "LeeEnfield"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addMagazine "10x_303"; _indAttacker addWeapon "RH_m1911old"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; _indAttacker addMagazine "7Rnd_45ACP_1911"; indAttackGroup2 addWaypoint [getMarkerPos "DeryaNPCAttack2", 20]; sleep 60; }; if (c == 1) { TKAttackGroup = createGroup east; _TKAttacker = TKAttackGroup createUnit ["TK_Soldier_AAT_EP1", getMarkerPos "TKNPCSpawn", [], 1, "NONE"]; removeAllWeapons _TKAttacker; _TKAttacker addWeapon "FN_FAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addMagazine "20Rnd_762x51_FNFAL"; _TKAttacker addWeapon "RH_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker = TKAttackGroup createUnit ["TK_Soldier_AT_EP1", getMarkerPos "TKNPCSpawn", [], 1, "NONE"]; removeAllWeapons _TKAttacker; _TKAttacker addWeapon "RH_akm"; _TKAttacker addMagazine "30Rnd_762x39_AK47"; _TKAttacker addMagazine "30Rnd_762x39_AK47"; _TKAttacker addMagazine "30Rnd_762x39_AK47"; _TKAttacker addMagazine "30Rnd_762x39_AK47"; _TKAAttacker addWeapon "RPG7V"; _TKAAttacker addMagazine "PG7V"; _TKAAttacker addMagazine "PG7V"; _TKAAttacker addMagazine "OG7"; _TKAttacker addWeapon "RH_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker = TKAttackGroup createUnit ["TK_Soldier_Medic_EP1", getMarkerPos "TKNPCSpawn", [], 1, "NONE"]; removeAllWeapons _TKAttacker; _TKAttacker addWeapon "RH_ak74"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addMagazine "30Rnd_545x39_AK"; _TKAttacker addWeapon "RH_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker = TKAttackGroup createUnit ["TK_Soldier_MG_EP1", getMarkerPos "TKNPCSpawn", [], 1, "NONE"]; removeAllWeapons _TKAttacker; _TKAttacker addWeapon "RH_rpk74"; _TKAttacker addMagazine "RH_45Rnd_545x39_mag"; _TKAttacker addMagazine "RH_45Rnd_545x39_mag"; _TKAttacker addMagazine "RH_45Rnd_545x39_mag"; _TKAttacker addMagazine "RH_45Rnd_545x39_mag"; _TKAttacker addMagazine "RH_45Rnd_545x39_mag"; _TKAttacker addMagazine "30Rnd_762x39_AK47"; _TKAttacker addMagazine "30Rnd_762x39_AK47"; _TKAttacker addWeapon "RH_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; _TKAttacker addMagazine "RH_8Rnd_762_tt33"; TKAttackGroup addWaypoint [getMarkerPos "TKNPCAttack", 20]; sleep 60; }; }; -
Unworking 'While' Statement
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I've tried to change the if statements to that before, but the hint is completely independent of the ifs, no? -
I'm a bit confused as to how much the Warfare Module can be modified. I understand how to make capturable towns and basic things like that, but is it possible to change which weapons and vehicles can be bought at barracks and factories? Also, is it possible to change the preset warfare locations of a map? I want to make a warfare version of a custom island, but it places the bunkers inside buildings in cities.
-
Calling a dialog box directly from addAction
UltimateBawb posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Is it possible to call a class from addAction? I don't want to make a new .sqf for every dialog call. -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Oh, I forgot to mention I originally didn't plan for it to be based on which side you're on. I'm trying to make it run based on what variable "Shop" equals. -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Actually, I'm still having problems. You said it would be compatible with addAction. How? -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thank you so much! I was just struggling to get that working myself, but I used arrays to create an "okList" instead of classes. You're truly awesome. +1 -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Wow, that script really helps, thanks :) I did define those in Defines.hpp, but figured posting them would be unnecessary. Thanks for the help, I should be able to work with what you've given me. -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This is the code that is involved in the dialog making, would be great if you could help. I left the fields of the addActions empty for obvious reasons. init.sqf: execVM "initActions"; initActions.sqf: shopWest addAction ["Buy Weapons and Equipment", ""]; shopEast addAction ["Buy Weapons and Equipment", ""]; description.ext: #include "Defines.hpp" #include "Dialogs.hpp" Defines.hpp: class Button { type = CT_BUTTON; idc = -1; style = ST_LEFT; colorText[] = {0, 0, 0, 1}; font = FontM; text = "" sizeEx = 0.025; default = false; colorActive[] = {0, 0, 0, 0}; colorDisabled[] = {0, 0, 0, 0.1}; colorBackground[] = {0.8,0.8,0.8,0.3}; colorBackgroundActive[] = {0.7,0.7,0.7,1}; colorBackgroundDisabled[] = {1,1,1,0.3}; colorFocused[] = {0.84,1,0.55,1}; colorShadow[] = {0, 0, 0, 0.1}; colorBorder[] = {1, 1, 1, 1}; soundEnter[] = {"", 0.15, 1}; }; Dialogs.hpp: class shopWest { idd = -1; movingEnable = true; controlsBackground[] = {Background}; objects[] = { }; controls[] = { M4A1}; class Background { colorBackground[] = { 0.40, 0.33, 0.19, 0.95 }; style = ST_BACKGROUND; x = 0.06; y = 0.15; w = 0.372; h = 0.4; }; class M4A1: Button { x = 0.068; y = 0.19; w = 0.353; h = 0.04; text = "1: M4A1 Carbine" }; }; class shopEast { idd = -1; movingEnable = true; controlsBackground[] = {Background}; objects[] = { }; controls[] = { AKM}; class Background { colorBackground[] = { 0.40, 0.33, 0.19, 0.95 }; style = ST_BACKGROUND; x = 0.06; y = 0.15; w = 0.372; h = 0.4; }; class AKM: Button { x = 0.068; y = 0.19; w = 0.353; h = 0.04; text = "1: AKM" }; }; -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
YES. Sorry I didn't mention that. That's why I need to distinguish between scripts and classes. -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ok, sorry. The dialogue is essentially a shop, consisting mainly of buttons. When a button is pressed, the selected weapon is changed to the corresponding weapon, and the buy button causes that weapon to be spawned. Only the unit who activates the addAction will see the dialog. -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Have a unit with an action that will open up a dialog box. But there will be multiple units each with their own dialog. -
Calling a dialog box directly from addAction
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
But once I call the .sqf file that holds every script, how would I determine which class to call? Sorry if I'm not getting this. -
Once I define a dialog class in the description, what method do I use to call it? createDialog dosen't seem to work.
-
Changing full health level?
UltimateBawb posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
How can I change the default full health level? -
How to change side aggro?
UltimateBawb posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'd like to make the independents aggressive towards Blufor, how would I do this? -
Disabling Physics/Destruction Engine
UltimateBawb posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I was wondering if I could disable the destruction and physics of buildings within an area. My mission has multiple bases that I'd like to be indestructible. There are also AI merchants that I want to not be able to be moved by explosions. How can I disable destruction and physics? -
Disabling Physics/Destruction Engine
UltimateBawb replied to UltimateBawb's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks, the event handler bit did help with the indestructible added structures. However, most of the other things you said about disabling movement and AI are already implemented. I need to "glue" units to the ground so explosions won't make them superman. -
How to return number of units in a group?
UltimateBawb posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I want to make a script where you cannot hire more soldiers if you have too many people in your group. "_x = _x + 1" forEach player in units player ; if (money < 5000) or (_x >= 10) then { player groupChat format ["You cannot recruit a rifleman.]; } else { money = money - 5000; _soldier = group player createUnit ['USMC_Soldier', Position player, [], 3, 'FORM']; player groupChat format ["You have recruited a rifleman and have $%1 remaining", (money)]; }; How can I fix this?