Search the Community

Showing results for tags 'time'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 9 results

  1. Hi everyone im new in scripting and i wanna script a level system All i want is when player plays in server +5 hours make the player ranked up exp: +5 hourse lvl 1 +10hourse lvl2 15hourse lvl3 And how can i show this levels in scoreboard Sorry for my TERRIBLE english
  2. How to get mute remaining time? For example i write /getmute, and then output "Mute remaining time: 5 mins", or "You are not muted". Sorry for my bad english.
  3. so hello so i tried adding days and weeks but all i got was error and i can't figure way how to make days from hours and then weeks from days code: exports.scoreboard:addScoreboardColumn('time') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "time", tostring( hour )..'h '..tostring( min )..'min.' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'time' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "time-hour", tostring(hour) ) setAccountData ( playeraccount, "time-min", tostring(min) ) setAccountData ( playeraccount, "time-sec", tostring(sec) ) setAccountData ( playeraccount, "time", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "time" ) local hou = getAccountData ( playeraccount, "time-hour") local min = getAccountData ( playeraccount, "time-min") local sec = getAccountData ( playeraccount, "time-sec") if ( time ) then setElementData ( source, "time", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "time",0 ) setAccountData ( playeraccount, "time",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin )
  4. اهلا شباب كيف حالكم ان شاء الله تكونو بخير انا محتاج فنكشنات لصنع ساعه حقيقيه جوا اللعبة زى الوقت الحقيقى كده 24 ساعه وشكرا
  5. Hi! I want to make a gamemode, with a loading lobby. BUT i have lobbys in different dimensions, but the dimensions ID is not fix. How can i load the maps to different dimensions in every time.
  6. i have this played time script: and i want add to this a command, which the admins can add more hours for anyone, how to make this command??
  7. i have this script: exports.scoreboard:addScoreboardColumn('Játszott idő') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hours' ] = tonumber( t[ source ][ 'hours' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hours"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hours = tonumber( t[ v ][ 'hours' ] or 0 ) setElementData( v, "Játszott idő", tostring( hours )..' óra '..tostring( min )..' perc' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Játszott idő' ) local hours = tonumber( t[ source ][ 'hours' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "Játszott idő-hours", tostring(hours) ) setAccountData ( playeraccount, "Játszott idő-min", tostring(min) ) setAccountData ( playeraccount, "Játszott idő-sec", tostring(sec) ) setAccountData ( playeraccount, "Játszott idő", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Játszott idő" ) local hou = getAccountData ( playeraccount, "Játszott idő-hours") local min = getAccountData ( playeraccount, "Játszott idő-min") local sec = getAccountData ( playeraccount, "Játszott idő-sec") if ( time ) then setElementData ( source, "Játszott idő", time ) t[ source ]["hours"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "Játszott idő",0 ) setAccountData ( playeraccount, "Játszott idő",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) and i want add a function, what get players played time, and when reach xy played time (for example 30), then do something (for example output a text to chat box) How is it possible?
  8. Всем привет, в процессе разработки игрового мода, не могу решить пару вопросов. 1. При присоеденении прицепа к грузовику, у того, кто цепляет - все в порядке, другие же видят как голова едет гораздо дальше чем прицеп, т.е. между ними промежуток (иногда огромный). 2. При езде на велосипеде, зависают или изменяются произвольно анимации езды или положения игрока на велосипеде (например игрок едет на нем лежа или вовсе стоит на велосипеде). 3. Как во время разработки кастомной системы бана/тюрьмы/блокировки чата, расчитывать временной интервал например бан на 30 дней, значит что в MySQL добавляется запись о том, что для определенного игрока срок бана заканчивается через ИМЕННО 30 дней, а по тюрьме, например через 40 минут? Временные интервалы как реализовать в MySQL понятно, не понятно как полученную информацию на сервере (в формате ngnix (time)) расчитывать интервалом как например в той же функции mySQL.
  9. Introducción Este recurso es una ayuda a los programadores que busquen tener un control más amplio del tiempo! Funciones: getWeekDay getMonthDays getMonthName getYearDays getRemaningDaysInYear getSpentsDaysInYear dateToUnix unixToDate getDateInAdd Ejemplos string getWeekDay(day, month, year) Permite obtener qué día de la semana es la fecha específicada (Su funcionamiento es puramente matemático, para conocer más sobre su funcionamiento https://en.wikipedia.org/wiki/Zeller's_congruence) outputchatBox(getWeekDay(13, 11, 2016)); -- output: Domingo int getMonthDays(month, year) Obtiene la cantidad de días de cierto mes tomando en cuenta los años biciestos (razón por la cual es obligatorio el argumento) local days = getMonthDays(2, 2016) -- Año biciesto -- days contains: 29, local days = getMonthDays(2, 2017) -- Año normal -- days contains: 28, string getMonthName(month) Obtiene el nombre del mes especificado local n = getMonthName(11) -- n contains: Noviembre int getYearDays(year) Obtiene la cantidad de días del año especificado incluyendo los días al ser año biciesto local n = getYearDays(2016) -- n contains: 366 local n = getYearDays(2015) -- n contains: 365 int getRemaningDaysInYear(day, month, year) Obtiene la cantidad de días que faltan en el año según los datos especificados local n = getRemaningDaysInYear(13, 11, 2016) -- n contains: 48 int getSpentsDaysInYear(day, month, year) Obtiene la cantidad de días que han pasado en el año según los datos especificados local n = getSpentsDaysInYear(13, 11, 2016) -- n contains: 318 int dateToUnix(day, month, year) Convierte el día, año y mes al tiempo unix para tener un mayor control de éste mediante el unixtime (https://es.wikipedia.org/wiki/Tiempo_Unix) local time = dateToUnix(13, 11, 2016) -- time contains: 1512864000 int, int, int unixToDate(unixtime) Convierte el unixtime a datos leibles local day, month, year = unixToDate(1512864000); --- days, mounth, year contains: 13, 11, 2016 int, int, int getDateInAdd(_day, _month, _year, days, months, years) Añade días a una fecha especificada y obtiene la fecha con los días, meses y años añadidos siguendo el formato del calendario (añades 20 días siendo 12 de diciembre de 2016 te dará) 1, enero 2017 sin alterar el orden local d, m, y = getDateInAdd(13, 11, 2016, 2, 0, 0); outputServerLog(getWeekDay(d, m, y)) -- output: Martes (15) ya que Domingo (13) meta.xml Todas las funciones pueden ser exportadas, para poner el resource en español configurar en el meta.xml <setting name="*Lang" value="[1]"/> -- Cambiar a <setting name="*Lang" value="[2]"/> Link de del recurso -> https://github.com/iZume/time-functions-LUA/archive/master.zip