#arma3_scripting

1 messages ยท Page 267 of 1

tough abyss
#

Maybe tree is just "tree"?

#

Here my custom setVariable/getVariable to allow this functionality on simple objects: http://pastebin.com/DssX35zh @meager granite @native hemlock it co-exists with normal setVariable but override it.

dim owl
#

if i want to make it for trees near markers would i do it like that ?

'[] call tag_fnc_isTargetTree && player distance (getmarkerpos "testmarker") < 20',
#

okay if i want to do this with multiple markers should i use

getmarkerpos in ["blabla","bla"]

?

#

okay thank you for the help ๐Ÿ˜ƒ

#

yeah i want to use this in roleplay because the standard is shit for gathering ๐Ÿ˜„

#

nice ๐Ÿ˜„

#

okay

#

maybe i give it a try ๐Ÿ˜ƒ not sure ^^ have no time today

dim owl
#

how can i get the best ingame voice quality ? if i use vonCodecQuality should i use high numbers for good quality ?

little eagle
#

no idea, but high numbers sound always good to me

dim owl
#

okay ๐Ÿ˜„

still forge
#

anyone know if it's possible to override a vehicles top speed without editing the modpack or for example a default car?

tough abyss
#

There is a function like isSimpleObject?

tough abyss
#

BRPVP_isSimpleObject = {
_this setVariable ["sot",false,false];
_this getVariable ["sot",true]
};

indigo snow
#

cant you just test the object variable? if it has typeOf == "" or contains : .

little eagle
#

typeOf also reports "" for roads

#

if that would be a problem, idk

tough abyss
#

@indigo snow its another way... wich is better? just a function race can say hehe

#

Just want to say my custom setVariable/getVariable runs perfect (the code i posted is old) and i can even use it in general if the isSimpleObject is fast enough.

#

So i rulez... and I'M the master ๐Ÿ˜›

rocky cairn
#

Does anyone know if its possible to script rack mount radios in ACRE? IE once you get in a vehicle you have access to a specific radio? once you get out you can't use it anymore?

dusk sage
#

I've never used ACRE, but it sounds totally possible via script

rocky cairn
#

Any thoughts on how? If theres an event handler for entering and exiting a vehicle I'd assume you can just add the radio item on entrance and remove it on exit

little eagle
#

getIn and getOut

#

as well as
getInMan and getOutMan

ocean veldt
rocky cairn
#

Would that be helpful for when someone gets in a vehicle?

little eagle
#

the event does fire when a vehicle is entered or when a soldier enters a vehicle respectively

#

or leaves

#

@rocky cairn , using CBA?

rocky cairn
#

Yes

little eagle
#

ok, wait

#
// init.sqf
#define BACKPACK_RADIO "a_classname_i_can't remember"
#define VEHICLE_TYPES ["b_mbt_01_cannon_f"]

["vehicle", {
    params ["_unit", "_vehicle"];

    if (toLower typeOf _vehicle in VEHICLE_TYPES) then {
        // enters a vehicle with radio
        _unit addBackpack BACKPACK_RADIO;
    } else {
        // leaves a vehicle with radio
        if (backpack _unit == BACKPACK_RADIO) then {
            removeBackpack _unit;
        };
    };
}] call CBA_fnc_addPlayerEventHandler;
#

you have to fill in the macro classnames yourself

#

I can't remember any of them

rocky cairn
#

Awesome. Thanks!

little eagle
#

b_mbt_01_cannon_f etc. must be lower case

warped thicket
#

@rocky cairn ACRE2 will get vehicle racks soonish, they are currently WIP ๐Ÿ˜‰

#

@little eagle that script will replace whatever backpack you had though

little eagle
#

no, it will be dropped on the ground. that's what addBackpack does

indigo snow
#

Yea but acre doesnt use backpacks is i think what jonpas is trying to tell you

little eagle
#

Idk. He asked for backpacks ยฏ_(ใƒ„)_/ยฏ

#

it's not like the script isn't easily customizable

rotund cypress
#

Hey guys, I have a problem with playing a sound locally. So this works playSound3D ["a3\sounds_f\sfx\blip1.wss", player]; and plays it globally or within the raidus, but doing say3d ["a3\sounds_f\sfx\blip1.wss"]; does not work.

little eagle
#

Sound is defined in CfgSound of the Description.ext.

rotund cypress
#

Could I define that sound in there?

#

Or does that not work with sounds like that that are in ArmA originally and not the mission file?

little eagle
#

does work with mission, but you have to define a class in CfgSounds

rotund cypress
#

So this would work ? class CfgSounds { sounds[] = {}; class hint { name = "hint"; sound[] = {"a3\sounds_f\sfx\hint-4.wss", 1.0, 1}; titles[] = {}; }; };?

little eagle
#

try it

tough abyss
#

If put on buildings with usable doors, the Event Handlers AnimChanged, AnimDone and AnimStateChanged runs when a door is opened/closed?

native hemlock
#

Doubt it, those event handlers are for player animations which are handled differently than object animations. Should be easy to test though

rancid ruin
#

so before i spend a long time doing this...has anyone written a perlin/simplex/guassian noise generating script?

kindred lichen
#

Hey, whats the best way to take a spawned group and have them load into any vehicles that are in their group?

I'm spawning various random enemy groups, they all have vehicles, but some have 1, some have 2

#

_groupVar = [ getmarkerpos _closestSpawn, EAST, (configfile >> "CfgGroups" >> "East" >> "rhsgref_faction_chdkz" >> "rhs_group_indp_ins_72" >> "RHS_T72baSection")] call BIS_fnc_spawnGroup;

   wp = _groupVar addWaypoint [position (leader _groupVar),0];    
   wp setWaypointSpeed "Full";   
   wp setWaypointType "GETIN";   
   wp setWaypointBehaviour "safe";
#

That's what I'm trying, but they seem to have 1 or 2 get in and the rest just run next to the vehicle.

meager granite
#

This should assign vehicle to the group and they will get in\get out automatically

#

Though it might be best to manually assign some units to driver\gunners

opal thistle
#

what could be used to reliably and consistently identify a "slot" in a game? UID identifies a client, but not AI. netid identifies and object, but it changes during the respawn, while the entity could still be considered the same, it only changed it's "vehicle"
so any thoughts?

meager granite
#

You'll need to set some description to all units though

tough abyss
#

@native hemlock i asked because none of it worked. No deal so.

hallow spear
#

anyone know how to use setConvoySeparation command?

hallow spear
#

thanks

high glade
#

I have a troublesome LOAD waypoint. It's attached to an AI helicopter which is suppose to wait for a group to LOAD and then go to the next waypoint which is MOVE. For some reason the condition I've set is only fulfilled with only 1 player in the group. If there is more than one, the condition isn't met. I'm using this code for the condition: "{_x in chopper1} count (units group player) == {alive _x} count (units group player);"

#

I've also tried hardcoding it like (unit1 in chopper1), which works. but if I do: (unit1 in chopper1) AND (unit2 in chopper1) it doesn't work.

high glade
#

Well, apprently it doesn't work if I'm doing (unit2 in chopper1) alone either, unit2 in this case being an AI. Making me think that for some reason the waypoint doesn't respond to any AI's being inside the chopper.Seeing it only works with me, the player. I haven't tested with other players yet, but it should react to the AI as well right?

night geode
#

@high glade Shot in the dark: But any luck with ((unit1 in chopper1)AND(unit2 in chopper1))?

proven crystal
#

does anyone have a simple script at hand to lock player slots for specific players by their UID?

#

i find only one version online and there the responses indicate tat itis buggy

dusk sage
#

A simple way would be to name your units, then check on init whether their UID matches that of the slot (hardcoded)

#

If you named a unit unit_1

#

Then str player will return "unit_1"

little eagle
#

not always. I think stuff like the Zeus module assigns different vehicle var names

dusk sage
#

Never really done anything with zeus

#

That sucks

proven crystal
#

does #kick work with the UID?

#

