local veh = getPedOccupiedVehicle(localPlayer)
speedx, speedy, speedz = getElementVelocity ( veh )
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
kmh = actualspeed * 180
function Inicio (element)
if element == localPlayer then
if (kmh) <= 20 then --Si es menor o igual a 20Km/h
if veh then
setElementFrozen ( veh, true ) --freez
if timer then killTimer(timer) timer = nil end
timer = setTimer(SiguienteMarker, 3000, 1) --Que freeze, espere 3 segundos y siga el otro marker
end
end
end
El problema es que no funciona el "If (kmh) <= 20 then, al poner eso directamente me deja de funcionar todo, alguien sabe porqué?
Lo que quiero es que solo se active cuando el jugador Toque el marker y a menos de 20km/h con su vehiculo y recien ahi freeze al jugador y cuente para luego crear otro marker..