mam problem poniewa? nie daje ko?a.
[code]local punkty_brania_kol={
-- {-2042.60,162.87,28.84-0.9,1.5, faction_id=3}, --idlewood
}
local warsztatyid = {
[3]=true,
}
for i,v in ipairs(punkty_brania_kol) do
v.marker=createMarker(v[1],v[2],v[3],"cylinder", v[4], 0,0,0,100)
setElementData(v.marker, "braniekola", true)
setElementData(v.marker, "faction:id", v.faction_id)
end
local function czyPracownikWarsztatu(gracz)
local lfid=getElementData(gracz,"faction:id") or -1
if not warsztatyid[lfid] then return false end
return true
end
local function najblizszeKolo(gracz,pojazd)
-- easy peasy
local xg,yg,zg=getElementPosition(gracz)
local najblizszeKolo=nil
local najblizszeDist=1000
local x,y,z=getElementPosition(pojazd)
local _,_,rz=getElementRotation(pojazd)
for i=1,4 do
local rrz=math.rad(rz+45+(i-1)*90)
local x= x + (1 * math.sin(-rrz))
local y= y + (1 * math.cos(-rrz))
if not najblizszeKolo or getDistanceBetweenPoints2D(x,y,xg,yg)<najblizszeDist then
najblizszeDist=getDistanceBetweenPoints2D(x,y,xg,yg)
najblizszeKolo=i
end
end
-- ugly
if not najblizszeKolo then return nil end
if najblizszeKolo==4 then return 3
elseif najblizszeKolo==3 then return 4 end
return najblizszeKolo
end
local function zalozKolo(plr)
local x,y,z=getElementPosition(plr)
local _,_,rz=getElementRotation(plr)
local rrz=math.ra... |