Home   Help Search Login Register  

Author Topic: call format addaction that is PRIVATE so no one else can use it  (Read 1433 times)

0 Members and 1 Guest are viewing this topic.

Offline Acecool

  • Members
  • *
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
« Last Edit: 04 Aug 2008, 22:37:56 by Acecool »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
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).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)