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

Wysłany: 2017-08-15, 12:45


zombiaczek11







Wiek: 30
Na forum: 3717 dni
Posty: 26
Nick w MP: Danio

Piwa: 2

Respekt: 50

Ostrzeżeń: 100%
Mam taki problem iz nie pokazuje mi nawet napisu Lista raport?w i nie wiem dlaczego mi to nie dzia?a dlatego prosze o pomoc.
Kod po stronie(Clienta)
 

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

addEventHandler("onClientRender", root, function()
if getElementData(localPlayer, "adminduty") == 1 or getElementData(localPlayer, "amodduty") == 2 or getElementData(localPlayer, "samodduty") == 3 then
    concat=table.concat(gameView, "\n")
    dxDrawText(concat, sx*(10+1)/1024, sy*(279+1)/768, sx*(326+1)/1024, sy*(497+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "left", "top", false, true)
    dxDrawText(concat, sx*(10)/1024, sy*(279)/768, sx*(326)/1024, sy*(497)/768, white, 1.00, "default", "left", "top", false, true)
end
    end)


function renderingInfo()
    --dxDrawRectangle(sx*(258)/1024, sy*(0)/768, sx*(500)/1024, sy*(23)/768, tocolor(0, 0, 0, 155), false)
     dxDrawRectangle(sx*(843)/1280, sy*(536)/600, sx*(427)/1280, sy*(28)/600, tocolor(0, 0, 0, 155), false)
    --dxDrawText(xtext, sx*(258+1)/1024, sy*(0+1)/768, sx*(758+1)/1024, sy*(23+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "center", "center", false, true)
    --dxDrawText(xtext, sx*(258)/1024, sy*(0)/768, sx*(758)/1024, sy*(23)/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false, true)
    dxDrawText(xtext, sx*(860+1)/1280, sy*(542+1)/600, sx*(1260+1)/1280, sy*(560+1)/600, tocolor(0, 0, 0, 255), 1.00, "default", "left", "top", false, false, false, false, false)
    dxDrawText(xtext, sx*(860)/1280, sy*(542)/600, sx*(1260)/1280, sy*(560)/600, tocolor(255, 0, 0, 255), 1.00, "default", "left", "top", false, false, false, false, false)
    dxDrawImage(sx*(1242)/1280, sy*(541)/600, sx*(24)/1280, sy*(19)/600, ":dutyAdministracji/img/mark.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end

addEventHandler("onClientRender", root, function()
if getElementData(localPlayer, "adminduty") == 1 or getElementData(localPlayer, "amodduty") == 2 or getElementData(localPlayer, "samodduty") == 3 then
    local tt={}
    for i,v in ipairs(reportView) do
        if v[1] then table.insert(tt,v[1]) end
    end
    concat=table.concat(tt, "\n")
    dxDrawText(concat, sx*(698+1)/1024, sy*(278+1)/768, sx*(1014+1)/1024, sy*(496+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "right", "top", false, true)
    dxDrawText(concat, sx*(698)/1024, sy*(278)/768, sx*(1014)/1024, sy*(496)/768, tocolor(255, 255, 255, 255), 1.00, "default", "right", "top", false, true)
end
    end)

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

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

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

addEvent("admin:rendering", true)
addEventHandler("admin:rendering", root, function(text)
    xtext=text
    addEventHandler("onClientRender", root, renderingInfo)
    setTimer(function()
        removeEventHandler("onClientRender", root, renderingInfo)
    end, 5000, 1)
end)


Kod po stronie server.lua (Servera)

addCommandHandler("raport", function(plr,cmd,cel,...)
    if not cel then
        outputChatBox("U?yj: /raport <kawa?ek nick'u> <pow?d>", plr)
        return
    end
    local target = znajdzGracza(plr,cel)
    if not target then
        outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 0, 0)
        return
    end
    local text=table.concat({...}, " ")
    desc = getPlayerName(plr).."("..getElementData(plr,"id")..") >> "..getPlayerName(target).."("..getElementData(target,"id").."): "..text
    triggerClientEvent(root, "admin:addReport", resourceRoot, desc, getElementData(target,"id"))
    outputChatBox("Pomy?lnie wys?ano zg?oszenie na gracza: "..getPlayerName(target), plr)
end)

addCommandHandler("cl", function(plr,cmd,id,...)
if getElementData(plr, "adminduty") == 1 or getElementData(plr, "amodduty") == 2 or getElementData(plr, "samodduty") == 3 then
    if not tonumber(id) then
        outputChatBox("U?yj: /cl <ID> <pow?d usuni?cia>", plr)
        return
    end
    local reason = table.concat({...}, " ")
    local target = znajdzGracza(plr, id)
    if target then
        id = getElementData(target, "id")
        opis = getPlayerName(target)
    end
    triggerClientEvent(plr, "admin:removeReport", resourceRoot, id)
    for i,v in ipairs(getElementsByType("player")) do
        if getElementData(plr, "adminduty") == 1 or getElementData(plr, "amodduty") == 2 or getElementData(plr "samodduty") == 3 then
        if getElementData(v, "adminduty") == 1 or getElementData(v, "amodduty") == 2 or getElementData(v, "samodduty") == 3 then
                outputChatBox(""..getPlayerName(plr).." usun??/??a raport na: "..opis.."/"..id..": "..reason, v, 255, 0, 0)
            end
        end
    end
    end
end)


Ostatnio zmieniony przez zombiaczek11 2017-08-15, 19:26, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-15, 13:42


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

masz date "adminduty"? daj db3 przy wlaczeniu zasobu

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-15, 13:43


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Nie mo?esz napisa? w dxDrawText "Lista raport?w" i przej?? do nast?pnej linijki, kt?ra pokazuje raporty?

--to do braku napisu lista raportow
    dxDrawText("Lista raport?w:\n"..concat, sx*(698+1)/1024, sy*(278+1)/768, sx*(1014+1)/1024, sy*(496+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "right", "top", false, true)
    dxDrawText("Lista raport?w:\n"..concat, sx*(698)/1024, sy*(278)/768, sx*(1014)/1024, sy*(496)/768, tocolor(255, 255, 255, 255), 1.00, "default", "right", "top", false, true)


Ostatnio zmieniony przez Kalizman 2017-08-15, 13:44, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-15, 13:43


zombiaczek11







Wiek: 30
Na forum: 3717 dni
Posty: 26
Nick w MP: Danio

Piwa: 2

Respekt: 50

Ostrzeżeń: 100%
Tak mam elementdate "adminduty"

B?edow w DB3 juz nie ma ale dalej zostaje problem z ta Lista Raportow

[ Dodano: 2017-08-15, 13:50 ]
Dodalem te 2 i dalej linijki i dalej nic

[ Dodano: 2017-08-15, 13:52 ]
Teraz kod wyglada tak


local xtext=nil
local gameView={" "}
local sx,sy=guiGetScreenSize()

addEventHandler("onClientRender", root, function()
if getElementData(localPlayer, "adminduty") == 1 or getElementData(localPlayer, "amodduty") == 2 or getElementData(localPlayer, "samodduty") == 3 then
    concat=table.concat(gameView, "\n")
    dxDrawText(concat, sx*(10+1)/1024, sy*(279+1)/768, sx*(326+1)/1024, sy*(497+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "left", "top", false, true)
    dxDrawText(concat, sx*(10)/1024, sy*(279)/768, sx*(326)/1024, sy*(497)/768, white, 1.00, "default", "left", "top", false, true)
end
    end)


function renderingInfo()
    --dxDrawRectangle(sx*(258)/1024, sy*(0)/768, sx*(500)/1024, sy*(23)/768, tocolor(0, 0, 0, 155), false)
     dxDrawRectangle(sx*(843)/1280, sy*(536)/600, sx*(427)/1280, sy*(28)/600, tocolor(0, 0, 0, 155), false)
    --dxDrawText(xtext, sx*(258+1)/1024, sy*(0+1)/768, sx*(758+1)/1024, sy*(23+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "center", "center", false, true)
    --dxDrawText(xtext, sx*(258)/1024, sy*(0)/768, sx*(758)/1024, sy*(23)/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false, true)
    dxDrawText(xtext, sx*(860+1)/1280, sy*(542+1)/600, sx*(1260+1)/1280, sy*(560+1)/600, tocolor(0, 0, 0, 255), 1.00, "default", "left", "top", false, false, false, false, false)
    dxDrawText(xtext, sx*(860)/1280, sy*(542)/600, sx*(1260)/1280, sy*(560)/600, tocolor(255, 0, 0, 255), 1.00, "default", "left", "top", false, false, false, false, false)
end

addEventHandler("onClientRender", root, function()
if getElementData(localPlayer, "adminduty") == 1 or getElementData(localPlayer, "amodduty") == 2 or getElementData(localPlayer, "samodduty") == 3 then
    local tt={}
    for i,v in ipairs(reportView) do
        if v[1] then table.insert(tt,v[1]) end
    end
    concat=table.concat(tt, "\n")
    --to do braku napisu lista raportow
    dxDrawText("Lista raport?w:\n"..concat, sx*(698+1)/1024, sy*(278+1)/768, sx*(1014+1)/1024, sy*(496+1)/768, tocolor(0, 0, 0, 255), 1.00, "default", "right", "top", false, true)
    dxDrawText("Lista raport?w:\n"..concat, sx*(698)/1024, sy*(278)/768, sx*(1014)/1024, sy*(496)/768, tocolor(255, 255, 255, 255), 1.00, "default", "right", "top", false, true)
end
    end)

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

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

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

addEvent("admin:rendering", true)
addEventHandler("admin:rendering", root, function(text)
    xtext=text
    addEventHandler("onClientRender", root, renderingInfo)
    setTimer(function()
        removeEventHandler("onClientRender", root, renderingInfo)
    end, 5000, 1)
end)


Ostatnio zmieniony przez zombiaczek11 2017-08-15, 19:42, w całości zmieniany 3 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-15, 17:53


marcin778

Krytyk serwerów MTA






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

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

Poka? plik server.lua

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

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

 
Wysłany: 2017-08-15, 19:35


zombiaczek11







Wiek: 30
Na forum: 3717 dni
Posty: 26
Nick w MP: Danio

Piwa: 2

Respekt: 50

Ostrzeżeń: 100%
B?edow w db3 juz nie ma ale zostaje problem z tymi raportami ze jak wchodze na duty do latac pod 0 moge bo mam pod ta sama element date co raporty ale nie pokazuje mi tego napisu Lista Raportow

[ Dodano: 2017-08-17, 13:05 ]
@ref

[ Dodano: 2017-08-18, 18:32 ]
@REF

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-18, 18:42


marcin778

Krytyk serwerów MTA






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

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

if getElementData(localPlayer, "adminduty") == 1 or getElementData(localPlayer, "amodduty") == 2 or getElementData(localPlayer, "samodduty") == 3 then
nie spe?nia si?.

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

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

 
Tagi: raporty
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » raporty Odpowiedz do tematu

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