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: 3576 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") == or getElementData(localPlayer"amodduty") == or getElementData(localPlayer"samodduty") == 3 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)
     dxDrawRectangle(sx*(843)/1280sy*(536)/600sx*(427)/1280sy*(28)/600tocolor(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)
    dxDrawText(xtextsx*(860+1)/1280sy*(542+1)/600sx*(1260+1)/1280sy*(560+1)/600tocolor(000255), 1.00"default""left""top"falsefalsefalsefalsefalse)
    dxDrawText(xtextsx*(860)/1280sy*(542)/600sx*(1260)/1280sy*(560)/600tocolor(25500255), 1.00"default""left""top"falsefalsefalsefalsefalse)
    dxDrawImage(sx*(1242)/1280sy*(541)/600sx*(24)/1280sy*(19)/600":dutyAdministracji/img/mark.png"000tocolor(255255255255), false)
end

addEventHandler("onClientRender"root, function()
if getElementData(localPlayer"adminduty") == or getElementData(localPlayer"amodduty") == or getElementData(localPlayer"samodduty") == 3 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 > 20 then
        table.remove(gameView1)
    end
end)

addEvent("admin:addReport"true)
addEventHandler("admin:addReport"root, function(text,id)
    table.insert(reportView, {text,id})
    if #reportView > 20 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] == id then
            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)


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."plr25500)
        return
    end
    local text=table.concat({...}, " ")
    desc getPlayerName(plr).."("..getElementData(plr,"id")..") >> "..getPlayerName(target).."("..getElementData(target,"id").."): "..text
    triggerClientEvent(root"admin:addReport"resourceRootdescgetElementData(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") == or getElementData(plr"amodduty") == or getElementData(plr"samodduty") == 3 then
    if not tonumber(idthen
        outputChatBox("U?yj: /cl <ID> <pow?d usuni?cia>"plr)
        return
    end
    local reason table.concat({...}, " ")
    local target znajdzGracza(plrid)
    if target then
        id getElementData(target"id")
        opis getPlayerName(target)
    end
    triggerClientEvent(plr"admin:removeReport"resourceRootid)
    for i,v in ipairs(getElementsByType("player")) do
        if getElementData(plr"adminduty") == or getElementData(plr"amodduty") == or getElementData(plr "samodduty") == 3 then
        if getElementData(v"adminduty") == or getElementData(v"amodduty") == or getElementData(v"samodduty") == 3 then
                outputChatBox(""..getPlayerName(plr).." usun??/??a raport na: "..opis.."/"..id..": "..reasonv25500)
            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: 3714 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: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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"..concatsx*(698+1)/1024sy*(278+1)/768sx*(1014+1)/1024sy*(496+1)/768tocolor(000255), 1.00"default""right""top"falsetrue)
    dxDrawText("Lista raport?w:\n"..concatsx*(698)/1024sy*(278)/768sx*(1014)/1024sy*(496)/768tocolor(255255255255), 1.00"default""right""top"falsetrue)


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: 3576 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") == or getElementData(localPlayer"amodduty") == or getElementData(localPlayer"samodduty") == 3 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)
     dxDrawRectangle(sx*(843)/1280sy*(536)/600sx*(427)/1280sy*(28)/600tocolor(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)
    dxDrawText(xtextsx*(860+1)/1280sy*(542+1)/600sx*(1260+1)/1280sy*(560+1)/600tocolor(000255), 1.00"default""left""top"falsefalsefalsefalsefalse)
    dxDrawText(xtextsx*(860)/1280sy*(542)/600sx*(1260)/1280sy*(560)/600tocolor(25500255), 1.00"default""left""top"falsefalsefalsefalsefalse)
end

addEventHandler("onClientRender"root, function()
if getElementData(localPlayer"adminduty") == or getElementData(localPlayer"amodduty") == or getElementData(localPlayer"samodduty") == 3 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")
    --to do braku napisu lista raportow
    dxDrawText("Lista raport?w:\n"..concatsx*(698+1)/1024sy*(278+1)/768sx*(1014+1)/1024sy*(496+1)/768tocolor(000255), 1.00"default""right""top"falsetrue)
    dxDrawText("Lista raport?w:\n"..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 > 20 then
        table.remove(gameView1)
    end
end)

addEvent("admin:addReport"true)
addEventHandler("admin:addReport"root, function(text,id)
    table.insert(reportView, {text,id})
    if #reportView > 20 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] == id then
            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)


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: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

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: 3576 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: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

if getElementData(localPlayer"adminduty") == or getElementData(localPlayer"amodduty") == 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 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