Example for CTLD > SCORING added (#1566)

* Example added

Example for the connection to the SCORING Class.

* kleiner Fehler eingeschlichen
This commit is contained in:
cammel tech 2021-07-06 20:26:20 +02:00 committed by GitHub
parent 5d3ea57d4d
commit 65bd7909e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
--