GetRealMonthM: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Use month number as table index)
(Blanked the page)
Tag: Blanking
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__NOTOC__
{{Useful Function}}
This function returns the month name.


'''Author:''' N3xT
==Syntax==
<syntaxhighlight lang="lua">
getRealMonthH ( )
</syntaxhighlight>
==Returns==
This function returns a string containing the real month name
==Code==
<section name="Function source" class="both" show="true">
<syntaxhighlight lang="lua">
monthTable = { -- table
[1] = "January",
[2] = "February",
[3] = "March",
[4] = "April",
[5] = "May",
[6] = "June",
[7] = "July",
[8] = "August",
[9] = "September",
[10] = "October",
[11] = "November",
[12] = "December"
}
function getRealMonthM()
local time = getRealTime()
local month = time.month + 1
return monthTable[month]
end
</syntaxhighlight>
</section>
==Example==
<section name="Clientside example" class="client" show="true">
This example output the real month.
<syntaxhighlight lang="lua">
addCommandHandler("month",
function ()
local month = getRealMonthM()
outputChatBox(month,255,0,0,true)
end
)   
</syntaxhighlight>
</section>
==See also==
{{Useful_Functions}}

Latest revision as of 14:28, 23 May 2021