mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Example for CTLD > SCORING added (#1566)
* Example added Example for the connection to the SCORING Class. * kleiner Fehler eingeschlichen
This commit is contained in:
parent
5d3ea57d4d
commit
65bd7909e1
@ -351,6 +351,24 @@ do
|
||||
-- function my_ctld:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
|
||||
-- ... your code here ...
|
||||
-- end
|
||||
--
|
||||
-- ## 3.6 A simple SCORING example:
|
||||
--
|
||||
-- To award player with points, using the SCORING Class (SCORING: my_Scoring, CTLD: CTLD_Cargotransport)
|
||||
--
|
||||
-- function CTLD_Cargotransport:OnAfterCratesDropped(From, Event, To, Group, Unit, Cargotable)
|
||||
-- local points = 10
|
||||
-- local PlayerName = Unit:GetPlayerName()
|
||||
-- my_scoring:_AddPlayerFromUnit( Unit )
|
||||
-- my_scoring:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for transporting cargo crates!", PlayerName, points), points)
|
||||
-- end
|
||||
--
|
||||
-- function CTLD_Cargotransport:OnAfterCratesBuild(From, Event, To, Group, Unit, Vehicle)
|
||||
-- local points = 5
|
||||
-- local PlayerName = Unit:GetPlayerName()
|
||||
-- my_scoring:_AddPlayerFromUnit( Unit )
|
||||
-- my_scoring:AddGoalScore(Unit, "CTLD", string.format("Pilot %s has been awarded %d points for the construction of Units!", PlayerName, points), points)
|
||||
-- end
|
||||
--
|
||||
-- ## 4. F10 Menu structure
|
||||
--
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user