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

Wysłany: 2018-02-11, 19:45


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Witam, mam taki problem ze mam skrypt na raporty element data jest itp ale i tak nie pokazuje mi raportow ani napisu "Lista raportow" prosze o pomoc za pomoc daje piwo+rep

"report.lua" (Client)


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)
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)


"server.lua" (Server)


function adm (source)
local accountName=getAccountName(getPlayerAccount(source))
if isObjectInACLGroup("user."..accountNameaclGetGroup("Admin")) then
if getElementData(source"adminduty"truethen
setElementData(source"adminduty"false)
takeAllWeapons(source)
outputChatBox("Zwolni?e? si? z rangi administratora RCON"source25500)
removeElementData(source,"Praca")
triggerClientEvent("okno:dutyoff",source,source)
takeWeapon source22 )
else
outputChatBox("Zalogowa?e? si? jako Administrator RCON :)"source25500)
            local nazwa "Administrator RCON"
            local r,g,22000 
            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 source2200)       
giveWeapon source2210000000)
end
end
end
addCommandHandler('dutyadm'adm)



function adm (source)
local accountName=getAccountName(getPlayerAccount(source))
if isObjectInACLGroup("user."..accountNameaclGetGroup("SuperModerator")) then
if getElementData(source"amodduty"truethen
setElementData(source"amodduty"false)
outputChatBox("Zwolni?e? si? z rangi Administrator"source25500)
removeElementData(source,"Praca")
triggerClientEvent("okno:dutyoff",source,source)
takeWeapon source22 )
else
outputChatBox("Zalogowa?e? si? jako Administrator :)"source25500)
            local nazwa "Administrator"
            local r,g,25500 
            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 source2550)    
setElementData(source"amodduty"true)    
giveWeapon source2210000000)  
end
end
end
addCommandHandler('duty'adm)

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


function report(graczcmdtoGracz, ...)
    if ... and toGracz then
        toGracz findPlayer(gracztoGracz)
        if not toGracz then 
            exports["aw-noti"]:noti("Nie znaleziono podanego gracza."gracz)
            return
        end
        local tekst table.concat({...}, " ")
        exports["aw-noti"]:noti("Pomy?lnie wys?ano zg?oszenie na gracza "..getPlayerName(toGracz).." o tre?ci "..tekstgracz)
        tekst getPlayerName(gracz).."("..getElementData(gracz"id")..") > "..getPlayerName(toGracz).."("..getElementData(toGracz"id").."): "..tekst
        triggerClientEvent(root"dRaps"roottekstgetPlayerName(toGracz))
        setElementData(toGracz"report"true)
    else
        exports["aw-noti"]:noti("Poprawne u?ycie: /"..cmd.." <id/nick> <pow?d>"gracz)
    end
end
addCommandHandler("report"report)
addCommandHandler("raport"report)

addCommandHandler("cl", function(playercmdtarget)
    if not getElementData(player"adminduty"then return end
    if target then
        target findPlayer(playertarget)
        if not target then return end
        triggerClientEvent(root"uRaps"playergetPlayerName(target))
    else
        exports["aw-noti"]:noti("Poprawne u?ycie: /"..cmd.." <id/nick> <pow?d>"player)
    end
end)

function findPlayer(pph)
    for i,v in ipairs(getElementsByType("player")) do
        if tonumber(phthen
            if getElementData(v"id") == tonumber(phthen
                return getPlayerFromName(getPlayerName(v))
            end
        else
            if string.find(string.gsub(getPlayerName(v):lower(),"#%x%x%x%x%x%x"""), ph:lower(), 1truethen
                return getPlayerFromName(getPlayerName(v))
            end
        end
    end
end


Ostatnio zmieniony przez Qbik1337 2018-02-11, 20:28, w całości zmieniany 2 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 19:49


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Jaki? b??d w debugscript3?

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 19:49


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Nie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 20:13


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

Nie dziw si?,
if getElementData(localPlayer,"adminduty") == false then 
Skoro masz warunek, ?e je?li elmentdata adminduty == false czyli sprawdza czy gracz nie ma tej elementdaty.

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

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

 
Wysłany: 2018-02-11, 20:25


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50


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


Zmieni?em na tak ale dalej nie dzia?a

Ostatnio zmieniony przez Qbik1337 2018-02-11, 20:29, w całości zmieniany 2 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 20:27


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

Qbik1337, Zdecyduj si? jaka to elementdata. dutyadmin czy duty :P

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

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

 
Wysłany: 2018-02-11, 20:30


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

marcin778 , przeciesz dobrze jest.

Dalej nie dziala.
Prosze o pomoc

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 20:57


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

W logowaniu ustawiasz trzeci parametr na true, a w onClientRender wczytujesz warto?? liczbow?, kt?rej jej nie nada?e?. Usu? wczytywanie warto?ci liczb.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Qbik1337
Wysłany: 2018-02-11, 21:11


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Nie zabardzo chyba zrozumia?em mozesz mi to jakos inaczej obja?nic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 21:26


ARS*







Wiek: 25
Na forum: 3109 dni
Posty: 8
Nick w MP: ARS*

Piwa: 282

Respekt: 60

Zamie?:
Kod:

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

Na:

Kod:

if getElementData(localPlayer, "adminduty") == true then


Poniewa? w serwerze po zalogowaniu nie nadajesz rangi w adminDuty tylko warto?? true lub false a nie liczby

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Qbik1337
Wysłany: 2018-02-11, 21:31


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Dalej nic..

[ Dodano: 2018-02-11, 21:34 ]
Ooo dzia?a tylko nie ma napisu Lista Raportow nw czm

A i jeszcze /cl mi nie dzia?a nw czm

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 21:42


ARS*







Wiek: 25
Na forum: 3109 dni
Posty: 8
Nick w MP: ARS*

Piwa: 282

Respekt: 60

Mo?esz sobie dorobi? jeszcze jeden dxDrawText aby by?o wida? dany napis. Bo szczerze to troch? si? gubi? w twoim kodzie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 22:01


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

ARS*, Po co ? ;-;

Qbik1337,

Zamie? to
concat=table.concat(reportView"\n")


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

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

 
Wysłany: 2018-02-11, 22:15


Qbik1337







Wiek: 30
Na forum: 3207 dni
Posty: 18
Nick w MP: Danio

Piwa: 133

Respekt: 50

Usuwanie reportow mi jeszcze nie dzia?a pod komenda /cl

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-11, 22:20


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

Qbik1337, Mo?e by? tak ruszy? g?ow? i spr?bowa? co? sam zrobi? a nie oczekujesz perfidnie gotowca, i tak ju? du?o pomocy otrzyma?e? a nawet g?upiego dzi?kuj? nie potrafisz napisa?, chamstwo normalne.

 triggerClientEvent(root"admin:removeReport"player,target)

zamie? to

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

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

 
Więcej szczegółów
Wystawiono 2 piw(a):
Qbik1337, ARS*
Tagi: reporty
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