Depressed-66022b82dea61fee 0 Posted June 16, 2021 I've been trying my best to get a script to work which allows a server to detect players within a specific vehicle. Here are the versions I've tested. They do not work on a dedicated server though. 1: {_x in object} count (playableUnits) == {alive _x} count (playableUnits); 2: _allPlayers = call BIS_fnc_listPlayers; {_x in object} count (_allPlayers) == {alive _x} count (_allPlayers); 3: {_x in object} count (allPlayers) == {alive _x} count (allPlayers); 4: ( {alive _x && !(_x in object)} count allPlayers ) == 0 I'm terrible at scripting but I try my best to understand. If you have a fix that is great, though I'd love to know how I messed up and how to improve for the future. :) Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 16, 2021 you have to describe a lot more. what vehicle are we talking 'bout? placed with eden or spawned by script. what do you want have? the number of players which are in that vehicle? An array with all player objects of players in the vehicle? just knowing if all connected players are in that vbehicle... so many quesdtions. what do you want to do? 1 Share this post Link to post Share on other sites
Depressed-66022b82dea61fee 0 Posted June 16, 2021 (edited) My fault, I'll go into greater detail. I have an object placed within eden, named aavc7a1 under variable name (the literal name of the car) for simplicity. Then I have a trigger with the condition of the script i.e "{_x in aavc7a1} count (playableUnits) == {alive _x} count (playableUnits);" the trigger is set to operate on the server only, and has the activation, mapa = true; which connects to an objective. edit: I want the server to check for any players within the vehicle. Meaning the second a single player enters the vehicle the condition of the trigger is met Edited June 16, 2021 by Depressed-66022b82dea61fee missing information Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 16, 2021 fine, now what do you want to do? do you want to switch your mapa to true if all playable units are inside the car and those car should be inside trigger area? do your playable units have to be alive or just inside the car even as dead body? Edit: didnt see your edit open question is, the vehicle is inside trigger area already? a human player (or AI??) has just to get in that vehicle? Share this post Link to post Share on other sites
Depressed-66022b82dea61fee 0 Posted June 16, 2021 First, I wanted to thank you for helping. Second, I want mapa to be true if one player is in the car even if they are dead. I also want mapa to be true if there are two or three or four etc. players in the car. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 16, 2021 this && allPlayers findIf {_x in crew aavc7a1} > -1 tested and working click for biki entry: this && allPlayers findIf _x in crew 2 Share this post Link to post Share on other sites
Depressed-66022b82dea61fee 0 Posted June 16, 2021 Thank you! also, thank you for including the wiki links so I can learn more! 🙂 Share this post Link to post Share on other sites
pierremgi 4853 Posted June 16, 2021 Why this && ... ? allPlayers findIf {_x in crew aavc7a1} > -1 is enough. except if you have different players in different sides and you are using a preset condition like BLUFOR present. this refers to preset condition only. But you'll miss dead case in this context (dead are not BLUFOR/OPFOR/INDEPENDENT anymore but civilian, so this && allPlayers findIf... is different from simple allPlayers findIf... in this case). 1 Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 16, 2021 Its just his choice to choose a preset or not. Why should I decide to not choose one? Share this post Link to post Share on other sites
pierremgi 4853 Posted June 16, 2021 2 minutes ago, sarogahtyp said: Its just his choice to choose a preset or not. Why should I decide to not choose one? I didn't read any mention about any preset choice... So, there is no reason to add something useless in the context. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted June 16, 2021 @pierremgi Either you're trying to annoy me a bit or you're harping on something completely irrelevant. What's wrong with you today? You're not usually like this. Just because he didn't write anything about a preset doesn't mean he won't use one. The other things had to be elicited from him first too. Anyway, it doesn't matter if there's a this && or not. 2 Share this post Link to post Share on other sites
pierremgi 4853 Posted June 16, 2021 On 6/16/2021 at 8:37 PM, sarogahtyp said: @pierremgi Either you're trying to annoy me a bit or you're harping on something completely irrelevant. As we are on public forum and not in a personal debate for what you think, what you feel or what I remark, I just confirm: this &&... in a trigger condition without any preset condition (like BLUFOR present) is totally useless because this always returns FALSE here. Furthermore, there is also a possible confusion for people who would like using thisList in condition or on activation fields... thisList always returns [] without preset condition. On the other hand, with preset condition (BLUFOR PRESENT, DETECTED BY OPFOR....) , this has sense, then: this && allPlayers select {...} is different from simple: allPlayers select {...} 1 2 Share this post Link to post Share on other sites