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: value)
1. attempt to index local 'result' (a boolean value)
Siema, mam taki problem, doda?em si? do SAPD w mysql i gdy klikam rozpocznij sluzbe pojawia si? w debugscript zebym sprawdzil linijke 42 w s.duty_lua attempt to index local 'result' (a boolean value)

W 42 linijce:

Kod:

local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SAPD", sid)
if result[1] then
2. attempt to call global 'guiCreateWindow' (a nil value)
takie co? mi wyskoczy?o i nie wiem co zrobi? wszystko jest ok, ale jak uruchamiam skrypt taki oto komunikat


okno 
guiCreateWindow(0.360.420.200.07"nazwa"true)
3. attempt to get lenght of global 'q' (a boolean value)
Witam, ma kto? pomys? co dok?adnie powinienem zrobi?? B??d wywala na tej linijce: if #q < 1 then
Kod:

q=exports["pystories-db"]:dbSet("select ownerid,koszt,id from lss_domy where id=?", domid)
if #q < 1 then
client:outputChat("Wyst?pi? b??d, nie znaleziono takiego domu!", 255, 0, 0)
return
end
4. attempt to call global 'playSound' (a nil value)
my?l? i my?l? jak zrobi? by nie wywala?o wciska?em wsz?dzie ju?
attempt to call global 'playSound' (a nil value)

