LPM//Bruno Posted June 2, 2014 Share Posted June 2, 2014 Hola a todos cómo estan? Tengo un problema con el resource "colorlights" que lo descargue de la Community. Ya estoy loco, probe de todo, hice de todo, y aun sigue dandome errores. El error es el siguiente, el script funciona, pero en el server.log deja el siguiente mensaje muchisimas veces: WARNING: colorlights\server.lua:26: Bad 'vehicle' pointer @ 'setVehicleHeadLightColor'(1) De este modo el archivo "server.log" se llena mucho y ocupa mucho espacio, me llegó a ocupar 3.7GB de datos con ese comando. Lo descargo asi directamente de la community, lo instalo asi como viene y sigue dandome errores. Link del resource en la community: https://community.multitheftauto.com/index.php?p=resources&s=details&id=331 Espero que puedan ayudarme, saludos y gracias. Link to comment
BorderLine Posted June 2, 2014 Share Posted June 2, 2014 intenta reemplazando esto function ( playerVehicle ) setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end por esto function ( playerVehicle ) if playerVehicle then setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end Link to comment
BorderLine Posted June 2, 2014 Share Posted June 2, 2014 falto un end function ( playerVehicle ) if playerVehicle then setVehicleHeadLightColor( playerVehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end end Link to comment
LPM//Bruno Posted June 2, 2014 Author Share Posted June 2, 2014 Sigue dandome el error | El server.log ya pesa 10MB y el resource lo inicié hace 2 minutos. [2014-06-02 18:52:44] WARNING: colorlights\server.lua:27: Bad 'vehicle' pointer @ 'setVehicleHeadLightColor'(1) Link to comment
Tomas Posted June 3, 2014 Share Posted June 3, 2014 Probá así: function Disco(player,command) vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function () setVehicleHeadLightColor( vehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end Link to comment
LPM//Bruno Posted June 3, 2014 Author Share Posted June 3, 2014 Probá así: function Disco(player,command) vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function () setVehicleHeadLightColor( vehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0, vehicle ) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end El server.log sigue dandome los errores Link to comment
LPM//Bruno Posted June 4, 2014 Author Share Posted June 4, 2014 El error es el mismo? Sí, es el mismo. Link to comment
Tomas Posted June 5, 2014 Share Posted June 5, 2014 function Disco(player,command) vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function () setVehicleHeadLightColor( vehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end Link to comment
LPM//Bruno Posted June 5, 2014 Author Share Posted June 5, 2014 function Disco(player,command) vehicle = getPedOccupiedVehicle(player) if (vehicle) then if discoState[player] == false then discoState[player] = true discoTimer[player] = setTimer( function () setVehicleHeadLightColor( vehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end , 100, 0) outputChatBox( "!!Disco-Fever!!", player, 0, 255, 0 ) else if discoTimer[player] then killTimer( discoTimer[player] ) discoTimer[player] = nil discoState[player] = false setVehicleHeadLightColor( vehicle, 255, 255, 255 ) end end else outputChatBox( "!!You have to sit in a Car/Bike!!", player, 255, 0, 0 ) end end Ya no me ha dado problemas. ¡Muchas gracias Tomás! Link to comment
Tomas Posted June 5, 2014 Share Posted June 5, 2014 De nada, era un mal argumento del setTimer. Suerte! Link to comment
LPM//Bruno Posted June 9, 2014 Author Share Posted June 9, 2014 De nada, era un mal argumento del setTimer. Suerte! Men luego de unos dias yo no entre a la carpeta "logs" pero se me dio por entrar a ver los logs y me veo con que el archivo server.log pesa 4GB y lo abri y tdo dice: [2014-06-08 22:09:09] WARNING: colorlights\server.lua:28: Bad 'vehicle' pointer @ 'setVehicleHeadLightColor'(1) Podrias ayudarme nuevamente? Link to comment
Tomas Posted June 11, 2014 Share Posted June 11, 2014 Necesito saber en qué momento es que eso pasa Link to comment
LPM//Bruno Posted June 15, 2014 Author Share Posted June 15, 2014 Necesito saber en qué momento es que eso pasa Creo que cuando el comando es activado por 2 o más personas. Link to comment
Recommended Posts