Hallo, liebe Comounity wieder melde ich mich (wie immer) mit einen Problem, und zwar beim script meines Tempomat´s,
Ich habe folgendes Problem, dass das Auto nicht automatisch gefahren wird, was ich aber will,
Ich hoffe ihr könntet mir etwas weiterhelfen Hier der Code :
(Clientseitig)
Lua
function tempomat ()
local localp = getLocalPlayer()
local veh = getPedOccupiedVehicle(localp)
if veh then
local sx, sy, sz = getElementVelocity(veh)
if isTimer(tmptimer) then killTimer(tmptimer) outputChatBox("Tempomat erfolgreich entfernt!", 125, 0, 0) return end
local kmh = math.sqrt(sx^2 + sy^2 + sz^2) * 100 * 1.8
outputChatBox("Tempomat auf:"..kmh.." km/h gesetzt!", 0, 125, 0)
tmptimer = setTimer(function(veh, sz)
if not getVehicleOccupant(veh) then killTimer(tmptimer) return end
local sx1, sy1, sz1 = getElementVelocity(veh)
setElementVelocity(veh, sx1, sy1, sz)
end, 400, -1, veh, sz)
end
end
addCommandHandler("tempomat", tempomat)
Alles anzeigen
LG,
Waynenator