Xyrusek
socialproject.pl - LUA dev
Wiek: 26 Na forum: 3492 dni Posty: 21
Nick w MP: Xyrusek
Piwa : 430
Witam, mam oto taki kod:
Kod: addEventHandler( "onElementClicked", getRootElement(), function(button, state, localPlayer)
if button == "left" and state == "down" then
if getElementType(source) == "vehicle" then
if not isPedInVehicle(localPlayer) then
local x,y,z = getElementPosition(localPlayer)
local x1,y1,z1 = getElementPosition(source)
local distance = getDistanceBetweenPoints3D(x, y, z, x1, y1, z1)
if distance < 4 then
if getElementData(localPlayer, "plr:naprawki") > 0 then
setPedAnimation(localPlayer, "CASINO", "dealone", -1, true, false)
local fix = setTimer(function()
setPedAnimation(localPlayer, false)
fixVehicle(getRootElement())
setElementData(localPlayer, "plr:naprawki", getElementData(localPlayer, "plr:naprawki")-1)
end, 5000, 0)
killTimer(fix)
end
end
end
end
end
end)
Lecz mam problem, gdy? nie wiem jak zrobi?, aby timer wykona? si? jedynie 1 raz. Z g?ry dzi?kuj? i mog? zaoferowa? piwko