Siemka pisze do was z takim zapytaniem czy ktos by tutaj ogarnal by ktos to ?e jak wchodze w marker gui si? wyswietla wszystkim na serwerze, ale chcialbym zeby wyswietlal si? tylko mi.
Za pomoc daje piwko
GUIEditor = {
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(0.22, 0.34, 0.13, 0.33, "Panel", true)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.72)
GUIEditor.button[2] = guiCreateButton(10, 137, 147, 47, "Zamknij okno", false, GUIEditor.window[1])
end
)
addEventHandler("onClientResourceStart",resourceRoot,
function()
guiSetVisible(GUIEditor.window[1],false)
end
)
function spod()
for i,v in ipairs(Marker) do
ta(v,rodzaj);
x, y, z = getElementPosition(v)
dxDrawOctagon3D(x,y,z+0.1, 0.8, 2, tocolor(0,0,255,150) )
end
end
addEventHandler("onClientRender", getRootElement(), spod)
function ta(TheElement,Image,distance,height,width,R,G,B,alpha)
local x, y, z = getElementPosition(TheElement)
local x2, y2, z2 = getElementPosition(localPlayer)
local distance = distance or 20
local height = height or 1
local width = width or 1
local checkBuildings = checkBuildings or true
local checkVehicles = checkVehicles or false
local checkPeds = checkPeds or false
local checkObjects = checkObjects or true
local checkDummies = checkDummies or true
local seeThroughStuff = seeThroughStuff or false
local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
local ignoredElement = ignoredElement or nil
if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
local sx, sy = getScreenFromWorldPosition(x, y, z+height)
if(sx) and (sy) then
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if(distanceBetweenPoints < distance) then
dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
end
end
end
end
function dxDrawOctagon3D(x, y, z, radius, width, color)
if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then
return false
end
local radius = radius or 1
local radius2 = radius/math.sqrt(2)
local width = width or 1
local color = color or tocolor(255,255,255,255)
point = {}
for i=1,8 do
point[i] = {}
end
point[1].x = x
point[1].y = y-radius
point[2].x = x+radius2
point[2].y = y-radius2
point[3].x = x+radius
point[3].y = y
point[4].x = x+radius2
point[4].y = y+radius2
point[5].x = x
point[5].y = y+radius
point[6].x = x-radius2
point[6].y = y+radius2
point[7].x = x-radius
point[7].y = y
point[8].x = x-radius2
point[8].y = y-radius2
for i=1,8 do
if i ~= 8 then
x, y, z, x2, y2, z2 = point[i].x,point[i].y,z,point[i+1].x,point[i+1].y,z
else
x, y, z, x2, y2, z2 = point[i].x,point[i].y,z,point[1].x,point[1].y,z
end
dxDrawLine3D(x, y, z, x2, y2, z2, color, width)
end
return true
end
Marker = {}
rodzaj = dxCreateTexture("img/wejscie.png")
Marker[1] = createMarker(-1957.88, 278.81, 35.47-1, "cylinder", 1, 255, 185, 0, 0 )
Marker[2] = createMarker(363.2216796875,-74.926208496094,1001.5078125-1, "cylinder", 1, 255, 185, 0, 0)
createMarker(-1957.88, 278.81, 35.47+0.30, "corona", 1, 0, 0, 255, 155)
createMarker(363.2216796875,-74.926208496094,1001.5078125+0.30, "corona", 1, 0, 255, 0, 155)
setElementInterior(Marker[1],10)
setElementDimension(Marker[1], 1)
function poka()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addEventHandler("onClientMarkerHit",Marker[1], poka)
function poka2()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addEventHandler("onClientMarkerHit",Marker[2], poka2)
function zamykamy()
if source ~= GUIEditor.button[2] then return end
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
addEventHandler ( "onClientGUIClick", root, zamykamy)
|