Hi, Im just wondering what this script is called.
I’m trying to clear up the screen for screenshots and I can’t find the script name. /stop **********
Thanks for your help!!
Hi, Im just wondering what this script is called.
I’m trying to clear up the screen for screenshots and I can’t find the script name. /stop **********
Thanks for your help!!
or what ever you named it
The server owner must have renamed it then. Thank you for your reply!
I need a script to show Players Date and time!
This should work.
function round(num, numDecimalPlaces)
local mult = 10^(numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end
function drawTxt4(x,y ,width,height,scale, text, r,g,b,a)
SetTextFont(4)
SetTextProportional(0)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0,255)
SetTextEdge(2, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x - width/2, y - height/2 + 0.005)
end
function GetTimeAndMinutes()
gethour=GetClockHours()
getmins=GetClockMinutes()
local y,mo,d,h,m,s=GetLocalTime()
minz=""
if(getmins<=9)then
minz="0"
end
local hour=h
if(h>12)then
hour=h-12
end
if(h==0)then
hour="12"
end
local period="AM"
if(h>=12)then
period="PM"
end
local minutes=m
if(m<10)then
minutes="0"..m..""
end
if(DisplayTimeandDate)then
drawTDMFPS(string.format("Time: ~w~%s:~w~%s%s~s~ | ~w~%s~s~/~w~%s~s~/~w~%s~s~ | AOP: ~w~"..CurrentAOP.. " " ..CurrentAOP2,gethour,minz,getmins,mo,d,y),1500,12.5,0.46,true,4,191,10,48,205)
end
end
Citizen.CreateThread(function()
while true do
Wait(0)
local ped_l=GetPlayerPed(-1)
if(DoesEntityExist(ped_l))then
GetTimeAndMinutes()
end
end
end)
function drawTDMFPS(text, x, y, size, center, font, r, g, b, a)
local resx,resy=GetScreenResolution() -- determines resoultion using native
SetTextFont(font)
SetTextScale(size,size)
SetTextProportional(true)
SetTextColour(Colors.r, Colors.g, Colors.b, Colors.a)
SetTextCentre(center)
SetTextDropshadow(0,0,0,0,0)
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(HUD.Locationx - 0.425, HUD.Locationy - 0.471)
end
Not working… I need a script in the next format example: Online:1/32| 18 January 2019
for all who shows 2013 or 2018 and not reall time that should help u
local displayTime = true
local displayDate = truelocal timeAndDateString = nil
function CalculateDayOfWeekToDisplay()
if dayOfWeek == 1 then
dayOfWeek = “Sunday”
elseif dayOfWeek == 2 then
dayOfWeek = “Monday”
elseif dayOfWeek == 3 then
dayOfWeek = “Tuesday”
elseif dayOfWeek == 4 then
dayOfWeek = “Wednesday”
elseif dayOfWeek == 5 then
dayOfWeek = “Thursday”
elseif dayOfWeek == 6 then
dayOfWeek = “Friday”
elseif dayOfWeek == 7 then
dayOfWeek = “Saturday”
end
endfunction CalculateDateToDisplay()
if month == 1 then
month = “January”
elseif month == 2 then
month = “February”
elseif month == 3 then
month = “March”
elseif month == 4 then
month = “April”
elseif month == 5 then
month = “May”
elseif month == 6 then
month = “June”
elseif month == 7 then
month = “July”
elseif month == 8 then
month = “August”
elseif month == 9 then
month = “September”
elseif month == 10 then
month = “October”
elseif month == 11 then
month = “November”
elseif month == 12 then
month = “December”
end
endfunction CalculateTimeToDisplay()
if hour <= 9 then
hour = tonumber(“0” … hour)
end
if minute <= 9 then
minute = tonumber(“0” … minute)
end
endAddEventHandler(“playerSpawned”, function()
Citizen.CreateThread(function()
while true do
Wait(1)
year, month, dayOfWeek, hour, minute = GetLocalTime()
timeAndDateString = “|”
CalculateTimeToDisplay()
if displayTime == true then
timeAndDateString = timeAndDateString … " " … hour … “:” … minute … " |"
end
if displayDate == true then
CalculateDateToDisplay()
timeAndDateString = timeAndDateString … " " … dayOfWeek … " " … month … " " … year … " |"
endSetTextFont(0) SetTextProportional(1) SetTextScale(0.30, 0.30) SetTextColour(255, 255, 255, 255) SetTextDropshadow(0, 0, 0, 0, 255) SetTextEdge(1, 0, 0, 0, 255) SetTextDropShadow() SetTextOutline() SetTextRightJustify(true) SetTextWrap(0,0.95) SetTextEntry("STRING") AddTextComponentString(timeAndDateString) DrawText(0.5, 0.01) end
end)
end)
Hi, How can I make SYNC the system time with the TIME INGAME. I mean, it’s 00:28 right now, but ingame i have DAYLIGHT … i want it to be 00:28 ingame too :C… help! Thanks!
hi,
I have a question is how do I remove the original time stamp next to the minimap? Also with the speedometer bottom right of the map?
change this:
SetTextWrap(0,0.95)
if you change 0.95 down then it go to the left
example:
SetTextWrap (0.0.18)
this is in the left corner
I hope you understand it.
The Time Syncs With This Script vSync !
local displayTime = true
local useMilitaryTime = true
local displayDayOfWeek = true
local displayDate = true
local displayFps = true
local timeAndDateString = nil
local hour
local minute
local dayOfWeek
local month
local dayOfMonth
local year
local rgb = {r = 255, g = 153, b = 102}
local prevtime = GetGameTimer()
local prevframes = GetFrameCount()
local fps = -1
Citizen.CreateThread(function()
while true do
Wait(1)
timeAndDateString = "~r~Time:"
if displayTime == true then
CalculateTimeToDisplay()
timeAndDateString = timeAndDateString .. " ~w~" .. hour .. "~r~:~w~" .. minute .. "~r~ | "
end
if displayDayOfWeek == true then
CalculateDayOfWeekToDisplay()
timeAndDateString = timeAndDateString .. "~w~" .. dayOfWeek .. "~r~ | "
end
if displayDate == true then
CalculateDateToDisplay()
timeAndDateString = timeAndDateString .. "~w~" .. month .. "~r~/~w~" .. dayOfMonth .. "~r~/~w~" .. year .. "~r~ | ~w~"
end
if displayFps == true then
CalculateDateToDisplay()
timeAndDateString = timeAndDateString .. "~w~" .. fps .. " ~r~FPS ~r~"
end
SetTextFont(4)
SetTextProportional(1)
SetTextScale(0.50, 0.50)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextRightJustify(true)
SetTextWrap(0.1,0.93)
SetTextEntry("STRING")
AddTextComponentString(timeAndDateString)
DrawText(0.01, 0.01)
end
end)
function CalculateTimeToDisplay()
hour = GetClockHours()
minute = GetClockMinutes()
if useMilitaryTime == false then
if hour == 0 or hour == 24 then
hour = 12
elseif hour >= 13 then
hour = hour - 12
end
end
if hour <= 9 then
hour = "0" .. hour
end
if minute <= 9 then
minute = "0" .. minute
end
end
function CalculateDayOfWeekToDisplay()
dayOfWeek = GetClockDayOfWeek()
if dayOfWeek == 0 then
dayOfWeek = "Sunday"
elseif dayOfWeek == 1 then
dayOfWeek = "Monday"
elseif dayOfWeek == 2 then
dayOfWeek = "Tuesday"
elseif dayOfWeek == 3 then
dayOfWeek = "Wednesday"
elseif dayOfWeek == 4 then
dayOfWeek = "Thursday"
elseif dayOfWeek == 5 then
dayOfWeek = "Friday"
elseif dayOfWeek == 6 then
dayOfWeek = "Saturday"
end
end
function CalculateDateToDisplay()
month = GetClockMonth()
dayOfMonth = GetClockDayOfMonth()
year = 2018
if month == 0 then
month = "1"
elseif month == 1 then
month = "2"
elseif month == 2 then
month = "3"
elseif month == 3 then
month = "4"
elseif month == 4 then
month = "5"
elseif month == 5 then
month = "6"
elseif month == 6 then
month = "7"
elseif month == 7 then
month = "8"
elseif month == 8 then
month = "9"
elseif month == 9 then
month = "10"
elseif month == 10 then
month = "11"
elseif month == 11 then
month = "12"
end
end
Citizen.CreateThread(function()
while not NetworkIsPlayerActive(PlayerId()) or not NetworkIsSessionStarted() do
Citizen.Wait(250)
prevframes = GetFrameCount()
prevtime = GetGameTimer()
end
while true do
curtime = GetGameTimer()
curframes = GetFrameCount()
if((curtime - prevtime) > 1000) then
fps = (curframes - prevframes) - 1
prevtime = curtime
prevframes = curframes
end
if IsGameplayCamRendering() and fps >= 0 then
PrintText(fps .. " FPS")
end
Citizen.Wait(1)
end
end)
function PrintText(text)
SetTextEntry("STRING")
end
Hey, I removed the Month and Year thing, I prefer to have only the Hours and Day of the Week but… As the time changes the HUD goes left and right, does anyone know how to make it static ? It’s really annoying and I’ve been on this for hours.
hello, your resource and private or did you share it?
how can i set the time open drug shop with it? for example i want they OpenMenu at 8:am and close at 10pm?
Hello I made few chabges to the code to allow better control over it and for better performance
-- Display the Date and Time at the top right if true, and top left if false
local toprightDisplay = true
-- Options to what parts to show
local displayTime = true
local displayDayOfWeek = true
local displayDate = true
-- default is 12 hours clock you can change this to true to use the 24 hours clock
local useMilitaryTime = false
local timeAndDateString = nil
local hour
local minute
local dayOfWeek
local month
local dayOfMonth
local year
local monthlist = {
[0] = "January",
[1] = "February",
[2] = "March",
[3] = "April",
[4] = "May",
[5] = "June",
[6] = "July",
[7] = "August",
[8] = "September",
[9] = "October",
[10] = "November",
[11] = "December",
}
local weeklist = {
[0] = "Sunday",
[1] = "Monday",
[2] = "Tuesday",
[3] = "Wednesday",
[4] = "Thursday",
[5] = "Friday",
[6] = "Saturday",
}
-- Display Time and Date at top right of screen -- format: | 12:13 | Wednesday | January 17, 2017 |
Citizen.CreateThread(function()
while true do
Wait(1)
timeAndDateString = "|"
if displayTime == true then
CalculateTimeToDisplay()
timeAndDateString = timeAndDateString .. " " .. hour .. ":" .. minute .. " |"
end
if displayDayOfWeek == true then
CalculateDayOfWeekToDisplay()
timeAndDateString = timeAndDateString .. " " .. dayOfWeek .. " |"
end
if displayDate == true then
CalculateDateToDisplay()
timeAndDateString = timeAndDateString .. " " .. month .. " " .. dayOfMonth .. ", " .. year .. " |"
end
if toprightDisplay then
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.30, 0.30)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextRightJustify(true)
SetTextWrap(0,0.95)
SetTextEntry("STRING")
AddTextComponentString(timeAndDateString)
DrawText(0.5, 0.01)
else
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.30, 0.30)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextRightJustify(true)
SetTextWrap(0.1,0.28)
SetTextEntry("STRING")
AddTextComponentString(timeAndDateString)
DrawText(0.01, 0.01)
end
end
end)
function CalculateTimeToDisplay()
hour = GetClockHours()
minute = GetClockMinutes()
if useMilitaryTime == false then
if hour == 0 then
hour = 12
elseif hour >= 13 then
hour = hour - 12
end
end
if hour <= 9 then
hour = "0" .. hour
end
if minute <= 9 then
minute = "0" .. minute
end
end
function CalculateDayOfWeekToDisplay()
dayOfWeek = weeklist[GetClockDayOfWeek()]
end
function CalculateDateToDisplay()
month = monthlist[GetClockMonth()]
dayOfMonth = GetClockDayOfMonth()
year = GetClockYear()
end
@Trung_Nguyen6
You need to add in your Drug shop where you handle the opening of the menu change it to this
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlPressed(0, 177) then
if TriggerEvent("shopOpenned") then
-- here the code to open the Menu
end
end
end
end)
and also you need to add this to this script “TimeandDateDisplay” , be aware that this script "TimeandDateDisplay should run before your DrugShop script in your server.cfg to avoid any troubles
-- Insert open and close time for your Shop here i used the example you stated Open at 8:am and close at 10pm
local shopopenTime = 8
local shopcloseTime = 22
RegisterNetEvent("shopOpenned")
AddEventHandler("shopOpenned", function()
if shopopenTime <= hour and shopcloseTime >= hour then
return true
else return false
end
end)
also make sure to specify this to run the 24 hours time
local useMilitaryTime = true
Hey there! Do you know how to make it go down too?
hey, any luck with moving it down?
How can i move this down?