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

Wysłany: 2017-09-03, 12:09


Qbik1337







Wiek: 31
Na forum: 3348 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Witam , otoz mam taki problem jak wchodze na duty to nie wyskakuje mi napis Lista Raportow i jak np wysle raport na siebie to tez nie pokazuje mojego raporta i komenda cl tez nie dzia?a B?EDOW W DB3 NIE MA

Prosze o pomoc za pomoc :piwo: + R*


function jestRCONem(gracz)
if getElementData(gracz, "adminduty") == 3 then return true end
end


function jestADMINem(gracz)
if getElementData(gracz, "amodduty") == 2 then return true end
end


function jestModem(gracz)
if getElementData(gracz, "samodduty") == 1 then return true end
end


function adm (source)
local accountName=getAccountName(getPlayerAccount(source))
if isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) then
if getElementData(source, "adminduty", true) then
setElementData(source, "adminduty", false)
takeAllWeapons(source)
outputChatBox("Zwolni?e? si? z rangi administratora RCON", source, 255, 0, 0)
removeElementData(source,"Praca")
triggerClientEvent("okno:dutyoff",source,source)
takeWeapon ( source, 22 )
else
outputChatBox("Zalogowa?e? si? jako Administrator RCON :)", source, 255, 0, 0)
            local nazwa = "Administrator RCON"
            local r,g,b = 220, 0, 0 
            setElementData(source,"Praca",nazwa)
            setElementData(source,"Praca:r",r) 
            setElementData(source,"Praca:g",g)     
            setElementData(source,"Praca:b",b)  
            triggerClientEvent("okno:dutyon",source,source)
setElementData(source, "adminduty", true)  
setPlayerNametagColor ( source, 220, 0, 0 )       
giveWeapon ( source, 22, 10000000)
end
end
end
addCommandHandler('dutyadm', adm)



function adm (source)
local accountName=getAccountName(getPlayerAccount(source))
if isObjectInACLGroup("user."..accountName, aclGetGroup("SuperModerator")) then
if getElementData(source, "amodduty", true) then
setElementData(source, "amodduty", false)
outputChatBox("Zwolni?e? si? z rangi Administrator", source, 255, 0, 0)
removeElementData(source,"Praca")
triggerClientEvent("okno:dutyoff",source,source)
takeWeapon ( source, 22 )
else
outputChatBox("Zalogowa?e? si? jako Administrator :)", source, 255, 0, 0)
            local nazwa = "Administrator"
            local r,g,b = 255, 0, 0 
            setElementData(source,"Praca",nazwa)
            setElementData(source,"Praca:r",r) 
            setElementData(source,"Praca:g",g)     
            setElementData(source,"Praca:b",b)  
            triggerClientEvent("okno:dutyon",source,source)
setPlayerNametagColor ( source, 255, 0, 0 )    
setElementData(source, "amodduty", true)    
giveWeapon ( source, 22, 10000000)  
end
end
end
addCommandHandler('duty', adm)

function adm (source)
local accountName=getAccountName(getPlayerAccount(source))
if isObjectInACLGroup("user."..accountName, aclGetGroup("Moderator")) then
if getElementData(source, "samodduty", true) then
setElementData(source, "samodduty", false)
outputChatBox("Zwolni?e? si? z rangi Supporter", source, 255, 0, 0)
takeWeapon ( source, 22 )
triggerClientEvent("okno:dutyoff",source,source)
removeElementData(source,"Praca")
else
outputChatBox("Zalogowa?e? si? jako Supporter :)", source, 255, 0, 0)
triggerClientEvent("okno:dutyon",source,source)
            local nazwa = "Support"
            local r,g,b = 0, 71, 255 
            setElementData(source,"Praca",nazwa)
            setElementData(source,"Praca:r",r) 
            setElementData(source,"Praca:g",g)     
            setElementData(source,"Praca:b",b)  
            setElementData(source, "samodduty", true)  
            setPlayerNametagColor ( source, 0, 71, 255 ) 
giveWeapon ( source, 22, 10000000)            
end
end
end
addCommandHandler('duty', adm)

function znajdzGracza(plr, cel)
    local target = nil
    if tonumber(cel) ~= nil then
        target = getElementByID("p"..cel)
    else
        for _,gracze in ipairs(getElementsByType("player")) do
            if string.find(string.gsub(getPlayerName(gracze):lower(), "#%x%x%x%x%x%x", ""), cel:lower(), 1, true) then
                if target then
                    outputChatBox("* Znaleziono wi?cej graczy o takim nicku, podaj wi?cej liter!", plr)
                    return nil
                end
                target = gracze
            end
        end
    end
    return target
end



-----


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", root, 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, "adminduty") == 2 or getElementData(plr, "adminduty") == 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", root, id)
    for i,v in ipairs(getElementsByType("player")) do
        if getElementData(plr, "adminduty") == 1 or getElementData(plr, "adminduty") == 2 or getElementData(plr "adminduty") == 3 then
        if getElementData(v, "adminduty") == 1 or getElementData(v, "adminduty") == 2 or getElementData(v, "adminduty") == 3 then
                outputChatBox(""..getPlayerName(plr).." usun??/??a raport na: "..opis.."/"..id..": "..reason, v, 255, 0, 0)
            end
        end
    end
    end
end)

addCommandHandler('e', function(plr,cmd, ...)
    if not (...) then return end
    local msg=table.concat({...}, " ")
    if getElementData(plr, "adminduty") == 3 then  
    end
    if getElementData(plr, "amodduty") == 2 then
    end
    if getElementData(plr, "samodduty") == 1 then
    end
    for _, p in pairs(getElementsByType('player')) do
        if getElementData(p, "adminduty") then
            outputChatBox("[CE] "..getPlayerName(plr).." ("..tonumber(getElementData(plr,"id"))..") ".." : "..msg,p,255,170, 0,true)
        end
    end
end)

addCommandHandler("ustaw.klatke", function(plr)
    if getElementData(plr, "adminduty") == 1 or getElementData(plr, "amoduty") == 3 or getElementData(plr, "samoduty") == 2 then
        local x,y,z=getElementPosition(plr)
        local dim=getElementDimension(plr)
        local int=getElementInterior(plr)

        local object=createObject(971, x,y,z-0.9, 270, 0, 180)
        setElementData(object,"owner",getPlayerName(plr))
        setElementDimension(object,dim)
        setElementInterior(object,int)

        local object=createObject(971, x,y,z+6, 270, 0, 180)
        setElementData(object,"owner",getPlayerName(plr))
        setElementDimension(object,dim)
        setElementInterior(object,int)

        local object=createObject(971, x,y+3.5,z+2.5, 0, 0, 0)
        setElementData(object,"owner",getPlayerName(plr))
        setElementDimension(object,dim)
        setElementInterior(object,int)

        local object=createObject(971, x-4.5,y,z+2.5, 0, 0, 270)
        setElementData(object,"owner",getPlayerName(plr))
        setElementDimension(object,dim)
        setElementInterior(object,int)

        local object=createObject(971, x,y-3.5,z+2.5, 0, 0, 180)
        setElementData(object,"owner",getPlayerName(plr))
        setElementDimension(object,dim)
        setElementInterior(object,int)

        local object=createObject(971, x+4,y,z+2.5, 0, 0, 270)
        setElementData(object,"owner",getPlayerName(plr))
        setElementDimension(object,dim)
        setElementInterior(object,int)

        outputChatBox("* Stworzy?es/a? klatk?.", plr)
    end
end)

addCommandHandler("usun.klatke", function(plr)
    if getElementData(plr, "dutyadmin") == 1 or getElementData(plr, "amoduty") == 3 or getElementData(plr, "samoduty") == 2 then
        for i,v in ipairs(getElementsByType("object")) do
            if getElementData(v,"owner") == getPlayerName(plr) then
                destroyElement(v)
            end
        end
    end
end)


[PO STRONIE CLIENTA]

