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: przyciski
1. przyciski
Hej, mam tego typu zagwozdk?
https://imgur.com/a/48MuiVu

    dxDrawText
(txtx+1y+1w+1h+1tocolor(000), 1fontxxyyfalseclipedfalseg1) ---86
    dxDrawText
(txtxywhcolor1fontxxyyfalseclipedfalseg1) --- 87
2. jak zrobić przyciski w gui
Witam aktualnie ucz? si? robienia Gui po wej?ciu w marker oraz po klikni?ciu w przycisk przyk?adowo daje auto i jestem na etapie wy?wietlenia gui w markerze a jakiej funkcji mam u?y? aby po klikn?ciu w dany przycisk dawa?o auto dodam ?e robi? to wszystko na dxdrawimage nie klasycznym guieditorze
3. Logowanko Przyciski
Witam ot??, jak klikam przycisk ZAREJESTRUJ SI?, nie rejestruje oto kod b??du, z gui itd wszystko git sprawdza?em 10razy. B?ad z DB3
Kod:

c_side attempt to compare nil with number


Tutaj kod w kt?rym jest b??d
function isMouseIn(pscreenW,pscreenH,psscreenW,psscreenH,abx,aby)
    if 
not isCursorShowing() then return end
    cx
,cy=getCursorPosition()
    
cx,cy=cx*screenW,cy*screenH
    
if cx >= pscreenW and cx <= pscreenW+psscreenW and cy >= pscreenH and cy <= pscreenH+psscreenH then
        
return true,cx,cy
    
else
        return 
false
    end
end

a tutaj linijka w kt?rej DB3 wykrywa b??d
    if cx >= pscreenW and cx <= pscreenW+psscreenW and cy >= pscreenH and cy <= pscreenH+psscreenH then

Prosi?bym o szybk? pomoc.
4. Niedziałające przyciski
Witam ot?? mam niedzia?aj?ce przyciski, gui si? wy?wietla lecz przycisk nie dzia?a
kod
[lua]local screenW, screenH = guiGetScreenSize()

local marker=createMarker(-1811.35, 1195.68, -27.95-0.955, "cylinder", 1, 255, 80, 0)
setElementDimension(marker, 1)
setElementInterior(marker, 1)

local t=createElement("text")
setElementPosition(t,-1811.35, 1195.68, -27.95+1.5)
setElementData(t,"name","Przepisywanie pojazd?wnna organizacj?")
setElementDimension(t, 1)
setElementInterior(t, 1)

przepisywanie = false

function mysz(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end

local wm={}
wm.gridlist=guiCreateGridList(0.28, 0.37, 0.45, 0.22, true)
guiGridListAddColumn(wm.gridlist, "ID", 0.3)
guiGridListAddColumn(wm.gridlist, "Nazwa", 0.3)
guiGridListAddColumn(wm.gridlist, "Organizacja", 0.3)
guiSetVisible(wm.gridlist, false)
guiSetAlpha(wm.gridlist, 0.8)
guiSetFont(wm.gridlist, "default-bold-small")

addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if przepisywanie == true then
if mysz(screenW * 0.2792, screenH * 0.6037, screenW * 0.0818, screenH * 0.0370) then
...
5. Przyciski dxDraw
Witajcie ot?? mam problem jak wykonywa? przyciski w dxDraw aby ?e tak powiem da?o si? je klikn?? i np wywo?a? interpolateBetween? Z g?ry dzi?ki
6. jak zrobić działające przyciski GUI?
Cze??, wiecie jak tu zrobic by te przyciski dzia?a?y w te dwa sposoby?:
1. Torba PSP R-1 mo?na by?o wykona? skrypt: [lua]function weztorba (plr)
local login = getAccountName(getPlayerAccount(plr))
if isObjectInACLGroup("user."..login,aclGetGroup("torba", plr)) then
local auto = getPedOccupiedVehicle(plr)
if isPedInVehicle(plr) then
if (getElementModel(auto) == 416) or (getElementModel(auto) == 427) or (getElementModel(auto) == 407) then
local torba = createObject(1210, 0, 0, 0, 0, 0, 0)
setElementData ( plr, "torba", torba)
exports.bone_attach:attachElementToBone(torba,plr,12,0,0.1,0.3,0,180,0)
outputChatBox("** Bierzesz torb? medyczn?", plr)
outputChatBox("** "..login.." wyci?ga torb? medyczn? z pojazdu", root)
end
end
end
end
addCommandHandler("torba", weztorba)
-------------------------------------------------
function odloztorbe(plr)
local login = getAccountName(getPlayerAccount(plr))
if isObjectInACLGroup ("user."..login, aclGetGroup ( "torba" ) ) then
local auto = getPedOccupiedVehicle(plr)
if isPedInVehicle(plr) then
if (getElementModel(auto) == 416) or (getElementModel(auto) == 427) or (getElementModel(auto) == 407) then
local torba = getElementData ( plr, "torba")
destroyElement(torba)
outputChatBox("** Chowasz torb? medyczn?", plr)
outputChatBox("** "..login.." chowa torb? medyczn? do pojazdu", root)
end
end...
7. Przyciski w gui
Witam zrobi?em gui nowe i mam tylko problem w client

Bad argument @'addEvendHandler' Expected element at argument 2, got nil]
linijki:98,90,81,73,65

kod:

[lua]
GUIEditor = {
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(339, 179, 499, 460, "", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.83)

GUIEditor.button[1] = guiCreateButton(25, 37, 115, 58, "MK-1 Przy?pieszenie", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[2] = guiCreateButton(140, 37, 113, 58, "MK-1 Pr?dko??", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[3] = guiCreateButton(261, 38, 220, 57, "Demont", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[4] = guiCreateButton(25, 103, 115, 51, "MK-2 Przy?pieszenie", false, GUIEditor.window[1])
guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA")
GUIEditor.button[5] = guiCreateButton(138, 103, 115, 51, "MK-2 Pr?dko??", false, GUIEditor.window[1])
...