Witam , mam problem, gdy? mam prace sweepera, kt?ry jest prawie na ka?dym serwerze tak? sam? jak na Its Your World. Liczy ona po 1 kg, a ja chcia?bym zrobi? ?eby liczy?o po 0.01 kg . Jak to zrobi? ?
Za pomoc piwko i respekt
CLIENT:
[lua]local czas = getTickCount()
function speeed(car)
local a1,b1,c1 = getElementVelocity(car)
local fast = ((a1^2+b1^2+c1^2)^(0.5) *180)
return fast
end
local code="Sweepers" -- kod pracy
tekstury = {
[0] = true,
[1] = true,
[2] = true,
}
function render(pojazd)
local x,y,z = getElementPosition(pojazd)
fxAddWaterSplash (x,y,z-1.9)
if (getTickCount() - czas) < 6000 then return end
czas = getTickCount()
--if (not isVehicleOnGround(pojazd)) then outputDebugString("ground FALSE") return end
if speeed(pojazd) < 30 then return end
ziemia = getGroundPosition(x,y,z) - 0.001
hit,_,_,_,_,_,_,_,material,_,target = processLineOfSight (x,y,z, x, y, ziemia,true, false, true, true, false, true )
if hit == false then
--outputDebugString("HIT FALSE")
return end
if (not tekstury[material]) then
--outputDebugString("MATERIAL FALSE")
return end
local smiecie = getElementData(pojazd,"vehicle:trash")
local kg = math.random(0.8,1.2)
if not getElementData(localPlayer,"player:premium") then
limit = 200
else
limit = 250
end
if smiecie >= limit then return end
setElementData(pojazd,"vehicle:trash",smiecie+kg)
setElementData(pojazd,"veh... |