Jump to content

Recommended Posts

Posted (edited)

when a player join a slot, after he press 'FLY' i want to get the player id / name.

Hooks - onActivePlane() only return the aircraft type

Edited by IAF.amir
Posted
11 minutes ago, IAF.amir said:

when a player join a slot, after he press 'FLY' i want to get the player id / name.

Hooks - onActivePlane() only return the aircraft type

 

Can't see any documentation for a hook called onActivePlane

Search results for "hook" - DCS World Wiki - Hoggitworld.com

 

Not sure what you are trying to do, but most hook events have the playerid as the default string.

Example: DCS hook onPlayerTryChangeSlot - DCS World Wiki - Hoggitworld.com

 

local hook = {}
  local playerUnitList = {}
  function hook.onPlayerChangeSlot(playerID) 
       local playerName = net.get_player_info(playerID, 'name')
       local slot = net.get_player_info(playerID, 'slot')
       playerUnitList[playerName] = slot
   end

 

 

Posted (edited)
1 hour ago, IAF.amir said:

onActivatePlane method i find in opsdcs github:
https://github.com/pschiel/opsdcs/blob/main/opsdcs-api/opsdcs-api.lua#L829

the onPlayerChangeSlot happend before i press 'FLY'

This isn't a native DCS Api command as far as i can tell, its a JSON API hook for DCS. You are better off asking the github project if it is possible on that page.

If you want to get something on spawn in the DCS native api, you use  event birth
DCS event birth - DCS World Wiki - Hoggitworld.com

Getting this in to the hook environment is not that easy. Never done this, but possible through flags.

 

Edited by Kanelbolle
Posted
On 11/13/2024 at 3:02 PM, Kanelbolle said:

This isn't a native DCS Api command as far as i can tell, its a JSON API hook for DCS. You are better off asking the github project if it is possible on that page.

If you want to get something on spawn in the DCS native api, you use  event birth
DCS event birth - DCS World Wiki - Hoggitworld.com

Getting this in to the hook environment is not that easy. Never done this, but possible through flags.

 

it's a fairly new function, see Scripts\Hooks\common.lua in DCS install dir,

didn't test yet if it works (there is a bunch of events/callbacks that seem to not work)

 

Posted
On 11/13/2024 at 1:54 PM, IAF.amir said:

onActivatePlane method i find in opsdcs github:
https://github.com/pschiel/opsdcs/blob/main/opsdcs-api/opsdcs-api.lua#L829

the onPlayerChangeSlot happend before i press 'FLY'

I don't think anything special happens when you press "FLY", it only closes the briefing window. (You can open the briefing window and close it during mission, no event or anything is fired, simulation continues running).

what are you trying to accomplish?

Posted
On 11/19/2024 at 4:47 PM, ops said:

I don't think anything special happens when you press "FLY", it only closes the briefing window. (You can open the briefing window and close it during mission, no event or anything is fired, simulation continues running).

what are you trying to accomplish?

trying to start / stop video recording/obs when im enter/exit the aircraft

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...