JuanM27 Posted June 8, 2012 Share Posted June 8, 2012 hola buenas noches.. aca tengo una pregunta, nose como hacer que el timer haga la funcion despues de 1 min. yo tengo asi, local Timer1 = setTimer ( triggerClientEvent(thePlayer,"Probocacion",thePlayer,Turf1MinutosPro),600000, 1) --1 min. pero asi como esta me envia el triggerClientEvent al comenzar el timer y yo quiero que cuando llegue al minuto recien envie el triggerClientEvent alguien sabe como seria? Link to comment
iFoReX Posted June 8, 2012 Share Posted June 8, 2012 (edited) setTimer ( function() triggerClientEvent(thePlayer,"Probocacion",thePlayer) end, 60000, 1 ) prueba con esto, para la otra usa lua tags Edited June 8, 2012 by Guest Link to comment
Castillo Posted June 8, 2012 Share Posted June 8, 2012 Pero si los timers ya funcionan asi... igual ese timer tuyo esta mal hecho. local Timer1 = setTimer ( triggerClientEvent, 60000, 1, thePlayer, "Probocacion", thePlayer, Turf1MinutosPro ) 60000 milisegundos = 1 minuto. Link to comment
JuanM27 Posted June 9, 2012 Author Share Posted June 9, 2012 y no existe alguna manara que ir contando, ejemplo que cada 1 min envie un mensaje?? por q la idea que tengo en mente es que cuente 5 minutos en total pero que cada 1 min le envie un mensaje al player Link to comment
Castillo Posted June 9, 2012 Share Posted June 9, 2012 Podes usar la funcion: getTimerDetails para saber cuanto tiempo falta. Link to comment
JuanM27 Posted June 9, 2012 Author Share Posted June 9, 2012 hola de nuevo tengo un error, local ProbocaTimer = setTimer ( function() if (Turf1MinutosPro ~= 10) then triggerClientEvent(thePlayer,"Probocacion",thePlayer,Turf1MinutosPro) Turf1MinutosPro = Turf1MinutosPro + 1 end,60000, 10 ) else killTimer(ProbocaTimer) setRadarAreaFlashing ( Turfs1, true ) end y en debugscript 3 me sale esto warning: loading script failed ...... : unexpeted symbol near ',' no entiendo por que.. por que si lo pongo asi, anda bien local ProbocaTimer = setTimer ( function() triggerClientEvent(thePlayer,"Probocacion",thePlayer,Turf1MinutosPro) Turf1MinutosPro = Turf1MinutosPro + 1 end,60000, 10 ) pero si le pongo un if me tira el error, alguien me puede explicar donde le estoy errando Link to comment
Castillo Posted June 9, 2012 Share Posted June 9, 2012 local ProbocaTimer = setTimer ( function ( ) if ( Turf1MinutosPro ~= 10 ) then triggerClientEvent ( thePlayer, "Probocacion", thePlayer, Turf1MinutosPro ) Turf1MinutosPro = ( Turf1MinutosPro + 1 ) else killTimer ( ProbocaTimer ) setRadarAreaFlashing ( Turfs1, true ) end end ,60000, 10 ) Link to comment
JuanM27 Posted June 9, 2012 Author Share Posted June 9, 2012 Muchas Gracias Solid hay me andubo joya Link to comment
JuanM27 Posted June 10, 2012 Author Share Posted June 10, 2012 hola de nuevo, sigo con esto y ahora se me presento 2 problemas mas... le comento primero no me funciona el killtimer. lo tengo asi, aver si alguien me puede dar una mano. local ProbocaTimer = setTimer ( function ( ) if ( Turf1MinutosPro ~= 11 ) then triggerClientEvent ( thePlayer, "Probocacion", thePlayer, Turf1MinutosPro ) Turf1MinutosPro = ( Turf1MinutosPro + 1 ) elseif (Turf1Titila ~= 1 ) then Turf1Titila = (Turf1Titila + 1) elseif (Turf1MinutosGur == 0 ) then triggerClientEvent ( thePlayer, "Declara", thePlayer, Turf1Due ) setRadarAreaFlashing ( Turfs1, true ) Turf1MinutosGur = ( Turf1MinutosGur + 1 ) elseif (Turf1MinutosGur ~= 11 ) then triggerClientEvent ( thePlayer, "Guerra", thePlayer, Turf1MinutosGur ) Turf1MinutosGur = ( Turf1MinutosGur + 1 ) elseif (Turf1MinutosGur == 11 ) then setRadarAreaColor ( Turfs1, 255, 0, 0, 100 ) setRadarAreaFlashing ( Turfs1, false ) if (isTimer(ProbocaTimer)) then killTimer (ProbocaTimer) end Turf1MinutosGur = 0 Turf1Titila = 0 Turf1MinutosPro = 0 end end ,15000, 24 ) y el otro problema que tengo es que nose como hacer para que a todos los jugadores que estemos en ese turf (area) nos cuente por iguales osea si estoy yo solo me cuenta de 1 en 1 como tiene que ser, pero si somos 2 por ejemplo. en los mensajes me cuenta en 2 en 2 ejemplo me dice .... 2/10 y despues me dice 4/10 pero igual eso es lo de menos por ahora... me interesa mas el tema de como parar el time.. saludos Link to comment
Castillo Posted June 10, 2012 Share Posted June 10, 2012 Podes usar esta funcion para obtener los jugadores dentro de un colshape: https://wiki.multitheftauto.com/wiki/Get ... inColShape Link to comment
Recommended Posts