Javier Posted January 9, 2013 Share Posted January 9, 2013 Hii friend , help me with this function message () local hour, minutes = getTime() if (hour >= 20 and minutes == 30 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement()) end end addEventHandler("onResourceStart", message) --- Nueva Linea function info () local hour, minutes = getTime() if (hour >= 6 and minutes == 0 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement()) end end addEventHandler("onResourceStart", info) No it does not work, seems to be okay but i do not know. Thanks Link to comment
GTX Posted January 9, 2013 Share Posted January 9, 2013 function message () local hour, minutes = getTime() if (hour >= 20 and minutes == 30 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement()) end end addEventHandler("onResourceStart", resourceRoot, message) --- Nueva Linea function info () local hour, minutes = getTime() if (hour >= 6 and minutes == 0 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement()) end end addEventHandler("onResourceStart", resourceRoot, info) Link to comment
Javier Posted January 9, 2013 Author Share Posted January 9, 2013 function message () local hour, minutes = getTime() if (hour >= 20 and minutes == 30 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement()) end end addEventHandler("onResourceStart", resourceRoot, message) --- Nueva Linea function info () local hour, minutes = getTime() if (hour >= 6 and minutes == 0 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement()) end end addEventHandler("onResourceStart", resourceRoot, info) try the client side and the server, but does not work Link to comment
AhmadQTR Posted January 9, 2013 Share Posted January 9, 2013 What dosen't work exactly? Link to comment
TAPL Posted January 9, 2013 Share Posted January 9, 2013 Use a timer instead of the event. Link to comment
Javier Posted January 9, 2013 Author Share Posted January 9, 2013 Use a timer instead of the event. So? function message () local hour, minutes = getTime() if (hour >= 20 and minutes == 30 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement()) end end setTimer(message, 500, 1) function info () local hour, minutes = getTime() if (hour >= 6 and minutes == 0 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement()) end end setTimer(info, 500, 1) Link to comment
TAPL Posted January 9, 2013 Share Posted January 9, 2013 Nope, make it infinite timer. Link to comment
MR.S3D Posted January 9, 2013 Share Posted January 9, 2013 function message () local hour, minutes = getTime() if (hour >= 20 and minutes == 30 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement(), 255, 0, 0 ) elseif (hour >= 6 and minutes == 0 ) then outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement(), 255, 0, 0 ) end end setTimer(message, 500, 0) --- 0 it infinite timer Link to comment
Castillo Posted January 9, 2013 Share Posted January 9, 2013 Would be better if the timer was of 1 second, not half. Link to comment
TAPL Posted January 9, 2013 Share Posted January 9, 2013 Don't forget to enable colorCoded. outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement(), 255, 0, 0 ) outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement(), 255, 0, 0 ) Will be: outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: La Noche Comenzo.", getRootElement(), 255, 0, 0, true ) outputChatBox("#D21D1D[Reporte #D21D1DMilitar]: Ah amanecido. #F2184BHora #F5F5FF06:00", getRootElement(), 255, 0, 0, true ) Link to comment
Javier Posted January 10, 2013 Author Share Posted January 10, 2013 Oh! thanks to all. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now