Prosz? pom?c tu macie Clinet:
[lua]local sw,sh = guiGetScreenSize()
local elements = {}
-------------------------------------------
function isEventHandlerAdded(sEventName,pElementAttachedTo,func)
if type(sEventName)=='string' and isElement(pElementAttachedTo) and type(func)=='function' then local aAttachedFunctions = getEventHandlers(sEventName,pElementAttachedTo)
if type(aAttachedFunctions)=='table' and #aAttachedFunctions > 0 then for i,v in ipairs(aAttachedFunctions) do if v==func then return true end end end
end return false
end
-------------------------------------------
function checkButtons(pcl)
if (pcl==localPlayer) then
for _,v in ipairs(elements) do
if isElement(v) then
destroyElement(v)
end
end
showCursor(false)
if isEventHandlerAdded("onClientRender",root,onRender) then
removeEventHandler("onClientRender",root,onRender)
end
end
end
function showButtons(pcl)
if (pcl==localPlayer) then
checkButtons(pcl)
showCursor(true)
addEventHandler("onClientRender",root,onRender)
elements[1]=guiCreateButton(sw/2-(190/2),sh/2+80,190,50,"rozpocznij prace[1]",false)
elements[2]=guiCreateButton(sw/2+300-25,sh/2+150-20,25,20,"zamknij[1]",false)
for _,v in ipairs(elements) do if isElement(v) then guiSetAlpha(v,0) end end
end
end
function onRender()
dxDrawImage(s... |