Como es serverside no te dará problema así que no haría falta esa función dentro del timer.
addCommandHandler( 'fc',
function( uPlayer )
if isPedInVehicle( uPlayer ) then
local uVehicle = getPedOccupiedVehicle( uPlayer )
if uVehicle then
outputChatBox("Tu vehiculo cambiará de color ramdom", source, 255, 0, 0)
setVehicleColor (uVehicle, math.random(255), math.random(255), math.random(255))
setVehicleHeadLightColor (uVehicle, math.random(255), math.random(255), math.random(255))
end
end
end)
Eso no tiene nada que ver.
@Slash14, utiliza esto:
timer_v = {}
addCommandHandler( 'fc',
function( uPlayer )
if isPedInVehicle( uPlayer ) then
local uVehicle = getPedOccupiedVehicle( uPlayer )
if uVehicle then
outputChatBox("Tu vehiculo cambiará de color ramdom", source, 255, 0, 0)
timer_v[uVehicle] = setTimer ( function(vehicle)
if ( not isElement(vehicle) ) then killTimer(timer_v[vehicle]) end
setVehicleColor (vehicle, math.random(255), math.random(255), math.random(255))
setVehicleHeadLightColor (vehicle, math.random(255), math.random(255), math.random(255))
end, 100, 0, uVehicle )
end
end
end)