OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Acecool on 04 Aug 2008, 21:46:07

Title: call format addaction that is PRIVATE so no one else can use it
Post by: Acecool on 04 Aug 2008, 21:46:07
civarray = ["civ1","civ2","civ3","civ4","civ5","civ6","civ7","civ8","civ9","civ10","civ11","civ12","civ13","civ14","civ15"]
{call format ["?(player"=="%1) : %1_actionstats = %1 addAction [""Stats [%1]"",""Scripts/Players/PlayerStats.sqs""]", _x]} forEach civarray

This works without the "?(player==%1) : " but when you walk close to a civ, then you get their command which I want to be private.......I added the ""s around the == because otherwise it gave an error...

Josh



Got it

{call format ["if (player == %1) then {%1_actionstats = %1 addAction [""Stats [%1]"",""Scripts/Players/PlayerStats.sqs""]}", _x]} forEach civarray
Title: Re: call format addaction that is PRIVATE so no one else can use it
Post by: Spooner on 07 Aug 2008, 10:35:02
In case you didn't work out why your original script didn't work, call always runs the script as SQF, rather than SQS. Thus, you couldn't use ?: (if works in SQS or SQF, but must be all on one line when used in SQS).