Javier Posted January 9, 2013 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
GTX Posted January 9, 2013 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)
Javier Posted January 9, 2013 Author 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
Javier Posted January 9, 2013 Author 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)
MR.S3D Posted January 9, 2013 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
Castillo Posted January 9, 2013 Posted January 9, 2013 Would be better if the timer was of 1 second, not half.
TAPL Posted January 9, 2013 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 )
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