Jump to content

FindMostRecentEvent

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: FindMostRecentEvent
Function Description: Retrieves the most recent event entry of a specified type from a player's sortie history list by iterating backwards through the table.
File Location: cmm.XpFunctions.lua
Syntax: CMM.FindMostRecentEvent( table PlayerSORTIE , string EventType )
Return Value: nil or table
Parameters: Name Description
PlayerSORTIETable containing sortie entries, each with an EventType field; entries are ordered chronologically with the most recent at the end.
EventTypeThe type of event to search for, such as "Takeoff" or "Landing"; matches against the EventType field in each sortie entry.
Example: CMM.FindMostRecentEvent(PlayerSORTIE, "Takeoff")
Example Description: Finds the most recent takeoff event in a player's sortie history and returns its data for further processing.
Related Functions:
Notes: