Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-03-06, 14:37


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Prosz? o pomoc poniewa? nie mog? usuwac report?w zrobi?em ju? zeby sie wyswietla?y na ekranie lecz nie mog? zrobi? usuwania


function cmd_cl(plr,cmd,id,...)
  if (not idthen
    outputChatBox("U?yj: /cl <id/nick> <powod>"plr)
    return
  end


  local powod=table.concat(arg" ")
  if (string.len(powod)<2then
    outputChatBox("U?yj: /cl <id/nick> <powod>"plr)
    return
  end

  local target=exports["czaty"]:findPlayer(plr,id)
  local opis="?"
  if (targetthen
    id=getElementData(target,"id")
    opis=getPlayerName(target)
  end

  reportView(tonumber(id))
  local supportLogin=getElementData(plr"admin:addText")
  msgToSupport(supportLogin .. " usun??/??a raport na " .. opis .. "/".. id .. ": " .. powod)
end
addCommandHandler("cl"cmd_clfalsefalse)


db3
Kod:

[2017-03-06 14] ERROR: [Administracja]/admins-pol/reports.lua:49: attempt to call global 'reportView' (a nil value)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 15:05


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

polaczkos, co to jest reportView(tonumber(id)) masz t? funkcje zdefiniowan??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 16:49


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

jest to z wy?wietlania

addEvent("admin:removeReport"true)
addEventHandler("admin:removeReport"root, function(id)
    for i=#reportView, 1, -1 do
        if (reportView[i][2] and reportView[i][2] == idthen -- Znaczniki ?le pokazujpowinno bysamo i w nawiasach kwadratowych
            table.remove(reportView,i)
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 16:59


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Podaj ca?y kod bo nie wiem ju? czy to tabela czy funkcja.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 20:40


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

tutaj jest system reportow

function cmd_raport(plrcmdid, ...)
  if (not idthen
    outputChatBox("U?yj: /raport <id/nick> <powod>"plr)
    return
  end
  local target=getElementByID("id"..id)
  local target=exports["czaty"]:findPlayer(plr,id)
  if (not targetthen
    outputChatBox("Nie odnaleziono gracza o podanym ID."plr)
    return
  end
  local opis=table.concat(arg" ")
  
    local report=('Report> %s(%d) zg?osi? %s(%d) za %s'):format(getPlayerName(plr),getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), opis)
      triggerClientEvent(root"admin:addReport"rootreport)
  outputChatBox("Zg?oszenie zosta?o wys?ane." plr)
end

addCommandHandler("raport"cmd_raportfalse,false)
addCommandHandler("report"cmd_raportfalse,false)

function cmd_cl(plr,cmd,id,...)
  if (not idthen
    outputChatBox("U?yj: /cl <id/nick> <powod>"plr)
    return
  end


  local powod=table.concat(arg" ")
  if (string.len(powod)<2then
    outputChatBox("U?yj: /cl <id/nick> <powod>"plr)
    return
  end

  local target=exports["czaty"]:findPlayer(plr,id)
  local opis="?"
  if (targetthen
    id=getElementData(target,"id")
    opis=getPlayerName(target)
  end

  reportView(tonumber(id))
  local supportLogin=getElementData(plr"admin:addText")
  msgToSupport(supportLogin .. " usun??/??a raport na " .. opis .. "/".. id .. ": " .. powod)
end
addCommandHandler("cl"cmd_clfalsefalse)


atu jest wyswietlanie

local xtext=nil
local gameView={"Logi serwerowe"}
local reportView={"Lista raport?w"}
local sx,sy=guiGetScreenSize()

addEventHandler("onClientRender"root, function()
    if getElementData(localPlayer,"duty"then
    concat=table.concat(gameView"\n")
    dxDrawText(concatsx*(10+1)/1024sy*(279+1)/768sx*(326+1)/1024sy*(497+1)/768tocolor(000255), 1.00"default""left""top"falsetrue)
    dxDrawText(concatsx*(10)/1024sy*(279)/768sx*(326)/1024sy*(497)/768white1.00"default""left""top"falsetrue)
end
end)

function renderingInfo()
dxDrawRectangle(sx*(258)/1024sy*(0)/768sx*(500)/1024sy*(23)/768tocolor(000155), false)
    dxDrawText(xtextsx*(258+1)/1024sy*(0+1)/768sx*(758+1)/1024sy*(23+1)/768tocolor(000255), 1.00"default""center""center"falsetrue)
    dxDrawText(xtextsx*(258)/1024sy*(0)/768sx*(758)/1024sy*(23)/768tocolor(25500255), 1.00"default""center""center"falsetrue)
end

addEventHandler("onClientRender"root, function()
   if getElementData(localPlayer,"duty"then
    local tt={}
    for i,v in ipairs(reportView) do
        if v[1then table.insert(tt,v[1]) end
    end
    concat=table.concat(tt"\n")
    dxDrawText(concatsx*(698+1)/1024sy*(278+1)/768sx*(1014+1)/1024sy*(496+1)/768tocolor(000255), 1.00"default""right""top"falsetrue)
    dxDrawText(concatsx*(698)/1024sy*(278)/768sx*(1014)/1024sy*(496)/768tocolor(255255255255), 1.00"default""right""top"falsetrue)
end
end)

addEvent("admin:addText"true)
addEventHandler("admin:addText"root, function(text)
    table.insert(gameViewtext)    
    if #gameView > 10 then
        table.remove(gameView1)
    end
end)

addEvent("admin:addReport"true)
addEventHandler("admin:addReport"root, function(text,id)
    table.insert(reportView, {text,id})
    if #reportView > 10 then
        table.remove(reportView1)
    end
end)


addEvent("admin:removeReport"true)
addEventHandler("admin:removeReport"root, function(id)
    for i=#reportView, 1, -1 do
        if (reportView[i][2] and reportView[i][2] == idthen -- Znaczniki ?le pokazujpowinno bysamo i w nawiasach kwadratowych
            table.remove(reportView,i)
        end
    end
end)

addEvent("admin:rendering"true)
addEventHandler("admin:rendering"root, function(text)
    xtext=text
    addEventHandler("onClientRender"rootrenderingInfo)
    setTimer(function()
        removeEventHandler("onClientRender"rootrenderingInfo)
    end50001)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 21:06


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

polaczkos, zobacz
addEvent("admin:removeReport"true)
addEventHandler("admin:removeReport"root, function(id)
    for i=1#reportView do
        if (reportView[i][2] and reportView[i][2] == idthen
            table.remove(reportView,i)
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-10, 14:39


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Dalej ten sam b?ad

[code]2017-03-06 14] ERROR: [Administracja]/admins-pol/reports.lua:49: attempt to call global 'reportView' (a nil value)
[code]

[ Dodano: 2017-03-12, 10:31 ]
Pomo?e kto? ?

[ Dodano: 2017-03-20, 20:31 ]
Ref

Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: reportó
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku