Functions - Henotu/TTT2-Statistics GitHub Wiki
StatisticsUpdatePData(Name, text1, text2)
Description
- This function adds +1 to your a given PData-entry
- If extra text is given, entry-milestone is announced in the chat
Arguments
-
str Name:
The PData-entry name
-
str text1 = nil:
Text in front of the announced milestone-number
-
str text2 = nil:
Text after the announced milestone-number
Returns
Nothing.
Example
StatisticsUpdatePData("stat_RoundsPlayed", "played their", "th round")
Output (if milestone is achieved):
[Statistic-Milestone] Henotu played their 100th round
AddYourStatisticsAddon(ButtonName, FunctionName, EntryTable , Number)
Description
- Adds your addition to the GUI in form of a button
- It would be best if you use this inside of a hook. ( i.e. "TTT2FinishedLoading" or "PlayerReady")
Arguments
-
str ButtonName:
The displayed name of the button
-
function FunctionName:
The name of the global function in your addition. This function should have a structure like this
-
tbl Entrytable = nil:
A table containing the names of entries that get stored inside the PlayerDB by your addition
-
number Number = nil:
The position of the button in the GUI You should not use this if you are an external developer
Returns
Nothing.
Example
hook.Add("TTT2FinishedLoading", "unique_identifier", function()
AddYourStatisticsAddon("Your ButtonName", ButtonNameDrawGui)
end)