Search the Community
Showing results for tags 'else'.
Found 2 results
-
Error when there is no player in squad lead spot
InsanityGamer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Essentially i'm try to make my own take on an invade and annex server thats team oriented. currently im working on adding a flagpole teleportation mechanic that will teleport you to your squad leader if you have a squad leader and will get you in the fight faster. so ive spent the better part of the day doing this.... im sure some of you are gagging at that, sorry im not very proficient in eden editor....or anything particularily... nonetheless this works as intended except it'll throw an error if there is nobody playing the character with their specific variable attached IE; SquadLeader_1, SquadLeader_2, Pilot, COC, Recon. for what i intend that's fine but i'd like to clean it up and offer a "Teleportation is down right now" for the characters that can teleport atleast. i've been trying to find some way to integrate try throw catch, but cant seem to find a way to set it up proper. any tips? -
scripting Ammo Refill Scripting Issue
TheSkyStarKnight posted a topic in ARMA 3 - QUESTIONS & ANSWERS
Hello everyone! Recently, whilst developing a map, I've run into some issues. I've worked now for several hours on this same set of scripts attempting to make them work, and looking at other scripts for reference, but to no avail. I've come to ask for help. Essentially, I have precisely eight weapons in a mission that I am creating, and I want to make a sign with an addAction that allows the player to buy ammo for him / her and all other players currently in-game. My original plan was to create one large script, however this did not work well, so I divided it into nine different scripts. I know, I know, those of you who are very good at scripting will be very annoyed by this, but that's where the learning comes in, right? (Yes, by the way, I AM using mods, so some of the configs are modded). Script 1 - called when the addAction is activated. { { if (money < 500) exitWith {hint "Sorry, your team does not have enough money for that!"}; }; else { {execVM "ammorefill1.sqf", execVM "ammorefill2.sqf", execVM "ammorefill.sqf", execVM "ammorefill4.sqf", execVM "ammorefill5.sqf", execVM "ammorefill6.sqf", execVM "ammorefill7.sqf", execVM "ammorefill8.sqf"}; sleep 1; {hint "Eligable for a restock! Restock Bought."}; sleep 3; {hint format ["A Team Member has spent $500 dollars on an ammo refill, and your team now has $%1 dollars left!", TL_killCount]}; }; }; Those eight scripts that are called are here, listed as follows: { if (player1 hasWeapon "SMG_02_F") then {allPlayers addMagazines ["30Rnd_9x21_Mag_SMG_02", 5], _cost = 2}; }; { if (player1 hasWeapon "arifle_AKS_F") then {allPlayers addMagazines ["30Rnd_545x39_Mag_F", 5], _cost = 2}; }; { if (player1 hasWeapon "rhs_weap_m4") then {allPlayers addMagazines ["30Rnd_556x45_Stanag", 5], _cost = 2}; }; { if (player1 hasWeapon "SMA_ACRMOE") then {allPlayers addMagazines ["30Rnd_556x45_Stanag", 5], _cost = 2}; }; { if (player1 hasWeapon "rhs_weap_sr25_d") then {allPlayers addMagazines ["20Rnd_762x51_Mag", 5], _cost = 2}; }; { if (player1 hasWeapon "rhs_weap_M590_8RD") then {allPlayers addMagazines ["rhsusf_8Rnd_00Buck", 5], _cost = 2}; }; { if (player1 hasWeapon "LMG_Zafir_F") then {allPlayers addMagazines ["150Rnd_762x54_Box", 5], _cost = 2}; }; { if (player1 hasWeapon "rhs_weap_m24sws_ghillie") then {allPlayers addMagazines ["30Rnd_9x21_Mag_SMG_02", 10], _cost = 2}; }; Each of those lines is in a different script. The eight scripts, however, are not the problem yet. The first script will not go through as it states that it is missing a Semicolon. If anyone could help me with this problem I would really appreciate it. Thanks for your time, ~Nic