if so, what do you think about this: ```//nul = [this] execVM "scripts/UIDBlocker.sqf";

//Execute this script on reserved units in the editor

_unit = _this select 0;

if (isPlayer _unit) then {

_uid = getPlayerUID _unit; //get the player unique ID

_whitelist = [
    [134223131312,"PlayerName"],
    [131313131313,"PlayerName"]
];

_found = "";

{
    if (_uid == _x select 0) then {_found = _x select 1};
} foreach _whitelist;

      {

if (_found == "") then {
    hint "This is a reserved slot, please choose a different one. You will be kicked from the server. Sorry for the inconvenience."; 
    sleep 10;
   [{serverCommand format["#kick %1",_uid];}, "BIS_fnc_spawn", false] call BIS_fnc_MP; 

};

};

little eagle
#

pretty sure it only works with the nick name

proven crystal
#

then i guess i need to get me the name of the unit somewhere in there

little eagle
#

You can always just use:
findDisplay 46 closeDisplay 0
to end the local mission

#

as long as it's a machine with interface

proven crystal
#

i suppose kick will do. if i get the name of the unit that the player is using, that should do the job no?

little eagle
#

findDisplay 46 closeDisplay 0

#

That's what you want

#

The problem with serverCommand is, that it requires a logged in admin to work

#

doesn't work on the dedi itself afaik

#

But if you use
findDisplay 46 closeDisplay 0
the mission just ends for this client

proven crystal
#

ok and i just put thatthere instead of the line with servercommand?

little eagle
#

yeah

proven crystal
#

entire line i mean

little eagle
#

yeah

proven crystal
#

ok will give that a try. thaks

little eagle
#

wait

#

is that line executed on the server or on the client?

proven crystal
#

i run it on the server

little eagle
#

ok, then use this:
{findDisplay 46 closeDisplay 0} remoteExec ["call", _unit];

#

so you close the mission display on the client and not the server

proven crystal
#

alright... i suppose ill have to look closer into what that means at some point ^^

#

it sounds important

little eagle
#

but something is weird

#
   hint "This is a reserved slot, please choose a different one. You will be kicked from the server. Sorry for the inconvenience.";
#

why do that on the server?

#

it makes no sense to show it on the server

#

you have to show that to the client

#

findDisplay 46
reports the mission display

#

closeDisplay 0
closes it with exit code 0

#

-> mission ends

#

really simple

proven crystal
#

im adapting from another code. what it is supposed to do is kick the unauthorized player back into the assignment screen

#

or off the server guess

little eagle
#

Yeah, but if this script runs on the server

#

then the hint won't do anything

proven crystal
#

ah ok

little eagle
#

Maybe it runs on the clinet?

#

You should know that, haha

proven crystal
#

hm. how would i know that ? :D

little eagle
#

๐Ÿ˜

proven crystal
#

i mean its a script executed on the server

little eagle
#

then it runs on the server

#

or does it run on every machine?

#

if so it does some pretty redundant stuff and does n network traffic

proven crystal
#

how would i even make or prevent it do that?

little eagle
#

well, how is the script executed in the first place?

proven crystal
#

i intended to put nul = [this] execVM "scripts/UIDBlocker.sqf"; in the unit init field

#

and the script is in that missions scripts folder, which is on the server

#

then it would check out the unit and so on...

little eagle
#

the init box runs on every machine

#

So you have 30 connected machines, right?

#

And each of them sends the BIS_fnc_MP thing to all others

#

30 messages to 30 machines

#

900 times the same line executed

proven crystal
#

i see i see

little eagle
#

๐Ÿ˜ฎ

proven crystal
#

so call BIS_fnc_MP; sends out stuff to all clients, hm?

little eagle
#

in your case yes

#

But BIS_fnc_MP is also deprecated

proven crystal
#

and your line would be a better solution for the time being?

little eagle
#

looks better and is faster

proven crystal
#

i see..

little eagle
#

and your line would be a better solution for the time being?
No, you have to sort out where you want to execute the script first

#

otherwise everyone get's kicked just because someone entered an illegal slot

proven crystal
#

uh.

#

ok so i figure the server should check the uid and unit when someone enters

little eagle
#

yeah.

proven crystal
#

so ill have to run this somewhere from the server init

#

not putting lines in units i mean

#

is there an onplayerconnect eventhandler or so?

little eagle
#

this one, but it does not report the slot you picked

#

initPlayerServer.sqf would be the best place I think

#

initPlayerServer.sqf Executed only on server when a player joins mission (includes both mission start and JIP). See initialization order for details about when the script is exactly executed. [player

#

[player:Object, didJIP:Boolean]

#

so you're first line in the script would be:

#
params ["_unit", "_didJIP"];
#

and then you have all you need

#

you just have to remote execute the hint and the kick

#

I'd say you just define a function that does this in init.sqf (so every machine has it)

#

and then you remotly execute that function from the server via remoteExec

#

would look pretty clean. few lines and easy to comprehend

proven crystal
#

i do not have a initPlayerServer.sqf

#

is that also something i should know of?

#

damnit i just managed to set up mods straight on this thing, now i have to rewrite all my scripts ^^

little eagle
#

If you don't have it, then it uses an empty dummy version from the game files

#

just create one

proven crystal
#

ah alright

#

that i guess counts for all those files listed there?

little eagle
#

listed where?

proven crystal
#

this events scripts link you just gave

little eagle
#

Not for init.sqf and some of the .sqs things

#

those are hard coded engine wizardry

#

but yeah, as long as you don't have them, they basically do nothing

dusk sage
#

serverCommand works server side IIRC

little eagle
#

a few exceptions which you should never use as your own file. I think they're not listed there though

dusk sage
#

Also, why not end mission locally ๐Ÿ˜ƒ ?

little eagle
#

That's what I told him

#

with the closeDisplay thing

#

I still think that is the simplest

#

As of Arma 3 v1.39 serverCommand can be used on dedicated server and headless clients. This requires a password, both set in server.cfg and passed to the command itself.

proven crystal
#

i must say, i am entirely confused now, but wll see if i can get it figured out

little eagle
#

just discard everything you have atm and think you know atm. It's way more contrived than what you want and should use

proven crystal
#

that includes discarding the eventhandler, right? ^^

little eagle
#

yeah. use the event script instead. initPlayerServer.sqf

#

it runs for each player that connects but only on the server

proven crystal
#

right.. ok. ill start form there ^^

#

ok so what comes out is i create that file: initPlayerServer.sqf

#

and into it i put ```_unit = _this select 1;

_uid = getPlayerUID _unit; //get the player unique ID

_whitelist = [
[134223131312,"PlayerName"],
[131313131313,"PlayerName"]
];

_found = "";

