OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: ryankaplan on 23 Nov 2004, 00:13:13

Title: "player" in mp?
Post by: ryankaplan on 23 Nov 2004, 00:13:13
is there a command for player in mp? in the command reference it says this value is diffrent for each computer, naturally, but i need all the list of players. so, if a dead body is 300 meters (or whatever measurement ofp uses) away from all players, it gets deleted.

i sp it would be

?(player distance _deadunit > 300) : deletevehicle _deadunit

how can i do this in mp? thanks to people who will help.
Title: Re:"player" in mp?
Post by: CrashDome on 23 Nov 2004, 04:06:04
There is no quick way of getting a list of all players in a MP mission. It involves using publicvariable (which can be quite unreliable in some cases) and some careful coding. However, The Chain of Command's Network Services maintains a list of all players if you use it in your mission. I do suggest above all that you find one of the many delete dead guy scripts located on this very site. They work great and require no coding by you!

Here is a good one that will work in MP:
http://www.ofpec.com/editors/resource_view.php?id=583

It is time based, set for 10 secs I believe, but simply modify the script to make it however long you wish.

I am trying to find what I used to use to get a player list, but I now use CoC's Network Services in all my MP missions and no longer use my old method. If I remember correctly, my old way did not work 100% of the time either....


Title: Re:"player" in mp?
Post by: StonedSoldier on 23 Nov 2004, 16:15:09
ryan, at the the start of the mission have a trigger that covers ONLY playable units

WEST PRESENT

activation : players = thislist

now that will give you a global varible containing all the players

so just do something like

{?(_x distance _deadunit > 300) : deletevehicle _deadunit} foreach players