[lua]addCommandHandler("b", function(plr,cmd,cel,x,bantype,...)
if BWADMIN(plr,3) or BWADMIN(plr,2) or BWADMIN(plr,1) or BWADMIN(plr,5) or BWADMIN(plr,4) or BWADMIN(plr,7) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(x) or not bantype or not reason then
--outputChatBox("#007aff(ⓘ) #FFFFFFU?ycie: /b <nick/ID> <ilo??> <m/h/d> <pow?d>", plr, 255,255,255, true)
triggerClientEvent(plr, 'onClientAddNotification', plr, "U?ycie: /b <nick/ID> <ilo??> <m/h/d> <pow?d>nm - Minuty h - Godziny d - Dni ", 'info')
return
end
local target=exports["bw-core"]:findPlayer(plr,cel)
if not target then
triggerClientEvent(plr, 'onClientAddNotification', plr, "Nie znaleziono podanego gracza.", 'error')
return
end
if (BWADMIN(plr,7) == false) and BWADMIN(target,7) then return end
if target then
local muza = playSound("ban.mp3") return
end
--reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
if bantype=="m" or bantype=="h" or bantype=="d" then
if bantype=="m" then
exports["bw-db"]:bazaustaw("INSERT INTO bw_zbanowanij (serial,reason,time,type) VALUES (?,?,NOW() +...
5. attempt to index local 'getnajwyzszydim' (a nil value)
mam problem z kodem 27 linia local dim=split(getnajwyzszydim.intdim_wnetrza,",")

[lua]addCommandHandler("adddomek2",
function(plr,cmd,cena,miejsca_parkingowe,id_interioru,id_garazu,pozycja_wyjscia)
if not iswlasciciel(plr) and (getElementData(plr,"dbid")~=1) then
return
end
if not cena or not tonumber(cena) or not miejsca_parkingowe or not id_interioru or not id_garazu then
exports["komunikaty"]:komunikat("/adddomek [cena] [miejsca_parkingowe] [id_interioru <0-23>] [id_garazu] [x,y,z_wyjscia]", plr)
return
end
local z_i=nil
for i,v in ipairs(inside) do
if (tonumber(id_interioru)==i) then
z_i=v
end
end
if not z_i then
exports["komunikaty"]:komunikat("Nieprawid?owy identyfikator interioru.", plr)
return
end
local pozycja=string.format("%s,%s,%s", z_i.poz[1], z_i.poz[2], z_i.poz[3])
if not pozycja_wyjscia then
local px,py,pz=getElementPosition(plr)
pozycja_wyjscia=string.format("%s,%s,%s", px,py,pz)
end
local pozycja_markera=string.format("%s,%s,%s", z_i.marker_wejscie[1], z_i.marker_wejscie[2], z_i.marker_wejscie[3])
local getnajwyzszydim=exports.DB:pobierzWyniki("SELECT intdim_wnetrza FROM domy ORDER BY id DESC LIMIT 1")
local dim=split(getnajwyzszydim.intdim_wnetrza,",")
dim=tonumber(dim[2])
dim=dim+1
addDomek(plr,cena,miejsca_parkingowe,pozycja,z_i....
6. skrypty/s.lua:90 attempt to index filed '?' (a nil value)
ERROR: skrypty/s.lua:90 attempt to index filed '?' (a nil value)

function load_magazynier_table()
    
local q exports.MXL_dbb:mysql_query("select * from MXL_users order by punkty_magazynier desc")
    
local ranking_table = {}

    for 
1,do
>>>
90        table.insert(ranking_tableq[i]["login"]..": "..q[i]["punkty_magazynier"].." punkt?w")
    
end

    
return ranking_table
end
7. attempt to call global 'guiCreateWindow' (a nil value)
DB 3 pokazuje error w 7 linijce :

Kod:

attempt to call global 'guiCreateWindow' (a nil value)



 local okno guiCreateWindow(0.350.290.300.43"Lista log?w serwerowych"true
8. attempt to perform arithmetic on local view a boolean value)

addEventHandler
("onClientRender",root,function ()
   if 
not isPedInVehicle(localPlayerthen return end
   local veh 
getPedOccupiedVehicle(localPlayer)
   
local sx,sy,sz getElementVelocity(veh)
   
local kmhs math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
   if 
kmhs >= 10 then
   local view 
getElementData(veh,"viewki")
        
local view view 0.015
        
if view >= 200 then return end
        local viewki 
setElementData(veh,"viewki",view)
        
setElementData(veh,"vehicle:desc","Mapa : [ "..string.format("%01d",view).." MB ]")
    
end
end
)
9. attempt to call global 'getAdmin' (a nil value)
Witam co? nie ??czy nie wiem o co chodzi pr?bowa?em co? zmienia? ale nie dzia?a.

B??d : ERROR: [skrypty]/YL-pojazdy/s_vehbuy.lua:278: attempt to call global 'getAdmin' (a nil value)


Skrypt:

addEventHandler
("onVehicleStartEnter"resourceRoot, function(plr,seat,jacked)
    if 
seat == 0 then
        local rent
=getElementData(source"vehicle:rent")
        
local group=getElementData(source"vehicle:ownedGroup")
        if 
group == "0" then group "Brak" end
        local player
=getElementData(source"vehicle:ownedPlayer")
        if (
getAdmin(plr,4)) then
            
return
        
end
        
if rent and (type(rent) == "table"then
            
for i,s in pairs(rent) do
                if 
tonumber(s) == getElementData(plr,"player:sid"then
                
return end
            end
        end
        
        local plrgroup 
getElementData(plr,"player:organization")
        if 
plrgroup then
            
if getSettings(plr,false,"organization") == group then return end
        end
        
if player and player ~= getSettings(plr,false,"owner"then
            outputChatBox
("* Nie posiadasz kluczyk?w do tego pojazdu."plr)
            
cancelEvent()
        
end
    end
end
)
10. attempt to call global 'mysql_connect' (a nil value)
Witam, mam problem z skryptem DB
Wyskakuje mi taki b?ad jak w temacie.
11. attempt to concatenate global (a nil value)
No wi?c 3 dni temu zacz??em nauk? j?zyka Lua (chc? w przysz?o?ci postawi? jaki? serwer MTA:SA) i postanowi?em na swoje pierwsze zadanie wykona? prost? prac? dowoziciela Pizzy. W pewnym momencie gracz musi stan?? w obr?bie markera, b?d?c na skuterze. I problem w tym, ?e mam problem ze sprawdzeniem tego - wyskakuje b??d.

Po stronie clienta za ka?dym razem, gdy wsi?dzie w jakikolwiek pojazd jest zapisywana zmienna z jego nazw?:

[lua]
function checkVehicles()
theVehicle = getPedOccupiedVehicle(source)
pojazd = getVehicleName(theVehicle)
end
addEventHandler("onClientPlayerVehicleEnter",getRootElement(),checkVehicles)
[/lua]


a po stronie serwera jest utworzony marker i funkcja przywo?uj?ca zmienn? pojazd (t? po stronie clienta):

[lua]
marker = createMarker(2101.810546875,-1806.984375,11.5546875, 'cylinder', 4.0, 255,100,0,100)

function MarkerHit( hitElement, matchingDimension )
local elementType = getElementType( hitElement )
outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 )
outputChatBox("pojazd: "..pojazd)
end
addEventHandler( "onMarkerHit", marker, MarkerHit )
[/lua]


No i przy wej?ciu w marker w okienku czatu, ?e player wszed? w marker, przy wjechaniu skuterem, wyskakuje ?e player i vehicle - co jest wporzadku. Problem jest z t? dan? pojazd. W konsoli przy ka?dym wej?ciu w marker pojawia si? komunikat:

ERROR: mojserverscript.lua:66: attempt to concatenate glo...
12. [MySQL] Połączenie bazy danych (a nil value)
M?j problem wygl?da na b??dzie po??czenia MySQL tzn
Kod:

ERROR: [skrypty_glowne]/ogrpg-db/s_db.lua:53: attempt to call global 'mysql_connect' (a nil value)

Nie mam poj?cia w czym jest problem, wszystko jest po??czone tak jak nale?y lecz nie wiem z jakiego powodu wyskakuje ten b??d.. Za pomoc PIWO :D
13. attempt to call global (a nill value)
Wywala b??d z: attempt to call global 'setDevelopmentMode' (a nill value)

Kod:
addCommandHandler"dev",
function ()
    
setDevelopmentMode true )
end
)

Kto? pomo?e? ;x
14. attempt to index field '?' (a nil value)
Mam tak? komende i ona poprawnie nie dzia?a w logach wyskakuje taki b??d
server.lua:288: attempt to index field '?' (a nil value)






addCommandHandler
("kp",
function(
plr,cmd,car_id)
    
local car_idtonumber(car_id)
    
local PrivCarOwner getElementData(PrivCarSystem.DATA[player_id].vehicle,"PrivOwnerCar") --tutaj jest nick gracza (288 linijka)
    
local players getPlayerFromName(PrivCarOwner)
    
setElementData(players ,"PrivCarId"0)
end)
15. Debugging (a nil value)
Runtime error at line -1:.....logowaniec_logo.lua:23. attempt to call global 'getRootElement' (a nil value). Podobny error po stronie serwera w 1 linijce. Nie dzia?a r?wnie? triggering - my?la?em z godzink? i za nic nie wiem co jest nie tak.
CLIENT:
[code]GUIEditor = {
window = {},
button = {},
label = {},
edit ={}
}

function pokazLogowanie()
GUIEditor.window[1] = guiCreateWindow(150, 169, 996, 417, "Panel Logowania", false)
guiWindowSetMovable(GUIEditor.window[1], false)
guiWindowSetSizable(GUIEditor.window[1], false)
button = guiCreateButton(823, 341, 153, 66, "Zaloguj", false, GUIEditor.window[1])
GUIEditor.button[1] = guiCreateButton(19, 341, 153, 66, "Rejestracja", false, GUIEditor.window[1])
GUIEditor.edit[1] = guiCreateEdit(532, 193, 228, 26, "", false, GUIEditor.window[1])
GUIEditor.edit[2] = guiCreateEdit(532, 235, 228, 26, "", false, GUIEditor.window[1])
GUIEditor.label[1] = guiCreateLabel(485, 200, 37, 19, "Login:", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(484, 239, 38, 16, "Haslo:", false, GUIEditor.window[1])
GUIEditor.label[3] = guiCreateLabel(390, 170, 384, 19, "Witaj na serwerze Sunny RolePlay! Wpisz login oraz haslo i zacznij gre!", false, GUIEditor.window[1])
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
addEventHandler("onClientGUIClick", bu...
16. Attempt to concatenate global ... (a userdata value)
Witam wszystkich !! !

Gdy m?j skrypt rozwo?enia towar?w "poszed? do naprawy", postanowi?em napisa? w?asn? frakcj? policji, ze wszystkim (wi?zienie, spawn, brama) w jednym skrypcie.

Ale wyskakuje mi b??d Attempt to concatenate global 'jailPlayer' (a userdata value), dok?adnie w tej linijce:

Kod:

outputChatBox("Gracz " .. jailPlayer .. " zosta? uwi?ziony za z?e zachowanie!", getRootElement(), 0, 0, 255, true)


Kod:


function jail ( thePlayer, command, niedouczony )
jailPlayer = getPlayerFromName(niedouczony)
if ( isObjectInACLGroup ( "user." .. getAccountName (getPlayerAccount (thePlayer) ), aclGetGroup ( "Policja" ) ) ) then
if jailPlayer then
setElementInterior(jailPlayer, 6)
setElementPosition(jailPlayer, 264.24, 77.55, 1001.82)
outputChatBox("Zosta?e? uwi?ziony za z?e zachowanie!", jailPlayer, 0, 0, 255, true)
outputChatBox("Gracz " .. jailPlayer .. " zosta? uwi?ziony za z?e zachowanie!", getRootElement(), 0, 0, 255, true)
setTimer ( function()
outputChatBox ( "5 second delay text!" )
end, 5000, 1 )
else
outputChatBox("Z?y nick!", thePlayer, 0, 0, 255, true)
end
else
outputChatBox("Nie jeste? pracownikiem Policji!", player)
end
end
addCommandHandler("jail", jail)