{
if (_uid == _x select 0) then {_found = _x select 1};
} foreach _whitelist;

  {

if (_found == "") then {
"This is a reserved slot, please choose a different one. You will be kicked from the server. Sorry for the inconvenience." remoteExec ["hint", _unit];

sleep 10;

{findDisplay 46 closeDisplay 0} remoteExec ["call", _unit];

};```

little eagle
#

_unit = _this select 1;
is wrong according to the wiki

proven crystal
#

0

little eagle
#

yeah or use
params ["_unit"];
which is less horrible

#

I'm not sure how if (_found == "") then { exactly works

dusk sage
#

Can just RE endmission, as to avoid whitelisting call (if you're whitelisting)

#

Will also allow for a nice message

#

_found = ""; @little eagle

little eagle
#

endmission can have a message?

#

yeah, but I don't see any connection to slots

#

atm it just kicks everyone except those that are white listed

proven crystal
#

its only because i have that _found variable

#

and my whitleist has UID with name

#

i use it for customyed welcome message

#

so it is = "" intially, and if the UID matches wth the whitleist, it becomes =Playername

dusk sage
#

yeh, you can use a template from description.ext

proven crystal
#

a shit thats true... before it was meant to be placed in the init of the units

#

so i shall name some units

little eagle
#

yeah, that sounds like a good idea

proven crystal
#

and can use the manually made ones. then i can also custom equip them

little eagle
#

I hope you see now how this is simpler

proven crystal
#

yes, its good learning ^^

#

so this initserverplayer.sqf just comes into the missin folder i suppose?

little eagle
#

same place where init.sqf is, yes

proven crystal
#
_unit = _this select 0;

_reservedunits = ["reserved1","reserved2","reserved3","reserved4","reserved5"]

_uid = getPlayerUID _unit; //get the player unique ID

_whitelist = [
    [131313131313,"PlayerName"],
    [131313131313,"PlayerName"]
];

_found = "";

{
    if ((_unit in _reservedunits) and (_uid == _x select 0)) then {_found = _x select 1};
} foreach _whitelist;

      {

if (_found == "") then {
    "This is a reserved slot, please choose a different one. You will be kicked from the server. Sorry for the inconvenience." remoteExec ["hint", _unit];
    
    sleep 10;
   {findDisplay 46 closeDisplay 0} remoteExec ["call", _unit]; 

} else {

    format["Welcome %1. Good hunting!",_found] remoteExec ["hint", _unit];
    
};
little eagle
#

missing ;

proven crystal
#

argh!

little eagle
#

also, you want the variables of these, not strings

jade abyss
#

if ((_unit in _reservedunits) and (_uid == _x select 0)) then
->
if ((_unit in _reservedunits) and (_uid == _x select 0)) exitWith (no need to cycle through the rest)

proven crystal
#

why do i not want strings there?

#

doesnt need the "" you sure?

little eagle
#

you're currently checking if _unit, an object, is in an array of strings

#

that will never be true

proven crystal
#

copy that.

#

looks odd tho

#

_reservedunits = [reserved1,reserved2,reserved3,reserved4,reserved5];

little eagle
#

add reserved6 and it looks even

#

(sorry)

proven crystal
#

:D

proven crystal
#

hmm doesnt seem to do the job

little eagle
#

add some debug with diag_log and watch where it goes wrong

proven crystal
#

serverlog shows this

#

_reservedunits = [reserved1,reserved2,reserved3,reserved4,>
20:19:41 Error position: <reserved1,reserved2,reserved3,reserved4,>
20:19:41 Error Undefined variable in expression: reserved1
20:19:41 File mpmissions\ALiVE_Template_NoScr.Tanoa\initPlayerServer.sqf, line 4

little eagle
#

yeah, that's a problem

proven crystal
#

i guess that might be because th eplayable npcs are not around when no player uses them

#

to the variable doesnt exist

#

says earlier 20:18:53 DATA: Restoring player data for reserved2

#

thats when i connected

little eagle
#
_reservedunits = [
    missionNamespace getVariable ["reserved1", objNull],
    missionNamespace getVariable ["reserved2", objNull],
...
];
#

i guess that might be because th eplayable npcs are not around when no player uses them
yeah, exactly

opal thistle
#

consider a group with a player only. When a player respawns, what happens to the group? If he's still linked to the grop, e.g. group player will return this same group? Or it gets destroyed?

little eagle
#

same group

opal thistle
#

ah, that's good

#

BIS wiki ain't clear when they dispose the group

little eagle
#

I think they only delete them if you use join(Silent) and the previous group was empty

#

not sure about AI only groups where everyone dies

hallow spear
#

can cfgweapons store variables in anyway? or cfgMagazine?

proven crystal
#

hm still no effect, but this time i dont see error messages either

little eagle
#

@hallow spear You mean, can you attach variables to specific instances of a weapon?

#

so they keep them if dropped and picked up later?

#

@proven crystal add debug with diag_log

proven crystal
#

where and how do i add that?

buoyant heath
#

diag_log format ["text %1 - %2 - %3", var1, var2, var3];
eg: diag_log format ["The player is %1", player];

hallow spear
#

yes, commy2. I am hoping to save data to specific inventory items, weapons/ammo too

#

so they can be on ground with variables as well

buoyant heath
#

Stick it in your code where you're wanting to watch for what's happening. diag_log will output to the RPT

little eagle
#

@hallow spear You're out of luck then. Not possible

hallow spear
#

i thought so. I got excited when I saw you responding. if anyone.. itd be commy. Ok thanks. I'll make something up

little eagle
#

maybe in Arma 4 ยฏ_(ใƒ„)_/ยฏ

#

it can work with vests/ uniforms and backpacks, if you get the containers

#

and magazines have magazine IDs, though they get reset when opening the Arsenal, respawning and all that

proven crystal
#

will dag_log output in the servers logfile too?

#

im running that on the server, no rpt there afaik

little eagle
#

there always is a RPT

proven crystal
#

only logfile im aware of is the screenlog...

#

which says screenlog.0

#

but its probably a txt

#

but it shows the stuff

little eagle
#

.rpt

proven crystal
#

ok. anyway, what it says is 21:07:15 Error in expression <if ((_unit in _reservedunits) and (_uid == _x select 0)) then {_found = _x selec> 21:07:15 Error position: <== _x select 0)) then {_found = _x selec> 21:07:15 Error Generic error in expression

little eagle
#

it says script kaput

proven crystal
#

i see zet. but vatz kaput viz it?

#
 
    [131313131313,"PlayerName"]
];

_found = "";

{
    if ((_unit in _reservedunits) and (_uid == _x select 0)) then {_found = _x select 1};
} foreach _whitelist;```
#

my whithelist are arrays of uid and a name in string format

little eagle
#

what is _uid?

proven crystal
#

the UID of the unit. wait

#


_reservedunits = [
    missionNamespace getVariable ["reserved1", objNull],
    missionNamespace getVariable ["reserved2", objNull],
    missionNamespace getVariable ["reserved3", objNull]

];


_uid = getPlayerUID _unit; //get the player unique ID




_whitelist = [
    
    ["131313131313","PlayerName"]
];




_found = "";

{
    if ((_unit in _reservedunits) and (_uid == _x select 0)) then {_found = _x select 1};
} foreach _whitelist;



      {

if (_found == "") then {
    "This is a reserved slot, please choose a different one. You will be kicked from the server. Sorry for the inconvenience." remoteExec ["hint", _unit];
    
    sleep 10;
   {findDisplay 46 closeDisplay 0} remoteExec ["call", _unit]; 
    diag_log format ["UID not on whitelist, player kicked"];
} else {

    format["Welcome %1. Good hunting!",_found] remoteExec ["hint", _unit];
    
    sleep 10;
};```
little eagle
#

Return Value:
String

#

can't == strings and numbers

#

131313131313 would also be above the single float precision, so it looks suspicious

proven crystal
#

so id have to put that fake number in the whitelist into ""?

little eagle
#

yeah. strings

proven crystal
#

aight...

#

made the correction also above. lets see if this works. but this is last try.its half past 2 already over here and i gotta work tomorrow

little eagle
#

... Australia? Asia?

proven crystal
#

Asia

#

but was worth staying up. thanks for the help already

#

learned a few things again

#

dammit still logging on...

#

i found an open bracket that never closed.... i hope that was the last bugger then....

little eagle
#

very likely. never closed bracket doesn't report errors, because splendidTM

proven crystal
#

it works!

#

thanks a load!

little eagle
#

congratz

gray bluff
#

So I've never made event handlers before, so I'm not sure how to get the syntax right. I want to do this:

#

Add this to run against anyone that gets in vehicle setCaptive false

#

And add that command to this event handler this addEventHandler ["GetIn",{hint "You are considered hostile now"}];

little eagle
#

lgtm

gray bluff
#

not sure how to combine the two commands together

paper rain
#

put a ; at the end of each line

#

use shift+enter to go to another line in the editor's init window

dim owl
#

hey im trying to display the crew of my vehicle and deperate them by a comma.
trying it like this:

_crew = crew vehicle player;
_text = "";
if (_crew isEqualTo [player]) then {
    _text = format ["%1",name (vehicle player)];
}
else
{
    {
        _text = _text + format ["%1,",name _x];
    }foreach _crew;
};

hint str _text;

but the output is "John Collins, other crew, other crew, other crew,"
the problem is the comma at the end i dont know how to remove it

split coral
#

put the comma in front so it won't be at the end. ๐Ÿ˜„

dim owl
#

but then the output is ",John Collins, other crew, other crew, other crew" ๐Ÿ˜ƒ

split coral
#

oh right, misread the if

#

Maybe:
{
_text = _text + format ["%1",name _x];
if (_foreachindex < (count _crew) -1) then {_text = _text + ", "};
}foreach _crew;

dim owl
#

it worked thanks ๐Ÿ˜„

jade abyss
#

@dim owl
Also an \n (e.g. format["%1\n",name _x]; ) might be usefull.

#

(linebreak)

dim owl
#

yeah, but im trying to use the command draw icon. the problem is actually the crew is not beeing displayed right.
http://pastebin.com/j3v0RTGN

jade abyss
dim owl
#

okay

jade abyss
#

and thats why i hate
if()then{

Instead of

if()then
{

#

the crew is not beeing displayed right<- That means what?

dim owl
#

it is displayed multiple

jade abyss
#
  • why "visiblePosition" ? getPos is enough same with "direction" (getDir)
#
_unit = _x;
if ((vehicle _x) == (vehicle _unit)) then```
you are checking " vehicle _x == vehicle _x " (just using _unit instead of _x the 2nd time)
dim owl
#

yeah that worked but if i leave the vehicle it shows on the map that im in the vehicle

jade abyss
#

Of course it works, since you are checking if True == true or A == A or BANANA == BANANA

#

The "else" would never be used.

dim owl
#

so i would do it like this ?
((vehicle _x) == _unit)

jade abyss
#

for example

#

This would check, if the unit is the unit itself or a vehicle atm

#

(like sitting in cargo or Driverseat, or any other seat inside a vehicle)

dim owl
#

okay

jade abyss
#

e.g.

if(vehicle player != player) then
{
    systemchat "in a car"
}
else
{
    systemchat "on foot"
};
dim owl
#

if my crew get out the text is "John CollinsEdwar Jackson".
so the text is first the name of the player and then the unit name. i dont understand this shit xD

rancid ruin
#

visiblePosition is render timescope unlike getPos

#

if it's in a draw EH then i think visiblePos is correct

dim owl
weak tiger
#

so uh weaponCargo only returns base weapons, not attachments etc

#

is there a way to get the full and true contents of an ammobox

#

/ vehicle

#

thx aaron

#

np aaron

proven crystal
#

That works on ammoboxes? Wanted to look into that.

#

Does it also work to pack backpacks including uniforms?

#

Would like to have ready made backpacks waiting to deploy

little eagle
#

It's read , but not write

tough abyss
#

Hello there! I've got a safezone is a coop mission, that deletes bullets from weapons, but people then decide to use mounted guns on vehicles. Is there a way to remove those when fired inside a certain circle?

little eagle
#

same way you do it for soldiers, but you attach the event handler to vehicles

#

Or you wait for 1.66 and use firedMan instead of fired

tough abyss
#

okay so right now when a unit fires a mounted gun, the eventhandler is placed on the vehicle instead of the player?

dim owl
#

@little eagle How could i change this ? any iddeas ?

tough abyss
#

On my mission players can create objects, and most of the objects are created as simpleObjects. As you may know, simple objects are created with a z positioning that is wrong. To fix this z error i can have a list of z adjusts for each kind of object, but i preffer to create the object as a normal object first, calculate the z adjust, delete the normal object and recreate it as a simple object, and then apply the z adjust. With that i don't need to maintain a list of adjusts. Sadly this will make the engine create and delete lots of objects just to calculate the Z adjust, and i ask you if this can degrade performance or stability over time?

little eagle
#

okay so right now when a unit fires a mounted gun, the eventhandler is placed on the vehicle instead of the player?
yes
How could i change this ? any iddeas ?
add a command to suspend the loop. there aren't that many to pick from...
if this can degrade performance or stability over time?
probably not. deleted objects should no longer afect performance

tough abyss
#

@little eagle thanks man! You are the MASTA!

proven crystal
#

is this the correct way to send a titletext to a client? ["bla", "BLACK IN",10 ] remoteExec ["titleText", _unit];

peak epoch
#

looks good

proven crystal
#

doesnt seem to do the job... i use 1 instead of 10 though... maybe too short for my loading screen...

austere granite
#

Is there a way to prevent moving forward in a vehicle when setUnconscious true is used on a unit?

#

Blocking actionKeys "carForward" doesn't do stuff. is this just BIS being BIS?

proven crystal
#

does /n work with titletext?

#

for new line?

halcyon crypt
#

probably

proven crystal
#

i dnt understand...

#

why does this not work?

#

[format["bla %1 ! /n %2",_found, _msg], "BLACK IN",10 ] remoteExec ["titleText", _unit];

#

format["Welcome %1. Good hunting!",_found] remoteExec ["hint", _unit]; works

jade abyss
#

@austere granite car movements are buggy. If you get in a car, pressing nothing, wait 1s, then press "CarForward" -> It works. If you get in the car, holding the CarForward button while doing that -> Car moves forward, even when its "blocked".

#

(i tried abit around, "simulating" an ignition.)

proven crystal
#

hm should it be [ [format["bla %1 ! /n %2",_found, _msg], "BLACK IN",10 ] ] remoteExec ["titleText", _unit]; maybe?

#

no... guess not

teal coral
#

arma usually uses <br/> for linebreaks

little eagle
#

only in TEXT

#

in STRING it's usually \n

#

although I think it only works for hint(Silent)

#

(tooltip linebreaks pls)

tough abyss
#

hello

{
    UniformArray = ["CUP_O_TKI_Khet_Partug_02", "CUP_O_TKI_Khet_Partug_04", "CUP_O_TKI_Khet_Partug_03", "CUP_O_TKI_Khet_Partug_02"];
{
        if((side _x) == civilian)then
{
      removeVest _x;
      removeHeadgear _x;
      removeUniform _x;
                _x unassignItem "NVGoggles";
                _x removeItem "NVGoggles";
      _x forceAddUniform (UniformArray select (random(floor(count UniformArray))))
};
} 
foreach allunits;
};```
It randomises the uniform but the unit also sometimes gets no uniforms and stays naked.
What's the problem with it?
proven crystal
#

could be that it only works in cutText

#

at least there it mentins linebreas

little eagle
#

try

#

_x forceAddUniform selectRandom UniformArray;

native hemlock
#

The linebreak shouldn't be the issue with titleText not executing, does it work with just ["Hi", "BLACK IN", 10] remoteExec ["titleText", _unit];?

tough abyss
#
{
    UniformArray = ["CUP_O_TKI_Khet_Partug_02", "CUP_O_TKI_Khet_Partug_04", "CUP_O_TKI_Khet_Partug_03", "CUP_O_TKI_Khet_Partug_02"];
{
        if((side _x) == civilian)then
{
      removeVest _x;
      removeHeadgear _x;
      removeUniform _x;
                _x unassignItem "NVGoggles";
                _x removeItem "NVGoggles";
      _x forceAddUniform selectRandom UniformArray;
};
} 
foreach allunits;
};```
#

like that?

little eagle
#

I think so. The formatting is fucked, so it's hard to read.

native hemlock
#

A little prettier

if(isServer) then
{
    UniformArray = ["CUP_O_TKI_Khet_Partug_02", "CUP_O_TKI_Khet_Partug_04", "CUP_O_TKI_Khet_Partug_03", "CUP_O_TKI_Khet_Partug_02"];
    {
        if ((side _x) == civilian) then
        {
            removeVest _x;
            removeHeadgear _x;
            removeUniform _x;
            _x unassignItem "NVGoggles";
            _x removeItem "NVGoggles";
            _x forceAddUniform selectRandom UniformArray;
        };
    } foreach allunits;
};
#

Are you sure those are all valid uniforms as well?

little eagle
#

lgtm, but UniformArray should be a local variable or a macro

#

yeah and check if these classnames are correct

#

addUniform leaves you naked if the class name doesn't exist

#

(should log error in RPT though)

tough abyss
#

Ok I'll check it now

little eagle
#

It could also be another script overwriting UniformArray and causing a race condition. shouldn't use a global for this

tough abyss
#

Alright, I made it a local variable

#

added a _ before it

little eagle
#

yeah

#

If you use allunits then it won't report corpses

#

idk if you plan on using any in your mission

tough abyss
#

no, only alive units

little eagle
#

but you would have to iterate over
(allUnits + allDeadMen)

#

ok

native hemlock
#

It should be fixed by using selectRandom if those classnames exist. The issue is with _x forceAddUniform (UniformArray select (random(floor(count UniformArray))))

proven crystal
#

whats the diffeence between allUnits and allAlive?

native hemlock
#

You would be trying to select decimal indexes from the array

proven crystal
#

no wait allalive doesnt exist i think im confusing stuff

tough abyss
#

allUnits probably counts only the alive units

native hemlock
#

selectRandom is better, but the correct way would have been floor (random (count UniformArray))

little eagle
#

yeah. It should've been floor random count

#

not random floor count

#

count is always an integer

#

and if the count is 3

#

and you roll 2.6 with random

#

select will attempt to pick the fourth element

#

which does not exist as the count was 3

#

case closed

tough abyss
#

it works great now ๐Ÿ˜ƒ

#

thanks

#

Thanks also for the explanation!

little eagle
#

yw

proven crystal
#

could it be that the thing keeps the loading screen up until that message has been sent?

#

so it sort of doesnt consider the client fully loaded or so?

native hemlock
#

Did you try with just ["Hi", "BLACK IN", 10] remoteExec ["titleText", _unit]; to rule out the linebreaks? Is _unit definitely defined as well?

proven crystal
#

yes i have both messages in the there now. simple and complex. but this time it was a different mistake, as i also just switched from select floor random count to selectRandom

#

so trying again now with the smecode

#

nope not working

tough abyss
#

is there a way to spawn a helicopter on air with a started engine in a script?

little eagle
#

"FLY" flag on createVehicle array

proven crystal
#
    format["Welcome %1. Good hunting!",_found] remoteExec ["hint", _unit];```
#

the hint comes through, the titletext doestnt

tough abyss
#
``` I have this, so it's instead CAN_COLLIDE?
proven crystal
#

cant see an error in the log either

little eagle
#

yea

#

maybe titleText doesn't work with remoteExec? I think it has to have an entry in CfgRemoteExec to work

proven crystal
#

ah dayum... cant they metnion that somewhere

little eagle
#
class CfgRemoteExecCommands {
    class titleText {
    };
};
#

nah , should work

tough abyss
#

do you know how to create a progressbar? Is it hard to do?

#

I know how to work with GUI alittle but couldn't figure out the progressbar thing

little eagle
#

I made one for AGM back in the day, which was ported to ACE

tough abyss
#

Yeah, I know there are alot of progress bars in ACE :p

little eagle
#

it's the same one over and over again

tough abyss
#

Can I take their as an example?

little eagle
#

GPL v2

#

not that anyone will stop you if you use it for yourself and don't release it...

proven crystal
#

illl try cutText and see if that does anything different

little eagle
#

you could be right about the loading screen

#

Maybe the command just doesn't work there

#

or it's overwritten at the end of it by a cutText "" or something like that

proven crystal
#

now i have hint - sleep - titetext - cuttext - hint

#

lets see what comes through

#

interestingly i can see only the last hint

dusk sage
#

What are you running this from?

tough abyss
#

execVM "mission_scripts\civCloths.sqf";
This executing this

{
    _UniformArray = ["CUP_O_TKI_Khet_Partug_02", "CUP_O_TKI_Khet_Partug_04", "CUP_O_TKI_Khet_Partug_03", "CUP_O_TKI_Khet_Partug_02"];
{
        if((side _x) == civilian)then
{
      removeVest _x;
      removeHeadgear _x;
      removeUniform _x;
                _x unassignItem "NVGoggles";
                _x removeItem "NVGoggles";
      _x forceAddUniform selectRandom _UniformArray;
};
} 
foreach allunits;
};```
I added the execution command to the init.sqf file but it doesn't work.
I'm spawning units via scripts since I'm using headless client. So I placed the line right after the spawning part.
proven crystal
#

ok im very sure now, that nothing but hint works

little eagle
#

maybe you loop over allUnits before your script has them created ๐Ÿค”

#

If the spawn script is another execVM

#

they race against each other

tough abyss
#

and the civCloth.sqf wins since it does work but none of the units gets the uniforms?

#

so what can I do

little eagle
#

no. not one of them wins

#

but you apply the clothing to all units

tough abyss
#

is there a way to make the execVM work only after the rest did

little eagle
#

but later create new ones

tough abyss
#

I'm executing the command after the spawn

little eagle
#
_handle = execVM "blah";
waitUntil {scriptDone _handle};

?

tough abyss
#

will it work if I do it this way?
_handle = execVM "mission_scripts\civCloth.sqf";
waitUntil {scriptDone _handle};

little eagle
#

no. you have to wait for the spawn script to be done

#

not this one

tough abyss
#

ohoh ok sry I see

little eagle
#

it won't work if you use spawn or execVM inside that spawn script though

#

as those would also run in parallel

#

yeah, you have to wait for all of these

#

also

tough abyss
#

how :I

#

it's alot

little eagle
#

some inventory commands require the unit to be local

#

if you create them on the HC

#

and do the gear stuff on the server

#

they won't be local to the server, but the HC

#

so stuff like addUniform works

#

but addBackpack doesnt

#

and addWeapon bugs out the whole system

#

how :I

#

You dug yourself into a hole by using the scheduler. ยฏ_(ใƒ„)_/ยฏ

#

welcome to race condition hell

dusk sage
#

Could always just use call ๐Ÿ˜›

tame portal
#

What about addBackpackGlobal

jade abyss
#

Doesn't work all the time, iirc.

#

I remember, that some commands must be executed on the Client, even when they have the suffix "global" to its name. Something was strange there

tough abyss
#

I have a question whether the following script is set up correctly: It is called from the init of a vehicle (script name garagekey.sqf) and it is supposed to be a key to unlock/lock a vehicle ```
0 = this execVM "scripts\garagekey.sqf"

while(true){
if(Authenticated) then {
if(_this lock == 3) then {
this addAction["Unlock Vehicle", {target (_this select 0) setVehicleLock "UNLOCKED"}, "", "", false, true, "", "", 2, false];
}
else{
this addAction["Lock Vehicle", {target (_this select 0) setVehicleLock "LOCKED"}, "", "", false, true, "", "", 2, false];
};
};
};```

#

I'm not sure whether using the while loop is necessary. Maybe the script only fires when people are close? is the _this used correctly? It is supposed to point to the vehicle the script runs on

willow basin
#

Loop is not necessary and you can define your entire if inside the addAction parameters so that the action only displays when the condition is met.

tough abyss
#

this addAction["Unlock Vehicle", {target (_this select 0) setVehicleLock "UNLOCKED"}, "", "", false, true, "", Authenticated, 2, false];?

#

Authenticated is a local boolean

#

You are saying this should do? _this addAction["Unlock Vehicle", {target (_this select 0) setVehicleLock "UNLOCKED"}, "", "", false, true, "", Authenticated && _this lock == 3, 2, false]; _this addAction["Lock Vehicle", {target (_this select 0) setVehicleLock "LOCKED"}, "", "", false, true, "", Authenticated && _this lock != 3, 2, false];

#

I'm not sure whether to use this or _this

buoyant heath
#

_this

tough abyss
#

for all instances or just some?

buoyant heath
#

IIRC _this always works in script and this when in the unit init

tough abyss
#

ah right thanks!

#

is the condition part set up correctly? bool + lockstate Authenticated && _this lock != 3

willow basin
#

_vcl addAction ["Unlock", {(_this select 0) setVehicleLock "UNLOCKED"}, nil, 5, true, true, "", "Authenticated && locked (_this select 0)"]; should do it (not tested)

#

make sure that the variable "Authenticated" is set before.

buoyant heath
#

Won't there be a problem with _vcl... yeah, that

willow basin
#

yea, just noticed xD

buoyant heath
#

I've done that more than I care to admit to.

tough abyss
#

how would I make the unlock of the vehicle global then instead of local?

steep matrix
#

loadUniform/Vest/Backpack is percentage of load vs capacity, yet load seems to be some absolute value

tough abyss
#

@tough abyss according to the BI page it's boolean but can also return 0-3

#

depends on the syntax

steep matrix
tough abyss
#

if I place it in the init of the vehicle (so not through sqf) would it be global?

buoyant heath
#

No. Placing the addAction into the init will ensure everyone can see the action, but will not synchronize the results

tough abyss
#

hmm... then how do I make it sync?

#

unless there is a better way to achieve the main goal: Unit members can unlock locked heavy armoured vehicles once a request from a stranger has been accepeted by them to use the heavy armoured vehicles. If such is not the case, the vehicles should remain locked

#

@willow basin Authenticated is a bool assigned on playerinit

buoyant heath
#

Use remoteExec to run the code on all machines

steep matrix
#

gotta love this...

diag_log["_actualMass != _desiredMass",_actualMass != _desiredMass,_actualMass,_desiredMass,_actualMass isEqualTo _desiredMass];

["_actualMass != _desiredMass",true,8,8,false]
["_actualMass != _desiredMass",true,9.86,9.86,false]
["_actualMass != _desiredMass",true,15.44,15.44,false]
["_actualMass != _desiredMass",true,25.8,25.8,false]
["_actualMass != _desiredMass",true,102.14,102.14,false]
["_actualMass != _desiredMass",true,386.78,386.78,false]
#

just reading those values from config space

        _actualMass = 0;
        _magazinesAmmo = magazinesAmmo _unit;
        {
            _magazinesMass = getNumber (configFile/"CfgMagazines"/(_x select 0)/"mass");
            _actualMass = _actualMass + _magazinesMass;
        } forEach _magazinesAmmo;```

    _desiredMass = 0;
    {
        _magazinesMass = getNumber (configFile/"CfgMagazines"/_x/"mass");
        _desiredMass = _desiredMass + _magazinesMass;
    } forEach _magazinesClassAllLower;```
meager granite
#

Floating point imprecisions something something?

dim owl
#

hey any idea how i could create a dialog when the map is opened ? i tried it but i cant moved the map when the dialog was created :/

meager granite
#

createDisplay on to display where map is?

dim owl
#

never heard from createDisplay...

#

but i cant move the map

little eagle
#

@steep matrix
The factor is in the configs.

class CfgInventoryGlobalVariable {
    maxSoldierLoad = 1000;
};

BI already changed it at least once from 1200 to 1000.

dim owl
#

tried cutRsc doesnt seem to work ๐Ÿ˜ฆ

little eagle
#

This mass cap is bugged though. You can go over it if the backpack etc. allows for it

#

Use createDisplay, Basti

#

The total mass cap is shown as a bar in the inventory ui. Everyone ignores it and it does nothing. It indirectly affects fatigue by shifting load

dim owl
#

i think i just need to set movingEnable = 1; in my dialog ๐Ÿ˜„

little eagle
#

No, the map will always be in front, uunless you create a subdisplay via createDisplay

#

The marker menu works just like that

dim owl
#

@little eagle Would it work like this ?

[]spawn {
    openMap true;
    (findDisplay 12) createDisplay "mapTest";
};
little eagle
#

findDisplay is a bit bugged. the array it reports is only update one frame after a display was created.

#

So you might have to add a sleep 0.01; and pray the game runs not faster than 100 FPS

#

idk if it works. try it

halcyon crypt
#

= 100 fps is an edge case ๐Ÿ˜›

little eagle
#

alternatively
waitUntil {!isNull findDisplay 12};
and then hope the scheduler doesn't screw with you and you end up with two at once thanks to the previous loop still running ๐Ÿ˜›

dim owl
#

cant see the dialog

#

if i create the dialog with cutRsc and with closed map it works. so the dialog is right

little eagle
#

has to be at root level in config

#

cutRsc has to be in CfgInGameUi or something like that

#

check the config

steep matrix
#

converting to mass read from config to string allows correct comparison. still dont get why it fails for some values

#

other float values for mass of other equiipment work just fine

little eagle
#

probably floats being floats

dim owl
#

okay i got it work so the dialog is created. but now i cant press any button

[]spawn { 
 openMap true; 
 waitUntil {!isNull findDisplay 12}; 
 0 cutRsc ["testHud","PLAIN"]; 
};

in testHud is movingEnable = 1;

halcyon crypt
#

@steep matrix if you're trying to get the (PhysX) mass, it's not defined in configs (configFile anyway) ๐Ÿ˜ฆ

#

@dim owl I don't think you can interact with (cut)Rsc's, that's what dialogs are for

dim owl
#

tried it also with

openMap true;
waitUntil {!isNull findDisplay 12};
findDisplay 12 createDisplay "testHud2";

but then i cant move the map and with

openMap true;
waitUntil {!isNull findDisplay 12};
findDisplay 46 createDisplay "testHud2";

i can move the map but its buggy

halcyon crypt
#

did you try createDialog?

#

ALiVE's "advanced markers" uses createDialog

#

but no clue if you can move the map around when it's active

dim owl
#

no i cant when i use createDialog

halcyon crypt
#

what are you trying to build?

dim owl
#

map filter

#

so you can choose which marker you want to see

halcyon crypt
#

mission or mod?

dim owl
#

mission

halcyon crypt
#

hmmmmmm

#

I guess there a couple of options

dim owl
#

hhmm okay

halcyon crypt
#
  1. add a full screen control to your dialog and track mouse dragging on it, then use https://community.bistudio.com/wiki/ctrlMapAnimAdd to do map changes
  2. use cutRsc to display the current state of your options and when the player hovers over it (if it's detectable, it probably is though) overlay it with createDialog
#

maybe there are more but that's what I can think of ๐Ÿ˜›

dim owl
#

hmm okay.

halcyon crypt
steep matrix
#

@halcyon crypt not its about weight (mass in configs)

dim owl
#

@halcyon crypt Thank you! ctrlcreate work ๐Ÿ˜„

halcyon crypt
#

๐Ÿ˜ƒ

#

@steep matrix as in inventory weight?

dim owl
#

how would i make a eventhandler if a checkbox is checked or unchecked ? (via script)

halcyon crypt
dim owl
#

thx ^^

dim owl
#

one question ๐Ÿ˜ƒ why does this eventhandler not work ?

_mycontrol ctrlAddEventHandler ["onChecked",{systemchat str _this}];

no systemchat is showing ๐Ÿ˜„

halcyon crypt
#

I'd try with diag_log instead

dim owl
#
ctrlAddEventHandler ["onChecked",{diag_log format ["%1",_this];}];

?

#

nothing happend

#

@halcyon crypt

buoyant heath
#

What is _mycontrol's value?

dim owl
#

wait i think i found the error. one second...

#

Control#1010 is the value

#

didnt found the error xD

halcyon crypt
#

where are you attaching the EH?

#

I think it should be done in the init UI event

dim owl
#
_cb_felder = _display ctrlCreate ["RscCheckbox",1010];
_cb_felder ctrlSetPosition [0.0978125 * safezoneW + safezoneX, 0.434 * safezoneH + safezoneY, 0.0154688 * safezoneW, 0.022 * safezoneH];
_cb_felder ctrlCommit 0;
_cb_felder ctrlSetChecked (profileNameSpace getVariable ["filter_felder",false]);
_cb_felder ctrlAddEventHandler ["onCheckedChanged",{diag_log format ["Checkbox checked: %1",_this]}];
#

_display is findDisplay 12

halcyon crypt
#

lose the "on"

#

"CheckedChanged" instead of "OnCheckedChanged"

#

when doing EHs by script anyway

dim owl
#

okay thanks ๐Ÿ˜„ it works !

little eagle
#

When using the event names listed below with the ctrlAddEventHandler, ctrlSetEventHandler, displayAddEventHandler or displaySetEventHandler commands, the prefix "on" in the name must be removed. (e.g. 'ButtonDown' instead of 'onButtonDown')

#

big fat exclamation mark ๐Ÿ˜ƒ

dim owl
#

@little eagle But why is the SliderPosChanged EVH not working ?

_slider_size ctrlAddEventHandler ["SliderPosChanged ","['size',_this select 1]execVM 'mapfilter.sqf'"];
little eagle
#

idk. _slider_size is not a slider?

#

also, execVM in an event handler that can fire every frame ๐Ÿ˜

dim owl
#

its a RscSlider

little eagle
#

try putting your code in {} instead of ""

dim owl
#

tried

_slider_size ctrlAddEventHandler ["SliderPosChanged ",{hint format ["%1",_this select 1]}];

for testing but nothing happens

little eagle
#

omg now I see it

#

"SliderPosChanged "

#

whitespace

#

"SliderPosChanged"

dim owl
#

omg

#

๐Ÿคฆ

little eagle
#

you'd think the game would print RPT warnings if you try to add events that don't exist ๐Ÿค”

dim owl
#

๐Ÿ˜„

thin pine
#

Here's a question I've had since 2012. Does the 'db' you see frequently in description.ext CfgSounds actually mean something? Does it stand for the current effects volume? I never actually tested this but I wonder..

tough abyss
#

All vehicles have the option "Rearm on 'Vehicle name'" if they have mags and stuff on their gear?

#

This break my vehicle/box gear protection done with Event Handlers...

#

๐Ÿ˜ฆ

little eagle
#

you can turn it off with a config

#

I wish there was a add version of this command, so it could be used outside of missions

tough abyss
#

Eye Mazing! A new hope! I'm trying to avoid go moddy.

#

hy Guys how should i Start with Scripting in Arma? is there some good Sources of Knowlegde?

#

@little eagle thanks for the new hope!

tough abyss
#

@little eagle thanks, im not completly new to Scripting, i worked with Lua, Python and C befor i know what the Basics are like Strings, Variables (global, local) etc etc.

#

but i see that i have a hard time getting an understanding on what the Syntaxes are

little eagle
#

but i see that i have a hard time getting an understanding on what the Syntaxes are

example?

tough abyss
#

The overall Syntax of SQF and the Shaining of the Scripts

#

like Calling something when something else is happening

#

then CPP files and there part in the Mod + Pre and post init

little eagle
#

The overall Syntax of SQF and the Shaining of the Scripts
do you know what nullary, unary and binary commands are?

tough abyss
#

not Exactly

#

i think i saw somethign befor about Binary commands but not sure

little eagle
#

player <- nullary command
vehicle _unit <- unary
_unit addWeapon "arifle_MX_F"<- binary

halcyon crypt
#

second example could be better @little eagle ๐Ÿ˜›

#

oh typo probably

tough abyss
#

@little eagle i will need to dig in Arma 3 files to block this default action menu?

#

When i look at a Script i Understand what is Happening and what iut dous but like i said i dont understand where to start and how i Chain everything

little eagle
#

the unary and nullary commands are evaluated from right to left.
the binary commands have lower priority, so the other ones are evaluated first
exceptions are the usual math rules. * before - and the usualy stuff with min and max

tough abyss
#

Normally you woudl have like [Serverinit > PlayerConnect > PlayerInit] but i dont really get the Method on how to start on that.

little eagle
#

i will need to dig in Arma 3 files to block this default action menu?
maybe. but you can use it with scripting alone. Idk what the action name is. Try logging it

tough abyss
#

Thanks a lot.

#

My over all comment: i dont want Efusion :P

#

ya and that is what the Pre and Postinit would be?

#

from what i know Preinit should be finished befor Postinit is doing something.

#

What would you recommend where i could start on? to get an understanding of Initialising a Mod and doing stuff?

halcyon crypt
#

start with init.sqf and "grow" from there

#

with missions anyway

tough abyss
#

What about the config.cpp?

#

i dont really want to do Mission stuff itself more like Arma3 life, in the Mod Direction

little eagle
#

config.cpp just sits there. there is no execution order for that

#

If you want to make missions, then you can't do anything with .cpp files

#

you have the description.ext as config and very few configs from .cpp are supported there

#

like CfgSounds

#

But not CfgVehicles or CfgWeapons

#

check the wiki. it's all there...

halcyon crypt
#

he wants to do mods

little eagle
#

doesn't sound like it

halcyon crypt
#

[5:44 PM] Zuck3rFr3i: i dont really want to do Mission stuff itself more like Arma3 life, in the Mod Direction

little eagle
#

Life is a mission, right?

halcyon crypt
#

I think it's a mod

#

no clue really

little eagle
#

ยฏ_(ใƒ„)_/ยฏ

#

They call it mod, but it's a mission

tough abyss
#

Exile for example

#

because everything that i would want to script would go on a Exile server

halcyon crypt
#

well, like @little eagle said, the wiki is your best friend

#

or just unpack some mods and check what they do I guess

#

going from level 0 to level 10 won't happen in a day

tough abyss
#

ya i did, i also checked the Wiki but lets say, i would want to create a system that allowes players to Completely Disassemble a Engine, would that be a Mod or a Mission?

#

i Know that like i said i have Programming experience in Lua, Python etc, i know what Booleans are, Strings, ints, floats, Eventhandlers, and allround Mathematiks

little eagle
#

There is no magic guide to Arma modding. And if someone made one, I'm pretty sure it's bad.
Everyone that knows stuff about this has learned it the hard way by trial and error and by putting a lot of time into it.

tough abyss
#

only thing i need to know, lets say, i would want to create a system that allowes players to Completely Disassemble a Engine, would that be a Mod or a Mission?

little eagle
#

ya i did, i also checked the Wiki but lets say, i would want to create a system that allowes players to Completely Disassemble a Engine, would that be a Mod or a Mission?
that could be both

tough abyss
#

so it dousnt matter if i create Like 100 Missions and let them run?

little eagle
#

you're more limited in what you can do with a mission generally

#

you can only run one mission at a time

tough abyss
#

so i would need to get started on CPP files to create Mods?

little eagle
#

If you want a mod, then you need at least one config.cpp file, yes

tough abyss
#

alright got it, thank you all for the Help.

dim owl
#

how could i return itemstest and itemtest2 as array together ? try it with this

class CfgTest {
    itemstest[]= {"test1","test2","test3","test4"};
    itemtest2[]= {"test1_1","test2_1","test3_1","test4_1"};
};
("true" configClasses (missionConfigFile >> "CfgTest"));

but that does not seem to work

dusk sage
#

It's a config

buoyant heath
#

Ah, my bad.

dim owl
#

hmmm

#

maybe i just make it manually and not this way

thin pine
#

Do you want to return all arrays ever to be present in CfgTest?

dim owl
#

yeah so it returns both arrays

thin pine
#

right

#

Probably not the most efficient way, and not guaranteed to work as I kinda took it from a script I wrote a few weeks ago but:

#
private _entriesCount = (count _config) - 1;
private _array =  [];
for "_i" from 0 to _entriesCount do 
{
    _array append (getArray (_config select _i));
};
_array```
#

how do you syntax in Discord btw?

little eagle
#

append ?

thin pine
#

append's a good one actually mb

#

my solution wouldn'tve worked

little eagle
#

The variable is named _entriesCount , but it's actually count minus one ๐Ÿ˜›

thin pine
#

I code deceivingly ๐Ÿ˜ˆ

tough abyss
#

@little eagle all fixed with this small code:

#
    _object = _this select 0;
    _canActOver = _object call BRPVP_checkAccess;
    if !(_canActOver) then {
        ["You can't act over this object...",3,10,677] call BRPVP_hint;
    };
    !_canActOver
"];```
#

Uhul!

little eagle
#

I like the syntax like this:

private _array = [];
{
    _array append getArray _x;
} forEach configProperties [missionConfigFile >> "CfgTest", "isArray _x"];
_array
#

@tough abyss I think you need a check if the take-magazines-action was chosen.

#

also you have to escape the quote marks

dim owl
#

thank you @little eagle and @thin pine

tough abyss
#

@little eagle this action name can be different for mod vehicles like CUP vehicles?

little eagle
#

No, I think it's whatever the pick up action is in CfgActions

#
class CfgActions {
    class None {
        priority = 0;
        show = 1;
        showWindow = 0;
        hideOnUse = 1;
        shortcut = "";
        text = "";
        textDefault = "";
        textSimple = "";
    };
    class Rearm: None {
        text = "Rearm at %%1";
        showWindow = 1;
        priority = 5.1;
        textDefault = "<img image='\A3\ui_f\data\igui\cfg\actions\reammo_ca.paa' size='1.8' shadow=2 />";
    };
};
#

should be "Rearm"

#

"Rearm at %%1"
this is the one you mean, right?

tough abyss
#

Yes, the name is dinamic

#

ah, i see

little eagle
#

it's not dynamic

#

the actions are enums in the engine. you can't have any more than what are hard coded

#

well except for addAction, which are named "USER_XYZ" or something like that

tough abyss
#

This UIEH is amazing, and its is from the very old days!

little eagle
#

it sucked before KK added all these params in _this

#

it's only usable in A3 really

#

And the function is only a setter. no mod compatibility at all

#

I'd make a wrapper for CBA, but having that would break all the missions that use it bare

#

So not worth it

tough abyss
#

Saaad...

#

So it's not recomended to use it?

little eagle
#

I wouldn't recommend it in a mod. You'd overwrite or be overwritten by other mods / missions

#

For a mod I would just disable the action

#

it's not like anyone uses it anyway

#

I had to disable it once for ACE

#

because it bugged out our items

#

to have ACE items be shown in the Arsenal

#

they have to be minedetectors with 0 detection range

#

long story

#

but the mine detector was broken

#

and it was added as a secondary weapon instead when using "Pick up"

#

ok it wasn't "Rearm at", but a similar action

#
Bohemia Interactive Forums

Page 57 of 58 - Scripting Discussion (dev branch) - posted in ARMA 3 - DEVELOPMENT BRANCH: Wrong? Wrong it was removed? I dont think so. Wrong it was duplicating functionality? This is why it was removed. You said: >playerControlled was added and removed because it was duplicating existing functionality. If I remember correctly you could get the same results with cameraOn. But the changelog says: >Arma 3 1.24: New command playerControlled (like the playe...

#

If you want to disable the action, and can afford to make it a mod

#
class CfgActions {
    class None;
    class Rearm: None {
        show = 0;
    };
};
#

this will remove it essentially

#

not sure if AI can still use it. no idea

tough abyss
#

This is a lot better to do, but i just come from mod version of BRPVP to mission version due to make things simple.

#

People was having trouble to activate the mod.

#

(now they have trouble to deactivate others mods.... :P)

little eagle
#

I wouldn't recommend it in a mod. You'd overwrite or be overwritten by other mods / missions
For a mod I would just disable the action

#

you have to keep this in mind

#

that's all

#

someday they'll make the add version

#

or not

tough abyss
#

@little eagle i will clain BRPVP not to be compatible with other mods unless i make those basic checks.

#

And necessary workarrounds.

little eagle
#

I don't think there is a way to work around this

tough abyss
#

Those two functions return true or false? BRPVP_func1 = {if (random 1 < 0.5) then {true} else {false};}; BRPVP_func1 = {if (random 1 < 0.5) then {true} else {false}};
What differs then are the ";".

#

@little eagle but i can make my players/server admins aware of the side effects

#

or even turn of it in my side

little eagle
#

if (random 1 < 0.5) then {true} else {false};

#

there is no point in this construct

#

might as well be
random 1 < 0.5

#

the last ; is optional at the end of a scope

#

Some leave it out to indicate a return value, but it's not strictly needed.

tough abyss
#

but this is not the question

#

the question is if i need to use ; or not ๐Ÿ˜„

little eagle
#

the last ; is optional at the end of a scope
Some leave it out to indicate a return value, but it's not strictly needed.

tough abyss
#

they differ from a ";"

little eagle
#

I wrote the answer

tough abyss
#

i see

#

Sorry

#

I noticed sometimes i use it, other times not. Small shock.

#

Now everything explained. Thanks a lot.

little eagle
#

check out this example:

#
my_fnc_addToArray = {
    params ["_array", "_value"];

    if (_value in _array) exitWith {};
    _array set [count _array, _value];
};



my_fnc_addToArray = {
    params ["_array", "_value"];

    _array pushBackUnique _value
};
#

the first one has no return value. the last statement is ended with a ;

#

the second one reports the new array size. it has no ; at the end of it's scope

tough abyss
#

second no return too

#

ah... ok

little eagle
#

yes it has

#

pushBackUnique reports the new position (or -1 if it's already in)

#

it's not needed this way, but that's what some do

tough abyss
#

This is ok too:

#
    params ["_array", "_value"];

    _array pushBackUnique _value;
};```
#

Wait, it will not return value?

little eagle
#

it will

tough abyss
#

ah... ok.

little eagle
#

it's just a convention for readability

tough abyss
#

understood.

#

Thanks.

little eagle
#

since SQF has no return command (bar breakOut constructs)

#

it just returns whatever the last thing in it's previous scope was

tough abyss
#

waitUntil {condition;};

#

works so

little eagle
#

yes

tough abyss
#

Not sure where i readed this ";" could cause problem... not in the wiki (or it was updated).

little eagle
#

it won't cause problems

#

it just looks a bit weird as it's not at the end of the line in that case

tough abyss
#

Can i use Regex Replace in Notepad ++?

#

I need to round numbers in a array of numbers, 35000 elements (numbers) on the SQF file.

#

This to make the mission file smaller

#

Since i have 12.3563453453 but 12.35 or 12.36 is enough

#

Just asking... if not i will make Arma 3 do it.

#

i was able to find .356345(...) but not change it

split coral
dusk sage
#

@tough abyss You can yeh, there is an option to tick

tough abyss
#
private ["_reserved_units"];

waitUntil {!isNull player};
waitUntil {(vehicle player) == player};

// Variable Name of the Player Character to be restricted. //
_reserved_units = [xxxx];


if ((player in _reserved_units) && !(Authenticated)) then 
{
    [servercommand password] serverCommand format ["#kick %1",name player];
}; ```
#

Why does it not kick someone off the server?

#

do I need to use #exec [servercommand password] serverCommand format ["#kick %1",name player]; ?

little eagle
#

serverCommand has to be executed on a machine that has admin rights

#

or the server if you use the alternative syntax and a password that is written in the server.cfg

tough abyss
#

well main thing I need it to do is kick someone from a script :/

#

How would you suggest I do that?

little eagle
#

{findDisplay 46 closeDisplay 0} remoteExec ["call", _unit];

#

or just:
findDisplay 46 closeDisplay 0;
if the script already runs on the local machine

tough abyss
#

does that kick people off the server or to the lobby?

little eagle
#

lobby

tough abyss
#

hm what about off the server?

little eagle
#

idk. I don't think something like that exists

#

I can crash the game if you want that, haha

tough abyss
#

hahaha that's not necessary

#

just kicking them clean off the server

little eagle
#

hmmm.

tough abyss
#

I have infistar running, so I could give them a public variable that is in the array of badvariables and have that kick them off

#

but rather not depend on it..

little eagle
#

well, how does that kick them?

tough abyss
#

something like this maybe? [ _target, "fnc_forceDisconnect", _target, false] spawn BIS_fnc_MP;

little eagle
#

it's just a script, you could copy their method

#

what is fnc_forceDisconnect ?

#

you could use that line too

tough abyss
#

hm found in ArmA 2

#

apparently not in ArmA 3

little eagle
#

fnc_forceDisconnect = { sendAUMessage [[netId _this], "ConnectTo: 127.0.0.1"]; };

#

this is what google found

#

But I'm pretty sure sendAUMessage is scraped or not implemented

tough abyss
#

probably. The problem I'm trying to get rid of here is people using a locked slot (e.g Raptor Team Leader [ 160th Locked ]) but they ignore it and think they are entitled to use it. However it kills them and puts them back into the lobby, however they just join in it again. This causes a huge pile of bodies inside the spawn area...

#

it's really frustrating when keeping some order on the server

paper rain
#

Perhaps instead, you could use a titleText to block their screen with a "This slot is locked" message?

tough abyss
#

but they'd still be in there

#

I'm trying to give them a message and then kick them off the server as people just ignore the warnings

paper rain
tough abyss
#

I was thinking a local sidechat message actualy

#

yeah that's the problem

#

the check is local

#

wouldn't know how to make that serverside run constantly

#

can I use your code in a local script?

little eagle
#

nah, on the machine with admin access

#

not sure about the alternative syntax though

#

Idk. To me it sounds like you'd want to kick them into the lobby if they chose the wrong slot. that way they can at least choose a different one

tough abyss
#

not in this case. I've had too many people just spamming the slot to join

#

20 bodies in the spawn is too much

little eagle
#

I think you're tackling the wrong problem

tough abyss
#

I've used the soft approach for too long

little eagle
#

why not delete the corpses?

tough abyss
#

it does that after a few minutes, but the player will just keep joining and joining and the script will keep killing him and sending him back

#

like he thinks he can break it after a few tries

little eagle
#

Sounds like someone really dumb or really bored

tough abyss
#

actually looking for something that prevents them for spamming the slot

little eagle
#

one day I'll hook into the lobby ui

#

but it will probably require a mod

#

We already took over the main menu in ACE. It should be possible

#

there are no ui threads

meager granite
#

Wasn't onEachFrame running one more frame when you exit into the lobby?

little eagle
#

I have ideas, no worries ๐Ÿ˜ˆ

#

it will be ugly

meager granite
#

Go hardcode, script your own lobby

tough abyss
#

lol

little eagle
#

well, that should solve it

meager granite
#

Yeah, will use skipLobby and everything handled by the mission scripts

#

Apex campaign uses exactly that

#

And that's why skipLobby was made

tough abyss
#

okay so I've a mean way to deal with it

meager granite
#

Actually, working on same thing for OA as well (lobby is filled with dummy slots though)

tough abyss
#

Infistar scans on bad variables. Added one to the list called slot_spam. If someone joins a locked slot, I code slot_spam = true; publicVariable "slot_spam";

#

That should get them kicked off

#

@tough abyss will above code assign slot_spam to only the player or every player on the server?

meager granite
#

Just do everything through server and you'll be fine

#

Ask server, whatever pvar gets there first gets the slot

tough abyss
#

woops

#

thanks

#

almost risked a kick on the complete server population

#

because with 30-35 players on the server I can't check everytime who's joining a locked slot and ban them

#

is it possible to run the check serverside instead of local?

#

running that in initserver?

#

ah right

#

yeah I'm looking for something that works without the badvars list, something I can implement on missions without Infistar

#

For now the screen just goes black, their input is disabled and everyone gets a message that the player joined the locked slot and a request to admins to ban him

#

@dusk sage @split coral thanks a lot.

tough abyss
#

@meager granite this nice thing is for what mod/mission?

#

Also you did your own object ocllusion?

#

Arma objects oclusion dont work with user spawned objects?

#

@tough abyss is it possible to forward a name to the server so it can be used in a script there to kick a player?

noble juniper
#

of cause

#

@tough abyss but, sorry, i wasn't asked, and i don't know the circumstances , depending on those it may not be possible.

tough abyss
#

no problem man, any help is most welcome

#

too bad though

noble juniper
#

is it in an sqf script local to the client getting kicked ?

#

is the kick demanded through sqf code ?

tough abyss
#

Basically once a player joins the server it is assigned true or false for a boolean (initplayer). If they join a certain player slot that is locked, I want some script to warn them and then kick them off the server, however this script seems to be needed to run serverside to function with the server commands

dusk sage
#

You can use endMission locally

#

Without needing to pass to server

#

But if you insist on doing that, you need to use remoteExec

tough abyss
#

true but players will just rejoin in the locked slot

dusk sage
#

And get returned again?

tough abyss
#

yes

#

it causes a pile of bodies in spawn

dusk sage
#

It won't make a difference if you kick via server or endMission locally

#

Unless something funky is happening

tough abyss
#

endMission allows them to rejoin, doesn't it?

noble juniper
#

can you change something on the basic problem ?

#

that there are slots that some arent allowed to use ?

languid forge
#

Yo so when i try and put down the A3L prison gate, the big on. Then it says, when im on my server "Plant C4 Charge", and there is 5 cops online, and do have all the stuff to do it, but why does it not work?

tough abyss
#

it's literally 'Raptor XXXXX (e.g grenadier etc) [ 160th LOCKED SLOT ]

#

Can't tell them any more

noble juniper
#

so, its a mil sim, with special people and abiletys.

tough abyss
#

yes

noble juniper
#

interesting.

tough abyss
#

it's even in the server name

#

but people ususally get on it through quick play

noble juniper
#

is it public ?

tough abyss
#

yeah

#

because there are a lot of people who want a public milsim server

noble juniper
#

ok, so its not eventbased, and you want perk slots for vip.

paper rain
#

You can create a function that kicks the calling player, then use execRemote to call from the client on the reserved slot check

tough abyss
#

no it's basically just reserved slots for unit operators

noble juniper
#

how about i make you call that func ?

tough abyss
#

would be awesome

noble juniper
#

i could kick who ever i like .

tough abyss
#

I'm still learning a lot on the ArmA 3 scripting

#

yeah but we have 30-40 people on the server so logging in as admin and finding the names and then kick takes too long

paper rain
#

You can disallow that in the description.ext RageBone

noble juniper
#

considering remoteExec lockdown, that could be ok, but ho do you get the person to kick ?

#

i cant remember magic vars that tell you who remote called that

#

well

paper rain
#

Something like [player] remoteExec ["my_fnc_kickMe", 2]

serverCommand format ["#kick %1",name _player];```
noble juniper
#

@tough abyss you can do something against the bodies.

#

missionEH handleDC

tough abyss
#

it's not the bodies I'm against. They are taking up slots for members

noble juniper
#

you get the Unit, you can delete it there

tough abyss
#

as they keep spamming it

#

my members can't join

noble juniper
#

so kicking is the only option

tough abyss
#

basically

#

don't want to ban them just yet ๐Ÿ˜›

noble juniper
#

how big is backend, in terms of extensions and persistency ?

tough abyss
#

?

noble juniper
#

extDB ?

tough abyss
#

nope

#

the server runs for 4-6 hours, restarts

noble juniper
#

well, extDB has RCON capabiletys, and you could cause a kick through that

#

is a DB Behind it ?

#

probably not

tough abyss
#

no, nothing connected to it

noble juniper
#

fuck, im too used to my shit ..

#

be right back

paper rain
tough abyss
#

I have no experience setting up FNCs

paper rain
noble juniper
#

onPlayerConnected EH

#

thats the solution

#

you get the Unit, the owner ID

little eagle
#

OPC reports no unit

noble juniper
#

the Name of the player, and its serverseide

#

im prety sure it does.

little eagle
#

nope

noble juniper
#

Oh jea, owner is that what i use

paper rain
#

initPlayerServer.sqf gets passed the player object

noble juniper
#

oh jea. you are right +

tough abyss
#

which file goes first, initplayerserver or initplayerlocal?

paper rain
#

the "same time" one on server, one on client

noble juniper
#

problem: its local in the mission

tough abyss
#
_infoSquad = _infoArray select 0;
_squad = _infoSquad select 1;
_infoName = _infoArray select 1;
_name = _infoName select 1; 
_email = _infoSquad select 2;

//--------------------- Reserved Slots
Authenticated = false;
if (_email == "XXXXXX") then {
Authenticated = true;
};``` would that work in initplayerserver?
#

otherwise Authenticated is not assigned before the script is run

noble juniper
#

Problem: Auth var global

tough abyss
#

fair enough..

little eagle
#

which file goes first, initplayerserver or initplayerlocal?
undefined. they are two scheduled scripts that run against each other and even are on different machines

paper rain
#

initPlayerServer.sqf would look something like:

params ["_player", "_didJIP"];

auth_check = {
/*CODE*/
}

private _auth_result = [] call auth_check;

if (_auth_result ) then {
    serverCommand format ["#kick %1",name _player];
};
tough abyss
#

the full code into the if?

noble juniper
#

ok

#

so it makes sense to have the auth check and code Serverside

paper rain
#

well, save it into a private variable, then put that in the if

#

edited my example

tough abyss
#

_auth_result a bool?

paper rain
#

yeah

#

in the example, a true result would kick the player

#

so you may want to ! it

tough abyss
#

auth_check = (_email == "XXXXX")?

#

or using authenticated in it?

paper rain
#
    _infoArray = squadParams player;    
    _infoSquad = _infoArray select 0;
    _squad = _infoSquad select 1;
    _infoName = _infoArray select 1;
    _name = _infoName select 1; 
    _email = _infoSquad select 2;

    //--------------------- Reserved Slots
    
    private _authenticated = false;
    if (_email == "XXXXXX") then {
        _authenticated = true;
    };
    _authenticated
};```
tough abyss
#

ah right!

#

auth_check = {
_infoArray = squadParams _player;    
    _infoSquad = _infoArray select 0;
    _squad = _infoSquad select 1;
    _infoName = _infoArray select 1;
    _name = _infoName select 1; 
    _email = _infoSquad select 2;

    //--------------------- Reserved Slots
    
    private _authenticated = false;
    if (_email == "XXXXXX") then {
        _authenticated = true;
    };
    _authenticated
};


private _auth_result = [] call auth_check;

waitUntil {!isNull player};
waitUntil {(vehicle player) == player};

// Variable Name of the Player Character to be restricted. //
_reserved_units = [s22,s40,s44,s42,s41,s46,s43,s45,s47,s32,s34,s38,s39,s35,s37,s36,s33,s3,s4,s2,s5,s6];


if (!_auth_result && (player in _reserved_units)) then {
    serverCommand format ["#kick %1",name _player];
} else {
_GlobalHint = format["<t align='center' size='2.2' color='#FF0000'>%1<br/></t><t size='1.4' color='#33CCFF'>%2</t><br/>has joined the server. To get involved, visit TS.JSFAR.COM</t><br/>",_squad,_name];
[_GlobalHint] remoteExec ["AW_fnc_globalHint",0,false];
};```
paper rain
#

remove line 3

tough abyss
#

I saw a couple of dancing videos in arma 3? How does it work? It's animation activated with scripts?

paper rain
#

line 4, change to _player

tough abyss
#

corrected^?

noble juniper
#

@tough abyss yes, normaly Life servers with some scripts for that

paper rain
#

Looks good to me. Now all that's left is to try it.

#

I assume the real code has a series of if (_emails ?

tough abyss
#

Can I find the animations in the animations viewer in the debug window?
Are they located there?

#

Not sure I can combine it like this? ```params ["_player", "_didJIP"];

auth_check = {
_infoArray = squadParams _player;
_infoSquad = _infoArray select 0;
_squad = _infoSquad select 1;
_infoName = _infoArray select 1;
_name = _infoName select 1;
_email = _infoSquad select 2;

//--------------------- Reserved Slots

private _authenticated = false;
if (_email == "XXXXXX") then {
    _authenticated = true;
};
_authenticated

};

private ["_reserved_units_admin", "_reserved_uids_admin", "_uid_admin"];
private _auth_result = [] call auth_check;

waitUntil {!isNull player};
waitUntil {(vehicle player) == player};
waitUntil {(getPlayerUID player) != ""};
_uid_admin = getPlayerUID player;

_reserved_uids_admin = ["some UID"/* Me */];

// Variable Name of the Player Character to be restricted. //
_reserved_units = [s22,s40,s44,s42,s41,s46,s43,s45,s47,s32,s34,s38,s39,s35,s37,s36,s33,s3,s4,s2,s5,s6];
_reserved_units_admin = [s1];

if (!_auth_result && (player in _reserved_units) or (player in _reserved_units_admin)&& !(_uid_admin in _reserved_uids_admin)) then {
hqSideChat = format ["Player '%1' tried using a locked slot! He will be kicked off this server.", name player];
[hqSideChat] remoteExec ["AW_fnc_globalSideChat",0,false];
serverCommand format ["#kick %1",name _player];
} else {
_GlobalHint = format["<t align='center' size='2.2' color='#FF0000'>%1<br/></t><t size='1.4' color='#33CCFF'>%2</t><br/>has joined the server. To get involved, visit TS.JSFAR.COM</t><br/>",_squad,_name];
[_GlobalHint] remoteExec ["AW_fnc_globalHint",0,false];
};```

paper rain
#

what script file is this?

tough abyss
#

init

#

initplayerserver*

paper rain
#

FYI player will always be null on the server, where this script runs

#

the player object is passed to the script and we're capturing it using _player