Search the Community

Showing results for tags 'settimer'.



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 11 results

  1. Hola a todos , soy nuevo tengo un resource que necesito reiniciar siempre al entrar al servidor , no se porqué , lo que quiero es que se reinicie despues de 2 minutos , pero que se reinicie esa unica vez lo de hacer que se reinicie ya me quedó con settimer pero no se como hacer para que lo haga una sola vez sería con killtimer? ya lo intenté y nada setTimer( function() --restarting this resource 2 min restartResource(getThisResource()) end, 120000, 0)
  2. Con el CommandHandler "Sube" funciona, pero con el Pe, ¿Que hace? Crea el objeto, pero no lo redirecciona con el SetElementPosition y attach, es como si lo ignorara... ¿Alguna solución? function SubenPasajeros () if CantidadDeAsientos >= 0 then if Asiento1 == 0 then Asiento1 = 1 local vehicle = getPedOccupiedVehicle( client ) x1, y1, z1 = getElementPosition ( client ) Asiento1 = createObject (2035, 1421.958984375, 2624.4677734375, 11.392612457275) setElementPosition ( Asiento1, x1, y1, z1) attachElements( Asiento1, vehicle, 0.95, 0.6, 0, 0, 0, 0 ) --Fila 1 A outputChatBox ("Asiento1") else if Asiento2 == 0 then Asiento2 = 1 outputChatBox ("Asiento2") local vehicle = getPedOccupiedVehicle( client ) x1, y1, z1 = getElementPosition ( client ) Asiento2 = createObject (2035, 1421.958984375, 2624.4677734375, 11.392612457275) setElementPosition ( Asiento2, x1, y1, z1) attachElements( Asiento2, vehicle, 0.5, -0.2, 0, 0, 0, 0 ) --Fila 2 B end end end addCommandHandler("sube",SubenPasajeros) function PrenderFuncSubenPasajeros () outputChatBox ("JEJE") setTimer ( SubenPasajeros, 500, 1) end addCommandHandler("pe",PrenderFuncSubenPasajeros)
  3. السلام عليكم شباب ابي مساعدة في عمل حركة للاعب لمدة بضع ثواني وبعد انتهاء الثواني يقوم بالغاء الحركة واسترجاع الحركة العادية الي هيا المشي
  4. السلام عليكم ورحمة الله وبركاته .... مب لاقي شي اسويه ولا اي افكار فقلت خلني اشرح بعض الاشياء .... شرحي رح يكون عن setTimer .... والـ هو مؤقت يسوي شي كل وقت او يسوي شي بعد فترة محددة .... طيب خلنا نبدأ على بكرة الله .... المثال الاول رح اشرح فيه طريقة انشاء شي معين كل فترة معينة -- server function theFunctionName ( ) exports["guimessages"]:outputServer(root,"message from server file.",0,255,0,root) -- YourCode end setTimer ( theFunctionName, 5000, 0 ) -- لاحظ الرقم 0 -- client function theFunctionName ( ) exports["guimessages"]:outputClient("message from client file.",0,255,0) -- YourCode end setTimer ( theFunctionName, 5000, 0 ) -- لاحظ الرقم 0 المثال الثاني رح اشرح فيه طريقة انشاء شيء معين بعد فترة معينة -- server function theFunctionName ( ) exports["guimessages"]:outputServer(root,"message from server file.",0,255,0,root) -- YourCode end setTimer ( theFunctionName, 5000, 1 ) -- لاحظ الرقم 1 -- client function theFunctionName ( ) exports["guimessages"]:outputClient("message from client file.",0,255,0) -- YourCode end setTimer ( theFunctionName, 5000, 1 ) -- لاحظ الرقم 1 اذا لاحظتوا الفرق بين المثال الاول والمثال الثاني وهو شي واحد وهو الرقم 0 و الرقم 1 وهم يتحكمون في نوع المؤقت المؤقت مع الرقم 0 يسوي شي معين كل فترة معينة المؤقت مع الرقم 1 يسوي شي معين بعد فترة معينة المثال الثالث رح اشرح فيه كيفية تحديد وقت المؤقت .... واللي ما يعرف هذا الشي علامة الضرب [ * ] علامة القسمة [ / ] علامة الطرح [ - ] علامة الجمع [ + ] رح تقولولي وش فائدتهم بقولكم تقدرون تستفيدون منهم في البرمجة .... وقت المؤقت يكون عبارة عن 1000 جزء من الثانية بمعنى 1000 ميلي ثانية = ثانية .... طيب بنشوف مثال -- server -- guimessages ( outputServer ) function theFunctionName ( ) exports["guimessages"]:outputServer(root,"message from server file.",0,255,0) end setTimer ( theFunctionName, 5000, 0 ) -- رقم 5000 = 5 ثواني -- يمكن كتابته بصورة مختلفة مثل setTimer ( theFunctionName, 5*1000, 0 ) -- 1000 * 5 = 5000 وهذه فائدة الضرب -- طيب اذا ابي اسوي مؤقت يخرج رسالة كل 5 دقائق مثلاً وش اسوي ؟ -- هذا المثال يوضح كيف function Timer5 ( ) -- Timer5 = اسم الامر ويمكن كتابته اي شيء تريده exports["guimessages"]:outputServer(root,"مرحباً بك في السيرفر",0,255,0) end setTimer ( Timer5, (5*60*1000), 0 ) -- 5*60*1000 = 5 دقائق هذا الـ عندي اتمنى انكم استفدتم اذا ما فهمت الكود اكتب تعليق وبساعدك بإذن الله اذا قصرت في الشرح فأنا آسف هذا اول شرح لي والقادم افضل بإذن الله ... ... والسلام عليكم ورحمة الله وبركاته ...
  5. Hello. I want create a dx timer which when the player disconnect, and connect again to the server then not reset the timer. Sorry for my bad english :c
  6. ZuKi|R

    Help SetTimer

    Hello, they help me with this problem no as him aria but help need a hand, which is that I want to do is that each true time example each 1 minute repeat this funcion, but I do this and does not do it only repeats once. Already it try of some ways but only repeats once, some suggestion or an error that have ? ------------------- ---Off Element Data setTimer ( function() setElementData(bossDeady[ID][12],"boss",false)end,5000,1) setTimer ( function()removeElementData(bossDeady[ID][12],"boss.name") end,5000,1) setTimer ( function()removeElementData(bossDeady[ID][12],"health") end,5000,1) setTimer ( function()setElementAlpha(bossDeady[ID][12],4) end,5000,1) setTimer ( function() setPedOnFire(bossDeady[ID][12], true) end,5000,1) --- On Element Data setTimer ( function()setElementData(bossDeady[ID][12],"boss",true) end,9000,1) setTimer ( function()setElementAlpha(bossDeady[ID][12],255)end,9000,1) setTimer ( function()setElementData(bossDeady[ID][12],"boss.name",name) end,9000,1) setTimer ( function()setElementData(bossDeady[ID][12],"health",health)end,9000,1) setTimer ( function()setPedOnFire(bossDeady[ID][12], false)end,9000,1)
  7. Ayuda por favor, al matar al "hades" salga por un cierto tiempo el segundo "crazy" sin que respawnee de nuevo al boss "hades" hasta matar al boss "crazy", no logro hacerlo sin que me salga bien solo cuando mato al primero sale los 2 al mismo tiempo que le puse (60 segundos). Server side: function boss0 ( ) hades = exports [ "slothBot" ]:spawnBot ( 1184.654, -2038.601, 69.008, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) exports.extra_health:setElementExtraHealth(hades, 1000) setElementModel ( hades, 38 ) setElementData (hades, "boss", true) outputChatBox ("#9E0000Boss Hades!!",getRootElement(), 255, 255, 255, true ) end addEventHandler("onResourceStart", resourceRoot, boss0) --Boss1 function Boss1 ( ) crazy = exports [ "slothBot" ]:spawnBot ( 1262.77, -2029.756, 59.341, 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) exports.extra_health:setElementExtraHealth(crazy, 1000) setElementModel ( crazy, 312 ) setElementData (crazy, "boss", true) end function money (theKiller) if getElementData(source,"boss")==true then local premio = math.random(1000,5000) givePlayerMoney(theKiller,premio) outputChatBox ( getPlayerName ( theKiller ) .. " #081DBFMato al Boss!, Ha Ganado $".. premio .." platica :v",getRootElement(), 255, 255, 255, true ) if source == hades then setTimer(boss0, 60000, 1) end if (not isElement(crazy)) then setTimer(Boss1, 60000, 1) end end end addEvent("onBotWasted", true) addEventHandler("onBotWasted", getRootElement(), money)
  8. dromerboy

    Help Socorro

    English: Hello friends, I have a problem with this script posted below, I am a beginner in the moon language, and I would like to know how I can use the setTimer function to give a 2 second delay in the outputChatBox. Portuguese: Olá amigos,Estou com um problema nesse script postado a baixo,sou iniciante na linguagem lua,e gostaria de saber como posso usufruir da função setTimer,para dar um delay de 2 segundos no outputChatBox. function HandlerWasted() valor = math.random( 170, 500 ) outputChatBox("#FFFFFFForam cobrados #FBFF00 $"..tostring ( valor )..",00 #FFFFFFpelos seus gastos no hospital",source,255,255,255,true) valor = takePlayerMoney(source, valor) end addEventHandler("onPlayerWasted",getRootElement(), HandlerWasted)
  9. Hello! I don't understand the setTimer wiki, can you please teach me how it works? I would do this if it would work: function hello() local timer = setTimer (60000) -- sets timer to a minute if timer == 0 then -- checks if timer is 0 outputChatBox ("0") -- outputs, that timer is null else return nil end end addEventHandler ("onClientResourceStart", getRootElement(), hello) This is a not working script, can you help me to make it work? Thank you!
  10. I was making a new script with classes for mta, and i need to set a timer inside a method like this. function WorldGrid:updatePlayerZone(player) -- DOING NON RELEVANT SHI T HERE outputChatBox("worldGrid: " .. tostring(worldGrid) .. " player: " .. tostring(player)) setTimer(self:updatePlayerZone, 4000, 1, player) end end This couldnt even compile, because self:updatePlayerZone is not recognized as a function. So.. i checked setTimer mta wiki page. it says: theFunction: The function you wish the timer to call. (Notice: Do not use a 'local' function, it must be global!) So, i need to call a global function on setTimer. I tryed out this: function updatePlayerZoneWrapper(worldGrid, player) outputChatBox("worldGrid " .. tostring(worldGrid) .. " player: " .. tostring(player)) worldGrid:updatePlayerZone(player) end function WorldGrid:updatePlayerZone(player) outputChatBox("worldGrid before: " .. tostring(self) .. " player before: " .. tostring(player) setTimer(updatePlayerZoneWrapper, 4000, 1, self, player) end end But it didnt work neither.. I get: Attempt to call method 'updatePlayerZone' (a nil value) I continued reading setTimer wiki page, and i found this: arguments: Any arguments you wish to pass to the function can be listed after the timesToExecute argument. Note that any tables you want to pass will get cloned, whereas metatables and functions/function references in that passed table will get lost. Also changes you make in the original table before the function gets called won't get transferred. So, im coming to you guys, hoping you have a possible solution for this. Thanks for your time
  11. I need some help on: dxDrawText Code: local screenWidth, screenHeight = guiGetScreenSize () local playerRadioChannel = getRadioChannelName(getRadioChannel()) function stationDraw(station) dxDrawText ( playerRadioChannel, screenWidth, screenHeight - 155, screenWidth - 66, screenHeight, tocolor ( 135, 96, 45, 255 ), 1.5, "bankgothic", "right" ) end addEventHandler("onClientPlayerRadioSwitch", getLocalPlayer(), stationDraw) I want the text having border, and staying uppercase, how? I do not know. How can I make it stay on screen for a few seconds and then disappear? I think we should use this: setTimer Thanks for everything!