Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: zamkn±æ
1. Zamkn±æ
Co w tym kodzie jest nie tak?
Ca?y czas w debugu wyskakuj? mi b??dy z linijk? 76, 78 i 117..


[code]

attached_ped = {}
attached_bone = {}
attached_x = {}
attached_y = {}
attached_z = {}
attached_rx = {}
attached_ry = {}
attached_rz = {}

function attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz)
if not (isElement(element) and isElement(ped)) then return false end
if getElementType(ped) ~= "ped" and getElementType(ped) ~= "player" then return false end
bone = tonumber(bone)
if not bone or bone < 1 or bone > 20 then return false end
x,y,z,rx,ry,rz = tonumber(x) or 0,tonumber(y) or 0,tonumber(z) or 0,tonumber(rx) or 0,tonumber(ry) or 0,tonumber(rz) or 0
attached_ped[element] = ped
attached_bone[element] = bone
attached_x[element] = x
attached_y[element] = y
attached_z[element] = z
attached_rx[element] = rx
attached_ry[element] = ry
attached_rz[element] = rz
if setElementCollisionsEnabled then
setElementCollisionsEnabled(element,false)
end
if script_serverside then
triggerClientEvent("boneAttach_attach",root,element,ped,bone,x,y,z,rx,ry,rz)
end
return true
end

function detachElementFromBone(element)
if not element then return false end
if not attached_ped[element] then return false end
clearAttachmentData(element)
if setElementCollisionsEnabled then
setElementCollisionsEnabled(element,true)
end
if script_serverside then
triggerClientEvent("boneAttach_detach",root,element)
end
retu...
2. Zamkn±æ
Witam co tutaj jest nie tak? Chcia?bym by moje zombie na serwerze potrafi?y skaka?. Odwdzi?cz? si? za pomoc!


[code]

checkZombies = function()
for i,ped in ipairs(getElementsByType("ped",root,true)) do
if getElementData(ped, "zombie") then
local x,y,z = getElementPosition ( localPlayer )
local zx,zy,zz = getElementPosition (ped)
local zfrontx, zfronty, zfrontz = getPositionInfrontOfElement(ped, 3)

local vect1X, vect1Y = zx-x, zy-z
local vect2X, vect2Y = zfrontx-zx, zfronty - zy

local scal = vect2X*vect1X+vect2Y*vect1Y

local distance = getDistanceBetweenPoints3D ( x,y,z, zx,zy,zz )
local sound = getElementData(getLocalPlayer(), "volume") / 5
local visibly = getElementData(getLocalPlayer(), "visibly") / 5
local ready = true
if ( distance > sound*1.2 + visibly*1.2 and scal <= 0 ) or ( distance > sound*1.4 + visibly*1.4 ) then -- Расстояние за которую он вас увидит и услышит (средне)
ready = false
end
if ready then
triggerServerEvent ( "chasedStartAttackC", getLocalPlayer(), ped )
end
end
end
end
setTimer(checkZombies, 2000, 0)
setElementData ( localPlayer, "spawnedzombies", 0 )


checkAnimal = function()
for i,pe...
3. Jak zamkn±æ GUI?
Mam problem z zamkni?ciem drugiego GUI.
Stworzy?em 2 GUI, pierwsze GUI dzia?a dobrze, jest guzik zamkni?cia oraz guzik przejscia do drugiego GUI. W drugim GUI mam guzik zamknij, kt?ry nie dzia?a.

[lua]local screenW, screenH = guiGetScreenSize()

function isCursorOnElement(x,y,w,h)
local mx,my = getCursorPosition ()
local fullx,fully = guiGetScreenSize()
cursorx,cursory = mx*fullx,my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end

hud = false
hud2 = false

function dxRender()
dxDrawRectangle(screenW * 0.3234, screenH * 0.3208, screenW * 0.3508, screenH * 0.3528, tocolor(0, 0, 0, 170), false)
dxDrawLine((screenW * 0.3547) - 1, (screenH * 0.5653) - 1, (screenW * 0.3547) - 1, screenH * 0.6292, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine(screenW * 0.4797, (screenH * 0.5653) - 1, (screenW * 0.3547) - 1, (screenH * 0.5653) - 1, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine((screenW * 0.3547) - 1, screenH * 0.6292, screenW * 0.4797, screenH * 0.6292, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine(screenW * 0.4797, screenH * 0.6292, screenW * 0.4797, (screenH * 0.5653) - 1, tocolor(255, 255, 255, 255), 1, false)
dxDrawRectangle(screenW * 0.3547, screenH * 0.5653, screenW * 0.1250, screenH * 0.0639, tocolor(0, 0, 0, 130), false)
dxDrawLine((screenW * 0.5180) - 1, (screenH * 0.5653) - 1,...
4. Jak zamkn±æ klikaj±c ponownie F4
Witam, mam kod, ?e pojawia mi si? okienko po klikni?ciu F4, jednak po ponownym klikni?ciu pojawia si? ono znowu (skoro nie ma zaprogramowane inaczej to logiczne) i si? buguje. Zamykam je aktualnie przyciskiem, kt?ry sobie zaprogramowa?em na klikni?cie go i zamkni?cie.

Tutaj jest kod, prosze o pomoc aby zrobi? tak, ?e po ponownym klikni?ciu F4 by si? to zamyka?o. D?uba?em ostatnio przy tym z 3-4 miesi?ce temu a zawsze by?em laikiem w LUA.

Kod:



function vip()
triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() ) -- tutaj albo getLocal.. albo samo localPlayer

end
bindKey("F4", "down", vip)

..tutaj jest srodek (usuniety) z event handlerami typowo zrobionymi pod funkcjonalno?? - nic wa?nego ..


playSound("button.mp3")
addEventHandler ( "onClientGUIClick", close,

function(hide)
guiSetVisible(painel, false)
showCursor(false)

end, false )
end
addEvent( "ShowVipPanel", true )
addEventHandler( "ShowVipPanel", getRootElement(), vip2)



5. Nie mogê zamkn±æ okna
[lua]addEvent("pokazPanelTuningu", true)
addEventHandler("pokazPanelTuningu", localPlayer, function(veh)
if not isElement(GUIEditor.window[1]) then
if getElementData(veh, "vehicle:spawn") then
showCursor(true)
veh1 = veh
setElementData(localPlayer, "tune:car", veh)
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow((screenW - 888) / 2, (screenH - 546) / 2, 888*width, 546*height, "---=== Tuningowanie pojazdu ===---", false)
guiWindowSetSizable(GUIEditor.window[1], false)
GUIEditor.button[1] = guiCreateButton(445*width, 484*height, 233*width, 52*height, "TUNINGUJnDEMONTUJ", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[2] = guiCreateButton(212*width, 484*height, 233*width, 52*height, "ZAMKNIJ OKNO", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
GUIEditor.gridlist[1] = guiCreateGridList(31*width, 41*height, 827*width, 390*height, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "ID CZESCI", 0.15)
guiGridListAddColumn(GUIEditor.gridlist[1], "TYP", 0.15)
guiGridListAddColumn(GUIEditor.gridlist[1], "AKCJA", 0.15)
guiGridListAddColumn(GUIEditor.gridlist[1], "KOSZT CZESCI", 0.15)
guiGridListAddColumn...