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: end
1. jakis end
bindKey("mouse1""down", function()
    if 
not getElementData(localPlayer"gui:prezencik") or getElementData(localPlayer"gui:prezencik") ~= true then return end
        
if isMouseIn(404*px447*py632*px485*pythen
            
if getElementData(localPlayer"prezencik"then outputChatBox("Odebra?e? ju? sw?j prezent"25500) return end
                money 
givePlayerMoney(25)
                
outputChatBox("Odbierasz prezent w wysoko?ci ..money.."02550)
                
showCursor(false)
                
setElementData(localPlayer"gui:prezencik"nil)
                
setElementData(localPlayer"prezencik"true)
            
end
        end
    end

     
if isMouseIn(404*px495*py632*px533*pythen
        
if getElementData(localPlayer"prezencik"then
            setElementData
(localPlayer"prezencik"nil
            
outputChatBox("zzzzzz"255,0,0)
            
showCursor(false)
            
setElementData(localPlayer"gui:prezencik"nil)
        else
            
showCursor(false)
            
setElementData(localPlayer"gui:prezencik"nil)
        
end
    end
end 


Wed?ug mta brakuje endu
https://media.discordapp.net/attachments/842322501455314974/920605705285820446/unknown.png
2. c.lua:137: 'end' expected (to close 'if' at line 133) near '
Witam czego nie zamkn??em?

addEventHandler("onClientClick"root, function(btn,state)
    
local screenWscreenH guiGetScreenSize()
    if 
btn=="left" and state=="down" then
        
if isMouseIn(46931111948)  then
            
if getElementDatalocalPlayer"player:srp" ) < 2500 then
                
return outputChatBox("&#10008; #FFFFFFNie posiadasz wymaganej reputacji. (2500 SRP)"localPlayer25500true)
            
                elseif 
hajs 250000 then
                  
return outputChatBox("&#10008; #FFFFFFNie posiadasz wymaganej got?wki. (250,000$)"localPlayer25500truethen
                    takePlayerMoney
(localPlayer,250000then
                    outputChatBox
("&#10003; #FFFFFFZakupi?e?/a? bro? AK-47"localPlayer711220true)
                    
triggerServerEvent("ak47"localPlayer, function()
                
end
            end
        end
    end
end
)


DB3: c.lua:137: 'end' expected (to close 'if' at line 133) near 'then'
3. END
Siema, mam taki kod:
[lua]
addEvent("addAccount", true)
function register(username, password)
local getUserNameFromDb = exports["db_connect"]:query("SELECT UserName FROM Users WHERE UserName='"..username.."'", true)
if(getUserNameFromDb==false) then
if(username~="" or username~=nil or string.find(username, " ") ==nil) then
if(password~="" or password~=nil or string.find(password, " ")==nil) then
exports["db_connect"]:query("INSERT INTO Users(UserName, Password, Level) VALUES('"..username.."','"..password.."', 0)", false)
triggerClientEvent("showError", source, "Zarejestrowa?e? si?")
end else triggerClientEvent("showError", source, "Has?o nie mo?e by? pusteni nie mo?e zawiera? spacji")
end else triggerClientEvent("showError", source, "Nazwa u?ytkownika nie mo?e by? pustani nie mo?e zawiera? spacji")
end else triggerClientEvent("showError", source, "Nazwa u?ytkownika zaj?ta")
end
addEventHandler("addAccount", resourceRoot, register)
[/lua]
I generalnie to powinno wszystko chodzi?. S? endy do if?w, jest end do funkcji. No ale nie dzia?a! Pisze ?ebym dostawi? ifa w linicje 38, natomiast, je?li go dostawie, to pisze, ?e jest on zb?dny. No zara mnie szlag trafi. Kto? jakie? pro...
4. Witam, jak zrobić return end i do niego odpowiedz
Witam, pisz? z zapytaniem w jaki spos?b mam doda? odpowiedz do return end'a na dole dam przyk?ad.

----
dupa = true

function ()
if dupa == false then return end -- i tu chce da? do tego odpowiedz gdy robi si? return end
5. Czym się różni end a end)
Czym si? r??ni end a end)
6. Zakończenia end proszę
[lua]local m_dostep="mechanik-sf1"
local m_maluje=false
local m=createMarker(2058.35, -1834.84, 13.55-1, "cylinder", 1.5,255,215,0,75)
local m2=createMarker(2058.35, -1832.64, 13.55-1, "cylinder", 1.5,255,215,0,75)
local m3=createMarker(2058.35, -1830.4, 13.55-1, "cylinder", 1.5,255,215,0,75)
local m4=createMarker(2058.35, -1828.25, 13.55-1, "cylinder", 1.5,255,215,0,75)
local cs=createColCuboid( 2053.32, -1837.13, 12, 18,11,10)

local t=createElement("text")
setElementData(t,"name","LakiernianKolor 1")
setElementData(t,"scale",0.9)
setElementPosition(t,2058.35, -1834.84, 13.55+1)
local t2=createElement("text")
setElementData(t2,"name","LakiernianKolor 2")
setElementData(t2,"scale",0.9)
setElementPosition(t2,2058.27, -1832.64, 13.55+1)
local t3=createElement("text")
setElementData(t3,"name","LakiernianFelgin[PREMIUM,PREMIUM+]")
setElementData(t3,"scale",0.9)
setElementPosition(t3,2058.19, -1830.4, 13.55+1)
local t4=createElement("text")
setElementData(t4,"name","LakiernianRanty Felgn[PREMIUM,PREMIUM+]")
setElementData(t4,"scale",0.9)
setElementPosition(t4,2058.16, -1828.25, 13.55+1)


-- Functions
addEventHandler("onClientColShapeHit", cs, function(el,md)
if not md or el~=localPlay...
7. ')' expected (to close '(' at line 131) near 'end'
            addEventHandler("onClientMarkerHit"markerList, function(hit)
                if 
hit ~= localPlayer then return end
                
if isPedInVehicle(localPlayerthen 
                outputChatBox
("Nie mo?esz siedzie? w poje?dzie!"25500) return end
                zrobione 
zrobione+1
                destroyElement
(source)
                
destroyElement(blipList)
                            
local pieniadz math.random(10200)
                                  
local pos math.random(1,#items2)
                                          
eq:insertItem('items[pos][1]'1)
                          
triggerServerEvent("giveMoney"localPlayerpieniadz)
end
 end
                
if zrobione == #punktyListonosza then
                        
setElementData(localPlayer"praca"nil)
                    return
                
end
                            end
            end
)
            
end

Za pomoc resp + piwo , nie wiem proboje dodawac end ale nadal wciaz ten sam blad
8. end
Witam, czy m?g?by mi kto? pom?c wstawi? 'end' aby kod dzia?a?, error z db3: https://imgur.com/Lz046fc
Za pomoc stawiam :piwo: :D
[lua]local sound = {}

function updateEngineSound()
local allVehicles = getElementsByType("vehicle")
for index, veh in ipairs (allVehicles) do
for _,v in pairs(getElementsByType("vehicle")) do
local model = getElementModel(veh)
if model == 494 then
if getElementData(v, "vehicle:id") == 678 then
if getVehicleEngineState(veh) then
if isElement(sound[veh]) then
local gear = getVehicleCurrentGear ( veh ) or 1
local velocityX, velocityY, velocityZ = getElementVelocity(veh)
local actualspeed = ((velocityX^2 + velocityY^2 + velocityZ^2)^(0.5)) * ((11 - gear) /10)
local mph = actualspeed * 70 * 111.847
local minSoundSpeed = 0.20
local soundSpeed = mph/(1000+1000/minSoundSpeed) + minSoundSpeed
setSoundSpeed (sound[veh], soundSpeed)
else
local x, y, z = getElementPosition(veh)
sound[veh] = playSound3D("sounds/engine.wav", x, y, z, true)
attachElements(sound[veh], veh)
end
else
if isElement(sound[veh]) then
destroyElement(sound[veh])
...
9. 'end' expected (to close 'function' at line 172) near 'kliki
[lua]
bindKey("mouse1", "down", function()
if kliki > 99 then
setElementData(localPlayer, "mozna:klikac:drwal", false)
kliki = 0
end
end)
addEventHandler("onClientMarkerHit", markerNapad , function()
triggerServerEvent("giveMoney", localPlayer, pieniadz)
exports["np-notyfikacje"]:noti(" wykonano: "..kasa.."$")
local kasa = math.random(10, 200)
return
gui(localPlayer)
kliki = kliki+1
end
return
end)
[/lua]
i jeszcze gui mi si? nie wy?wietla po wej?ciu w marker

[lua]
function gui()
setElementData(localPlayer, "mozna:klikac:drwal", true)
if kliki > 99 then return end
addEventHandler("onClientRender", root, function()
if not getElementData(localPlayer, "mozna:klikac:drwal") then return end
dxDrawText("Klikaj, aby rozwali? maszynen"..kliki.."/100", (288-1)*px, (253-1)*py, (766-1)*px, (435-1)*py, tocolor(0, 0, 0, 255), 3.00*px, "default-bold", "center", "top", false, false, false, false, false)
dxDrawText("Klikaj, aby ?ci?? drzewon"..kliki.."/100", (288+1)*px, (253-1)*py, (766+1)*px, (435-1)*py, tocolor(0, 0, 0, 255), 3.00*px, "default-bold", "center", "top", false, false, false, false, false)
dxDrawText("Klikaj, aby ?ci...
10. ')' expected (to close '(' at line 170) near end
bindKey("mouse1""down", function()
    if 
kliki 99 then
            setElementData
(localPlayer"mozna:klikac:drwal"false)
            
kliki 0
            end
        addEventHandler
("onClientMarkerHit"markerDrzewo, function(hit)
gui()
    
kliki kliki+1
    
return
end)


linijka 170

            end


Za pomoc daj? rep i piwko
11. 'end' excepted (to close 'if' function at line 20) '<eof&
function login(playercommand)
if 
getAdmin then
    
if not getElementData(thePlayer"player:admin"then
        setElementData
(thePlayer"player:admin")
        
triggerClientEvent("create:noti"thePlayer"Zalogowa?e? si? na duty")
    else
        if 
getElementData(thePlayer"player:admin"then
            player
:removedata("player:admin")
            
triggerClientEvent("create:noti"thePlayer"Wylogowa?e? si? z duty")
        
end
    end

 addCommandHandler
("duty"login)
12. End end end....
D?ugo pr?buje to naprawi? ale nic, Wywala db3 Unexpected symbol near '<eof>' b?d? co? podobnego. Podpowiem, ?e jest to linijka 9

local groupName 'PSP';
local vehicles = { [433] = true, [482] = true, [490] = true, [487] = true, [407] = true, [544] = true, [546] = true, [528] = true;

addEventHandler("onVehicleStartEnter"root, function(playerseatjacked)
    if (
vehicles[source.model]) and (not isObjectInACLGroup('user.'..player.account.nameACLGroup.get(groupName))) then
        cancelEvent
()
        
player:outputChat('Nie jeste? w '..groupName);
    
end
end
);
13. End end end....
D?ugo pr?buje to naprawi? ale nic, Wywala db3 Unexpected symbol near '<eof>' b?d? co? podobnego. Podpowiem, ?e jest to linijka 9

local groupName 'PSP';
local vehicles = { [433] = true, [482] = true, [490] = true, [487] = true, [407] = true, [544] = true, [546] = true, [528] = true;

addEventHandler("onVehicleStartEnter"root, function(playerseatjacked)
    if (
vehicles[source.model]) and (not isObjectInACLGroup('user.'..player.account.nameACLGroup.get(groupName))) then
        cancelEvent
()
        
player:outputChat('Nie jeste? w '..groupName);
    
end
end
);
14. end
Witam mam problem bo jak doda?em mal? zmianke w skrypcie to mi wywala b?ad taki :
expected near end mo?e kto? mi powiedzie? co ten b??d oznacza ?
15. Kompilowanie i unexcepted end in precompiled chunk
Witam kompiluje skrypt w kompilatorze i wyskakuja 2 b?edy i wtedy client side nei dzia??
b?edy to


is not coded in UTF-8
i
unexcepted end in precompiled chunk

O co chodzi
?
U?ywam sposobou z -o cos.format cos.lua