addCommandHandler("gp",function(plr)
    outputChatBox("Interior: " .. getElementInterior(localPlayer) .. " Dimension: " .. getElementDimension(localPlayer))
    local x,y,z = getElementPosition(localPlayer)
    local xr,yr,zr = getElementRotation(localPlayer)
    p=string.format("%.2f,%.2f,%.2f",x,y,z)
    setClipboard(p)
    outputChatBox("Pozycja gracza: {" ..p.."},")
    --outputChatBox("Pozycja Rotacji: "..xr..", " ..yr..", " ..zr, plr)
    local veh=getPedOccupiedVehicle(localPlayer)
    if veh then
        local x,y,z=getElementPosition(veh)
        local rx,ry,rz=getElementRotation(veh)
        local ID = getElementModel ( veh )
        local Model = getVehicleName ( veh )
        p=string.format("%.2f,%.2f,%.2f,%.1f,%.1f,%.1f",x,y,z,rx,ry,rz)
        setClipboard(p)
        outputChatBox("*Pozycja pojazdu:("..p.."),")
        outputChatBox("*Nazwa Pojazdu:"..Model.." \n*ID Pojazdu "..ID..".")
    end
end)

addCommandHandler("gp2",function(plr)
    outputChatBox("Interior: " .. getElementInterior(localPlayer) .. " Dimension: " .. getElementDimension(localPlayer))
    local x,y,z = getElementPosition(localPlayer)
    local xr,yr,zr = getElementRotation(localPlayer)
    p=string.format("%.2f,%.2f,%.2f",x,y,z)
    setClipboard(p)
    outputChatBox("Pozycja gracza: " ..p.." ")
    outputChatBox("Pozycja rotacji: "..xr..", " ..yr..", " ..zr, plr)
    local veh=getPedOccupiedVehicle(localPlayer)
    if veh then
        local x,y,z=getElementPosition(veh)
        local rx,ry,rz=getElementRotation(veh)
        local ID = getElementModel ( veh )
        local Model = getVehicleName ( veh )
        p=string.format("%.2f,%.2f,%.2f,%.1f,%.1f,%.1f",x,y,z,rx,ry,rz)
        setClipboard(p)
        outputChatBox("*Pozycja pojazdu:("..p.."),")
        outputChatBox("*Nazwa Pojazdu:"..Model.." \n*ID Pojazdu "..ID..".")
    end
end)


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


Ostatnio zmieniony przez Qbik1337 2017-09-03, 12:16, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-09-03, 12:15


Demossek

Chyba ty...






Wiek: 21
Na forum: 3515 dni
Posty: 24
Nick w MP: Demossek



Respekt: 50

Jaka masz paczke ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-09-03, 13:17


Avenged

Młodszy Szkrypter






Wiek: 24
Na forum: 3651 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1572

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Jak tutaj zmieni?e? elementdaty to zmie? je w raportach

function jestRCONem(gracz)
if getElementData(gracz, "adminduty") == 3 then return true end
end


function jestADMINem(gracz)
if getElementData(gracz, "amodduty") == 2 then return true end
end


function jestModem(gracz)
if getElementData(gracz, "samodduty") == 1 then return true end
end


[ Dodano: 2017-09-03, 13:22 ]
Ot?? t? linijk?:

if getElementData(localPlayer, "adminduty") == 1 or getElementData(localPlayer, "adminduty") == 2 or getElementData(localPlayer, "adminduty") == 3 then


Podmieniasz na:
if getElementData(localPlayer, "adminduty") == 3 or getElementData(localPlayer, "amoduty") == 2 or getElementData(localPlayer, "samoduty") == 1 then


(pisane z telefonu mog? by? b??dy

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-09-03, 14:09


Qbik1337







Wiek: 31
Na forum: 3348 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Dalej nic ... a b??d?w w db3 tez nie ma

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-09-03, 21:01


Demossek

Chyba ty...






Wiek: 21
Na forum: 3515 dni
Posty: 24
Nick w MP: Demossek



Respekt: 50

ekhm pomoge ale powiedz paczkr

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-09-04, 20:39


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Demossek, Po co ci paczka? Mo?e to autorskie? ( Wiem ?e nie ) Lua nie kr?ci sie wok?? Paczek OGRPG/ Xzyyrp czy jeszcze co tam jest!

Co do tematu:
Zobacz tak:



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)



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

addEventHandler("onClientRender", root, function()
    if not getElementData(localPlayer,"amodduty") then return end
    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)


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 not getElementData(localPlayer,"amodduty") then return end
    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)

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)


Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
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