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: endy
1. sypią endy
ca?y czas gdzie? mi sypie b??d

Kod:

function renderLoginText ()
if sy < 1049 then
x_3, y_3 = getCenter(400,-900)
else
x_3, y_3 = getCenter(400,-550)
end
k**** = false
if actual == 'login' then
if k**** == false then return end
local x_1, y_1 = getCenter(900,550); local x_4, y_4 = getCenter(-20,-50)
dxDrawImage(x_1, y_1, 900/zoom, 550/zoom, texture_text1, 0, 0, 0, tocolor(255, 255, 255, 255), false)
next31 = false
next3 = false
end
end
if actual == 'register' then
if k**** == false then return end
local x_1, y_1 = getCenter(900,550); local x_4, y_4 = getCenter(-20,-50)
dxDrawImage(x_1, y_1, 900/zoom, 550/zoom, texture_text1, 0, 0, 0, tocolor(255, 255, 255, 255), false)
next31 = false
next3 = false
end
end
end
end
2. END'y w kodzie
Witam, pisz?c jaki? kod zawsze mam problem ze wstawianiem end?w, nie raz dam dobrze, nie raz za ma?o, a nie raz za du?o, dlatego przybywam z pytaniem.

1. je?eli u?yje:

if getPlayerName (source) == "Kalizman" then

to za t? linijk? wy?ej jest jeden end?

2. a je?eli zaprzecz?:

if not getPlayerName (source) == "Kalizman" then return end

to za linijk? powy?ej nie przys?uguje ?aden end na ko?cu kodu, poniewa? u?y?em return, tak?

3. a jeszcze je?eli u?yj?:

if getPlayerName (source) == "Kalizman" then
source
:outputChat ("kalizman")
elseif 
getPlayerName (source) == "nikt" then
source
:outputChat ("nikt")
end

czy linijce elseif [...] przys?uguje si? jeszcze jeden end czy nie?
3. end'y
mam problem z end'ami db:
Kod:

Loading script failed: k-panel_pogodc_panel.lua:98: ')' expected (to close '(' at line 81) near 'end'


kod w ktorym jest db3:

addEventHandler
("onClientClick"root, function(btnstate)
  if 
btn == "left" and state == "down" then
    
if mysz (screenW 0.3978screenH 0.3932screenW 0.2000screenH 0.0417) and panel == true then
      triggerServerEvent
("pogoda:1"root) -- s?o?ce
    
elseif mysz (screenW 0.3985screenH 0.4401screenW 0.2000screenH 0.0417) and panel == true then
      triggerServerEvent
("pogoda:2"root) -- s?o?celekkie zachmurzenie
    
elseif mysz (screenW 0.3985screenH 0.4883screenW 0.2000screenH 0.0417) and panel == true then
      triggerServerEvent
("pogoda:3"root) -- burza
    
elseif mysz (screenW 0.3985screenH 0.5378screenW 0.2000screenH 0.0417) and panel == true then
      triggerServerEvent
("pogoda:4"root) -- mg?a
    
elseif mysz (screenW 0.3985screenH 0.5872screenW 0.2000screenH 0.0417) and panel == true then
      triggerServerEvent
("pogoda:5"root) -- s?o?ce
    
elseif mysz (screenW 0.3596screenH 0.6654screenW 0.2809screenH 0.0378) and panel == true then
      button
:closepanel () -- zamknij panel l 76
    end
  end
  end
end
)
4. endy
DB3:

ERROR: Loading script failed: wyrzucanie/kic.lua:15: ')' expected (to close '(' at line 1) near 'end'

Kod:

addCommandHandler
("akick", function(plr,cmd,target,...)
    
local account getPlayerAccount(plr)
    
local accname getAccountName(account)
    if 
isObjectInACLGroup("user."..accnameaclGetGroup("Administracja")) then
            local reason
=table.concat({...}, " ")
            if 
not target or not reason then
                outputChatBox
("* Uzyj: /akick nick/ID] [powod]"plr)
                return
            
end
            
if not target then outputChatBox("* Nie odnaleziono podanego gracza.",plr) return end
            outputChatBox
("* "..getPlayerName(target).." zostal/a wyrzucony/a przez: "..getPlayerName(plr)..": "..reasonroot25500)
            
kickPlayer(target,plr,reason)
        
end
    end
end
)


Stawiam piwa za poprawienie kodu
5. Endy !!
Witam robi? skrypt na alrmowanie stra?ak?w w markerze na ACL ale napotka? mni? problem ci?gle z endami...

client
marker createMarker(-2407.99634, -83.4914639.49400,"cylinder",1,255,0,0)

addEvent("mozna"true)
addEventHandler("mozna",getRootElement(),function()
dzwiek playSound3D"musica.mp3", -2393.85791, -105.5962840.49400 )
setSoundMaxDistance(dzwiek300)
end
)
end
addEventHandler
("onClientMarkerHit",marker,function()


server
  function alarm(plr)
  
triggerClientEvent(getRootElement(), "mozna",plr)
 
local accName getAccountName getPlayerAccount plr ) )
if 
isObjectInACLGroup ("user."..accNameaclGetGroup "PSP" ) ) then
 end
 end


a b??d
ERROR:Lodading script failed:alarm/client.lua:9: '<eof>' expected nera 'end'

Pr?bowa?em r??nymi metodami, np usuwa? ten ')" nic nie dawa?o, doda? end'a nic nie dawa?o :?
6. Endy
Witam, mam problem ze scoreboardem, a konkretniej z pozamykaniem wszystkich funkcji - co co? zmieni? to wywala inne b??dy z "endami" w DB3. M?g?by kto? rzuci? okiem i ogarn???

[spoiler][lua]local sw,sh = guiGetScreenSize()

function uruchomPanel()

dxDrawRectangle(248/1280*sw, 83/720*sh, 774/1280*sw, 38/720*sh, tocolor(0, 0, 0, 0), true)
dxDrawRectangle(249/1280*sw, 119/720*sh, 773/1280*sw, 36/720*sh, tocolor(0, 0, 0, 255), true)
dxDrawText(" Nazwa serwera", 258/1280*sw, 88/720*sh, 432/1280*sw, 115/720*sh, tocolor(255, 0, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)


dxDrawText("Nick", 419/1280*sw, 131/720*sh, 442/1280*sw, 145/720*sh, tocolor(0, 255, 0, 255), 1.00, "default", "left", "top", false, false, true, false, false)

dxDrawText("ID", 263/1280*sw, 129/720*sh, 276/1280*sw, 145/720*sh, tocolor(0, 255, 0, 255), 1.00, "default", "left", "top", false, false, true, false, false)
dxDrawText("gP", 577/1280*sw, 131/720*sh, 647/1280*sw, 145/720*sh, tocolor(0, 255, 0, 255), 1.00, "default", "left", "top", false, false, true, false, false)
dxDrawText("Poziom", 765/1280*sw, 131/720*sh, 804/1280*sw, 145/720*sh, tocolor(0, 255, 0, 255), 1.00, "default", "left", "top", false, false, true, false, false)
dxDrawText...