OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Acecool 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.
-
What exactly yer trying to achieve with that?
If you just want all the dudes to have the same action, use:
{_x addaction ["Statistics","Scripts/Stats.sqs"]} forEach _Players
-
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
-
Not sure if this will help, but:
shouldn't "Scripts/Stats.sqs"
be
"Scripts\Stats.sqs"
If not.........just ignore me.
Planck
-
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 format [... try 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 ::)
-
Any ideas how to format it correctly? Thanks in advance.
Assuming the _Players array looks like
_Players = ["p1","p2","p3","p4","p5", "c1","c2","c3","c4","c5","c6","c7","c8","c9","c10"]this...
{call format [{%1 addAction ["Statistics","Scripts/Stats.sqs"]}, _x]} forEach _Players...ought to do it.
-
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...
-
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.
-
Hi, thanks, Ive been trying to find where to put that, via searching and placing around lol.. Where should I put that? Thanks.
-
Put it at the start of the script.
-
Thanks, it stops them from using it, but... it still shows up :-/ lol..