Home   Help Search Login Register  

Author Topic: Formatting Format with addaction correctly  (Read 792 times)

0 Members and 2 Guests are viewing this topic.

Acecool

  • Guest
Formatting Format with addaction correctly
« on: 14 Feb 2005, 14:36:14 »
This gives error:

{call format ["%1 addaction ["Statistics","Scripts/Stats.sqs"], _x"]} forEach _Players

Any ideas how to format it correctly? Thanks in advance.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Formatting Format with addaction correctly
« Reply #1 on: 14 Feb 2005, 14:47:00 »
What exactly yer trying to achieve with that?
If you just want all the dudes to have the same action, use:

Code: [Select]
{_x addaction ["Statistics","Scripts/Stats.sqs"]} forEach _Players
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Acecool

  • Guest
Re:Formatting Format with addaction correctly
« Reply #2 on: 14 Feb 2005, 14:52:22 »
Hi, that doesnt work.

Basically, it adds the action to all units..

Example:
_Players = ["p1","p2","p3","p4","p5", "c1","c2","c3","c4","c5","c6","c7","c8","c9","c10"]

{call format ["%1_Licence_Vehicle_Car=false", _x]} forEach _Players
{call format ["%1_License_Vehicle_Motorcycle=false", _x]} forEach _Players
{call format ["%1_License_Vehicle_Sport=false", _x]} forEach _Players

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Formatting Format with addaction correctly
« Reply #3 on: 14 Feb 2005, 20:03:04 »
Not sure if this will help, but:

shouldn't "Scripts/Stats.sqs"

be

"Scripts\Stats.sqs"

If not.........just ignore me.


Planck
I know a little about a lot, and a lot about a little.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Formatting Format with addaction correctly
« Reply #4 on: 14 Feb 2005, 22:31:12 »
Not sure if this will help, but:

shouldn't "Scripts/Stats.sqs"

be

"Scripts\Stats.sqs"

If not.........just ignore me.


Planck

no, quite the contrary. In the MED, then all's fine using either the \ or the /[\b] but once you PBO the mission, only the / works.


And im not sure that the "call" command should be there. The call command is to call a function, a .sqf or .xsqs file. Using the call command has no use there.

Your problem might be with spacing in the lines. Instead of
Code: [Select]
format [... try
Code: [Select]
format[...
maybe that will help... :P I suggest if you dont have it to download the Com Ref from the Ed's Depot, or nab a program from our competitors over at flashpoint.gamezone.cz  :o :P

*cough cough never said that* ;)

hopefully that helps a bit  ::)
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Formatting Format with addaction correctly
« Reply #5 on: 15 Feb 2005, 08:00:14 »
Any ideas how to format it correctly? Thanks in advance.
Assuming the _Players array looks like
Code: [Select]
_Players = ["p1","p2","p3","p4","p5", "c1","c2","c3","c4","c5","c6","c7","c8","c9","c10"]this...
Code: [Select]
{call format [{%1 addAction ["Statistics","Scripts/Stats.sqs"]}, _x]} forEach _Players...ought to do it.
« Last Edit: 15 Feb 2005, 08:01:48 by Killswitch »

Acecool

  • Guest
Re:Formatting Format with addaction correctly
« Reply #6 on: 15 Feb 2005, 12:29:41 »
Wow, it works, thanks :-)

Another problem though, if I get close to an AI player with the added action, I get the action in my menu aswell... and it shows their stats...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Formatting Format with addaction correctly
« Reply #7 on: 15 Feb 2005, 13:37:52 »
That is a feature of the OFP.    When you get close to an object with an Action, you get the action too.     This is often a good thing.

You can fix the action script to make sure on ly the right person uses it with something like

? _this select 0 != _this select 1 : exit

Not guaranteed.
Plenty of reviewed ArmA missions for you to play

Acecool

  • Guest
Re:Formatting Format with addaction correctly
« Reply #8 on: 16 Feb 2005, 14:01:05 »
Hi, thanks, Ive been trying to find where to put that, via searching and placing around lol.. Where should I put that? Thanks.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Formatting Format with addaction correctly
« Reply #9 on: 16 Feb 2005, 14:41:07 »
Put it at the start of the script.
Plenty of reviewed ArmA missions for you to play

Acecool

  • Guest
Re:Formatting Format with addaction correctly
« Reply #10 on: 16 Feb 2005, 18:28:41 »
Thanks, it stops them from using it, but...  it still shows up :-/ lol..