IAF.amir Posted November 13, 2024 Posted November 13, 2024 (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 November 13, 2024 by IAF.amir
Kanelbolle Posted November 13, 2024 Posted November 13, 2024 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 WARGAMES Servers: https://forum.dcs.world/topic/301046-wargames-server-pvp-and-pve-campaign-servers/ Scripts: RGC & SPGG https://github.com/AGluttonForPunishment/
IAF.amir Posted November 13, 2024 Author Posted November 13, 2024 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'
Kanelbolle Posted November 13, 2024 Posted November 13, 2024 (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 November 13, 2024 by Kanelbolle WARGAMES Servers: https://forum.dcs.world/topic/301046-wargames-server-pvp-and-pve-campaign-servers/ Scripts: RGC & SPGG https://github.com/AGluttonForPunishment/
ops Posted November 19, 2024 Posted November 19, 2024 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)
ops Posted November 19, 2024 Posted November 19, 2024 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?
IAF.amir Posted November 20, 2024 Author Posted November 20, 2024 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
Recommended Posts