Hallo,
ich habe das Problem, das bei mir auf dem Server, leute mit sowas wie autoklicker,etc, schneller Bäume fällen.
Sie bekommen auch bis 22 Wood Piles statt 2.
Um ein Baum zu fällen, muss man mit einer "Hatchet" gegen ein Baum hauen, bis er umfällt.
Lua
function cutTree()
if getPedWeapon(getLocalPlayer()) == 8 then
local x, y, z = getElementPosition( localPlayer )
local sx,sy = getScreenFromWorldPosition(x, y, z)
local _, _, rz = getElementRotation( localPlayer )
local tx = x + - ( 1 ) * math.sin( math.rad( rz ) )
local ty = y + 1 * math.cos( math.rad( rz ) )
local tz = z
local hit, hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ, material, lighting, piece, worldID, worldX, worldY, worldZ, worldRX, worldRY, worldRZ, worldLODID = processLineOfSight( x, y, z, tx, ty, tz, true, false, false, true, true, false, false, false, localPlayer, true, false )
if hitElement and treelist[getElementModel(hitElement)] then
if getElementData(hitElement, "cutProcess") then
setElementData(hitElement, "cutProcess",getElementData(hitElement, "cutProcess")+2)
else
setElementData(hitElement, "cutProcess",0)
end
if getElementData(hitElement, "cutProcess") >= 360 then
triggerServerEvent( "onPlayerChopTree", localPlayer, hitElement)
end
end
end
end
Alles anzeigen
MFG David