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: local
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. Local Chat
Witam, chcia?bym stworzy? localchat na serwer lecz totalnie nie wiem jak sie do tego zabra?. Chcia?bym aby ten chat dzia?a? normalnie jak ten na Freeroamie tylko ?eby zmiejszy? range do 100. Jakby da?o rade to prosi?bym o gotowy kod. Z g?ry dzi?kuje!
3. local

local vehicles
=getElementsWithinColShape(kubojd,"vehicle")
        if 
#vehicles > 0 then
                    
exports['ec_noti']:noti('Wyjazd jest zablokowany!',"error",2000,source)
                return
        
end

kolejny b??d (strona c) blad: attempt to get lenght of global "vehicles"(a boolean value)
4. local panel ()
Czemu nadaje mi linijka czwarta
czyli dok?adnie to errory : local panel ()

daje tu skrawek tej funkcji
Kod:

local panel ()
widok = guiCreateStaticImage(332, 169, 937 563, "files/gui.png")
showCursor(true) -- myszka
napisgui = guiCreateLabel( 339, 272, 92, 30, "JAKIS TESTOWY NAPIS", false)
addEventHandler("onClientGUIClick", napisgui, mgiris false)
end
addCommandHandler("panel", panel)
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. local xmlFile = xmlLoadFile(xmlFileName)
Witam pobra?em paczk? TPR z tego forum i zmagam si? z problemem ze strony panelu logowania/rejstracji.

Z g?ry przepraszam za tytu?, ale nie wiem jak to inaczej okre?li?.

B??d

ERROR
: login_panel/c.lua:342: stack overflow



Ca?a funkcja

-- XML File Handler
function xmlFileHandler(gReturn)
    
local xmlFile = xmlLoadFile(xmlFileName) -- TUTAJ JEST B??D
    
if not xmlFile then
        xmlFile 
= xmlCreateFile(xmlFileName,"settings")
        
xmlNodeSetAttribute(xmlFile,"autologin","false")
    
end
    xmlNodeSetAttribute
(xmlFile,"username",tostring(guiGetText(editUsername)))
    
xmlNodeSetAttribute(xmlFile,"password",tostring(guiGetText(editPassword)))
    
xmlSaveFile(xmlFile)
    
xmlUnloadFile(xmlFile)
    if (
gReturn) then
        
if (gReturn == true) then
            loginPanel
()
        else
            return
        
end
    end
end
7. Jak zmienic local allowed
Witam nie wiem jak przeniesc syrene PSP bo jest tam jakis dziwny kod
local allowed = {{48, 57}, {65, 90}, {97, 122}}
8. attempt to perform arithmetic on local view a boolean value)

addEventHandler
("onClientRender",root,function ()
   if 
not isPedInVehicle(localPlayer) then 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. [MTA] skryptami na local serwer
Witam mam problem ze skryptami na lokalnym serwerze. Wgrywam skrypty na localny serwer i wpisuje w konsoli refresh all i nic nie wypisuje,?e zosta? dodany skrypt nawet w konsoli f8 wpisuje refresh all i tez nic nie. Wpisuje refresh all nie /refresh all

[ Dodano: 2018-03-04, 22:41 ]
Tak jestem zarejestrowany i mam w acl panel admina
10. local jobVehicle
Prosi?bym o wyt?umaczenie z opisem o co w tym chodzi:
local jobVehicle={448, -1807.43, 944.79, 24.49, 359.47, 0.00, 139.94}
11. Local Chat
Witam mam skrypt z internetu na local chat i chcia?em go przerobi? ale mam problem z tym ze nick powinien przybiera? kolor teamu danego gracza.


s.lua


chat_range
=100
 
addEventHandler
("onPlayerJoin",getRootElement(),
function ()
bindKey(source,"l","down","chatbox","Local")
end)
 
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
function ()
for 
index, player in pairs(getElementsByType("player")) do
bindKey(player,"l","down","chatbox","Local")
  
end
end
)
 
function 
isPlayerInRangeOfPoint(player,x,y,z,range)
   
local px,py,pz=getElementPosition(player)
   return ((
x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range
end
 
function onChat(player,_,...)
  
local pteam = getPlayerTeam (player)  
  
local tr,tg,tb = getTeamColor (pteam)
  
local px,py,pz=getElementPosition(player)
  
local msg = table.concat({...}, " ")
  
local nick = getPlayerName(player)
    
  
local r,g,b = getTeamColor(getPlayerTeam(player))
  for 
_,v in ipairs(getElementsByType("player")) do
    if 
isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then
      outputChatBox
("#787878(Local) ".."#tr,tg,tb"..nick,v,r,g,b,true)(msg,v,r,g,b,true)
    
end
  end
end
addCommandHandler
("Local",onChat)