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

Wysłany: 2016-03-01, 18:59


Snapig

Amator LUA






Wiek: 28
Na forum: 3793 dni
Posty: 43
Nick w MP: Rother

Piwa: 129

Respekt: 50

Ostrzeżeń: 20%
Hej pomozecie mi z tak zwanym "uchem" poniewaz no nie chce dzialac pokazu jedna zecz tylko ze "Zasow lss-admin zostal zrestartowany i tyle a nie chce pokazac tego co pisza kod

 
local text_display=textCreateDisplay()
local gameViewtextCreateTextItem ""0.010.3"medium"255,255,255,255,1,"left","top",255)
local reportView=textCreateTextItem""0.990.7"low"255,255,255,255,1,"right","top",255)
--textitem textCreateTextItem string textfloat xfloat y, [string priorityint red 255int green 0int blue 0int alpha 255float scale 1string alignX "left"string alignY "top"int shadowAlpha 0] )

textDisplayAddText text_displaygameView )
textDisplayAddText text_displayreportView )

local gameView_contents={ "Zas?b lss-admin zosta? zrestartowany" }
local reportView_contents={}

local time getRealTime()

local tn=string.format("%04d%02d%02d%02d%02d%02d-%02d.txt"time.year+1900time.monthtime.monthdaytime.hourtime.minutetime.secondmath.random(1,99))

local fh=fileCreate("logi/"..tn)
--fileClose(fh)

function outputLog(text)
  if (text and fhthen
    local time getRealTime()
    local ts=string.format("%04d%02d%02d%02d%02d%02d> "time.year+1900time.monthtime.monthdaytime.hourtime.minutetime.second)
    fileWrite(fhts..text.."\n")
    fileFlush(fh)
  end
end

outputLog("Logowanie rozpocz?te")


for i,v in ipairs(getElementsByType("player")) do
    local accName getAccountName getPlayerAccount ) )
    if accName and (isObjectInACLGroup ("user."..accNameaclGetGroup "Support" ) ) or isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) )) then
      textDisplayAddObserver text_display)
    end
end


function refresh_td()
  local tresc=table.concat(gameView_contents,"\n")
  textItemSetText gameViewtresc )
  local tt={}
  for i,v in ipairs(reportView_contents) do
      if (v[1]) then
          table.insert(tt,v[1])
      end
  end
  tresc=table.concat(tt,"\n")
  textItemSetText reportViewtresc )
end


function gameView_add(text)
  outputLog(text)
  table.insert(gameView_contents,text)
  if (#gameView_contents>10) then
    table.remove(gameView_contents,1)
  end
  refresh_td()
end

function reportView_remove(id)
  for i=#reportView_contents,1,-1 do --in ipairs(reportView_contents) do
    if (reportView_contents[i][2] and reportView_contents[i][2]==idthen
      table.remove(reportView_contents,i)
    end
  end
end

function reportView_add(text,id)
    if (string.len(text)>0then
      outputLog("RAPORT " .. text)
    end
  table.insert(reportView_contents,{text,id})
  if (#reportView_contents>10) then
    table.remove(reportView_contents,1)
  end
  refresh_td()
end

--setTimer(function()
--    reportView_add("")
--end5*60000,0)


addEventHandler("onPlayerQuit"root, function()
  local id=getElementData(source,"id")
  if (id and tonumber(id)) then
    reportView_remove(tonumber(id))
  end
end)

addEventHandler("onPlayerLogin"root,  function()
    local accName getAccountName getPlayerAccount source ) )
    if accName and isObjectInACLGroup ("user."..accNameaclGetGroup "Support" ) ) then
      textDisplayAddObserver text_displaysource )
      gameView_add("### " .. accName .. " zalogowa?/a si?.")
      setElementData(source,"admin:rank",1)
    elseif accName and isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
      textDisplayAddObserver text_displaysource )
    end

end)

addEventHandler("onPlayerLogout"root,  function(acc)
  accName=getAccountNameacc )
  if (textDisplayIsObserver(text_displaysource)) then
      textDisplayRemoveObserver text_displaysource )
--      gameView_add("### " .. accName .. " wylogowa?/a si?.")
      removeElementData(source,"admin:rank")
  end
end)

addCommandHandler("ucho", function(plr,cmd)
  if (textDisplayIsObserver(text_displayplr)) then
      textDisplayRemoveObserver text_displayplr )
  else
      textDisplayAddObserver text_displayplr )
  end
end,true,false)


refresh_td()

z gory piwko

[ Dodano: 2016-03-01, 20:23 ]
Prosze moglby ktos odpowiedziec xdd :>

[ Dodano: 2016-03-02, 15:27 ]
Pomoze ktos wreszcie xdd

[ Dodano: 2016-03-03, 14:52 ]
Moze ktos wreszcie pomoc ...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-03, 19:12


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Skrypt musia?by? przerobi? pod sw?j serwer, bo jak si? nie myle to z XyyzyRp

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: ucho
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Ucho 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