Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. --Recurso: MJ-Varios
  2. --Archivo: AFKServidor.lua
  3. --Proposito: Funcionamiento del sistema "AFK" en el modo de Race
  4. --Creado por Tomas Navarro (GamerCarl)
  5.  
  6. local estadorace = ""
  7. local mensajesA = true
  8. local colordetexto = "#1e90ff"
  9.  
  10. function mensajeAFK(tipomsg, tiempoafk)
  11. if(tipomsg == 1) then
  12. outputChatBox("#1e90ff* #FFFFFF".. getPlayerName(source).. "#1e90ff Ha muerto por el #FFFFFFANTI-AFK#1e90ff #1e90ff[#ABCDEF"..tiempoafk.."/3#1e90ff]",getRootElement(),255,255,255,true)
  13. elseif(tipomsg == 2) then
  14. outputChatBox("#1e90ff* #FFFFFF".. getPlayerName(source).. "#1e90ff Ha sido Expulsado por estar AFK por 3 Rondas!!!",getRootElement(),255,255,255,true)
  15. end
  16. end
  17. addEvent("afkADV", true)
  18. addEventHandler("afkADV", root, mensajeAFK)
  19.  
  20. function matarAFK()
  21. setElementHealth(source, 0)
  22. end
  23. addEvent("afkMuerte", true)
  24. addEventHandler("afkMuerte", root, matarAFK)
  25.  
  26. function cambiodeRACE(nuevoestado)
  27. estadorace = nuevoestado
  28. end
  29. addEvent("onRaceStateChanging", true)
  30. addEventHandler( "onRaceStateChanging", getRootElement(), cambiodeRACE)
  31.  
  32. function expulsarAFK(jugador)
  33. kickPlayer(jugador, "Has estado afk por 3 rondas de race!!!")
  34. end
  35. addEvent("ExpulsionAFK", true)
  36. addEventHandler("ExpulsionAFK", root, expulsarAFK)
  37.  
  38. function cargarcliente()
  39. local msgActivo = get( "msgActivo" )
  40. local msgColor = get( "msgColor" )
  41. if(msgActivo) then
  42. if(msgActivo == "true") then
  43. mensajeA = true
  44. else
  45. mensajeA = false
  46. end
  47. if(msgColor) then
  48. colordetexto = msgColor
  49. end
  50. end
  51. local tiempomaximo = get( "tiempoafkMAX" )
  52. local wtiempo = get( "tiempoWARN" )
  53. triggerClientEvent ( "onSettingsReady", getRootElement(), tiempomaximo, wtiempo)
  54. end
  55. addEvent("onClientLoaded", true)
  56. addEventHandler( "onClientLoaded", getRootElement(), cargarcliente)
  57.  
  58.  
  59. function volverdeAFK()
  60. outputChatBox(getPlayerName(source).. " #ffffffHa vuelto al teclado.", getRootElement(), 255,0,0,true)
  61. end
  62. addEvent("volverAFK", true)
  63. addEventHandler( "volverAFK", getRootElement(), volverdeAFK)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement