User:Phineas: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function checkG(str)
function getTimestamp()
    if (string.find(string.lower(str), "gapy")) then
local RTime = getRealTime()
        return "Yes, Gaypee is present in the string!"
local year, month, day, hours, mins, secs = RTime.year + 1900, RTime.month + 1, RTime.monthday, RTime.hour, RTime.minute, RTime.second
    else
if (month < 10) then
        return "Nope, I can't find Gaypee in the string!"
month = "0" ..tostring(month)
    end
end
    return false
if (hours < 10) then
hours = "0" ..tostring(hours)
end
if (mins < 10) then
mins = "0" ..tostring(mins)
end
if (secs < 10) then
secs = "0" ..tostring(secs)
end
local TimeStamp = day .. "-" .. month .. "-" .. year .. " " .. hours .. ":" .. mins .. ":" .. secs
return TimeStamp
end
end
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 16:03, 18 March 2013

Sup

function getTimestamp()
	local RTime = getRealTime()
	local year, month, day, hours, mins, secs = RTime.year + 1900, RTime.month + 1, RTime.monthday, RTime.hour, RTime.minute, RTime.second
	if (month < 10) then
		month = "0" ..tostring(month)
	end
	if (hours < 10) then
		hours = "0" ..tostring(hours)
	end
	if (mins < 10) then
		mins = "0" ..tostring(mins)
	end
	if (secs < 10) then
		secs = "0" ..tostring(secs)
	end
	local TimeStamp = day .. "-" .. month .. "-" .. year .. " " .. hours .. ":" .. mins .. ":" .. secs
	return TimeStamp
end