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

Wysłany: 2021-04-01, 10:33


!ryzee

rebornMTA






Wiek: 20
Na forum: 2395 dni
Posty: 110
Nick w MP: drakovskyy

Piwa: 55

Respekt: 60

Siemka, mam problem. A dok?adnie, to ekipa z mojego serwera ma rangi. Nie wy?wietlaj? si? osoby wgl pod /admins. Nawet ja, na w?a?cicielu.

Kod: s_utility - pystories-admins


local sw,sh = guiGetScreenSize()
local screenW, screenH = guiGetScreenSize()

function hidePlayerWarning()
    playerWarning=false
end

addEventHandler("onClientRender", root, function()
    if (playerWarning) then
        dxDrawRectangle(screenW * 0.2767, screenH * 0.2669, screenW * 0.4473, screenH * 0.4674, tocolor(0, 0, 0, 155), false)
        dxDrawRectangle(screenW * 0.2767, screenH * 0.6914, screenW * 0.4473, screenH * 0.0430, tocolor(254, 15, 15, 255), true)
        dxDrawText("Otrzyma?e?(a?) ostrze?enie!", (screenW * 0.2767) - 1, (screenH * 0.6745) - 1, (screenW * 0.7240) - 1, (screenH * 0.7474) - 1, tocolor(0, 0, 0, 255), 2.00, "default", "center", "center", false, false, true, false, false)
        dxDrawText("Otrzyma?e?(a?) ostrze?enie!", (screenW * 0.2767) + 1, (screenH * 0.6745) - 1, (screenW * 0.7240) + 1, (screenH * 0.7474) - 1, tocolor(0, 0, 0, 255), 2.00, "default", "center", "center", false, false, true, false, false)
        dxDrawText("Otrzyma?e?(a?) ostrze?enie!", (screenW * 0.2767) - 1, (screenH * 0.6745) + 1, (screenW * 0.7240) - 1, (screenH * 0.7474) + 1, tocolor(0, 0, 0, 255), 2.00, "default", "center", "center", false, false, true, false, false)
        dxDrawText("Otrzyma?e?(a?) ostrze?enie!", (screenW * 0.2767) + 1, (screenH * 0.6745) + 1, (screenW * 0.7240) + 1, (screenH * 0.7474) + 1, tocolor(0, 0, 0, 255), 2.00, "default", "center", "center", false, false, true, false, false)
        dxDrawText("Otrzyma?e?(a?) ostrze?enie!", screenW * 0.2767, screenH * 0.6745, screenW * 0.7240, screenH * 0.7474, tocolor(254, 254, 254, 255), 2.00, "default", "center", "center", false, false, true, false, false)
        dxDrawText("Tre??: "..playerWarning.."", screenW * 0.2840, screenH * 0.2943, screenW * 0.7167, screenH * 0.6693, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, true, false, false)
       return
    end
end)

addEvent("onPlayerWarningReceived", true)
addEventHandler("onPlayerWarningReceived", root, function(tresc)
    if source==localPlayer then
        playerWarning=tresc
        setTimer(hidePlayerWarning, 7000, 1)
        setTimer(playSoundFrontEnd, 300, 10, 5)
    end
end)

for k,v in ipairs ( getElementsByType ( "object" ) ) do
    if getElementData ( v, "sciana:raportow" ) then
        scianaplaczu = v
    end
    if getElementData(v,"sciana:text") then
        scianatekstu = v
    end
end


function isEventHandlerAdded( sEventName, pElementAttachedTo, func )
    if 
        type( sEventName ) == 'string' and 
        isElement( pElementAttachedTo ) and 
        type( func ) == 'function' 
    then
        local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
        if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
            for i, v in ipairs( aAttachedFunctions ) do
                if v == func then
                    return true
                end
            end
        end
    end
 
    return false
end


local xtext=nil
local gameView={"Logi Serwerowe:"}
local sx,sy=guiGetScreenSize()
local screenW, screenH = guiGetScreenSize()

function renderingInfo()
    dxDrawRectangle(sx*(258)/1024, sy*(0)/768, sx*(500)/1024, sy*(23)/768, tocolor(0, 0, 0, 155), false)
    dxDrawText(xtext:gsub("#%x%x%x%x%x%x",""), 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:gsub("#%x%x%x%x%x%x",""), sx*(258)/1024, sy*(0)/768, sx*(758)/1024, sy*(23)/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false, true)
end

function raporcik()
    if getElementData(localPlayer, "player:logs") then
    if not getElementData(localPlayer,"player:admin") then return end
    local tt={}
    reportView=getElementData(scianaplaczu,"sciana:raportow")
    for i,c in ipairs(reportView) do
        if c[1] then table.insert(tt,c[1]) end
    end
    concat=table.concat(tt, "\n")
    dxDrawText(concat:gsub("#%x%x%x%x%x%x",""), 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, 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, false, true)
end
end
addEventHandler("onClientRender", root, raporcik)

addEvent("admin:addText", true)
addEventHandler("admin:addText", root, function(text)
    table.insert(gameView, text)    
    if #gameView > 17 then
        table.remove(gameView, 2)
    end
end)
function raporcik2()
    if getElementData(localPlayer, "player:logs") then
    if not getElementData(localPlayer,"player:admin") then return end
    local tt={}
    reportView=getElementData(scianatekstu,"sciana:text")
    for i,c in ipairs(reportView) do
        if c[1] then table.insert(tt,c[1]) end
    end
    concat=table.concat(tt, "\n")
    dxDrawText(concat:gsub("#%x%x%x%x%x%x",""), 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:gsub("#%x%x%x%x%x%x",""), sx*(10)/1024, sy*(279)/768, sx*(326)/1024, sy*(497)/768, white, 1.00, "default", "left", "top", false, true)
end
end
addEventHandler("onClientRender", root, raporcik2)

function renderingInfo2()
        dxDrawLine((screenW * 0.0000) - 1, (screenH * -0.1367) - 1, (screenW * 0.0000) - 1, screenH * 0.0586, tocolor(0, 101, 254, 255), 1, false)
        dxDrawLine(screenW * 1.0000, (screenH * -0.1367) - 1, (screenW * 0.0000) - 1, (screenH * -0.1367) - 1, tocolor(0, 101, 254, 255), 1, false)
        dxDrawLine((screenW * 0.0000) - 1, screenH * 0.0573, screenW * 1.0000, screenH * 0.0573, tocolor(0, 101, 254, 255), 1, false)
        dxDrawLine(screenW * 1.0000, screenH * 0.0586, screenW * 1.0000, (screenH * -0.1367) - 1, tocolor(0, 101, 254, 255), 1, false)
        dxDrawRectangle(screenW * 0.0000, screenH * -0.1380, screenW * 1.0000, screenH * 0.1953, tocolor(0, 0, 0, 255), false)
        dxDrawText("Ogloszenie od administracji: "..xtext2:gsub("#%x%x%x%x%x%x","").."", screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 0.0573, tocolor(31, 168, 255, 255), 1.00, dxfont0_8, "center", "center", false, false, true, false, false)
end

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

addEvent("admin:ogl", true)
addEventHandler("admin:ogl", root, function(text)
    xtext2=text
    if isEventHandlerAdded("onClientRender",root,renderingInfo2) then
        removeEventHandler ( "onClientRender", root, renderingInfo2)
    end
    addEventHandler("onClientRender", root, renderingInfo2)
    setTimer(function()
        removeEventHandler("onClientRender", root, renderingInfo2)
    end, 10000, 1)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-01, 11:09


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Okej, tylko w tym kodzie nie ma nic powi?zanego z admins?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-01, 14:23


!ryzee

rebornMTA






Wiek: 20
Na forum: 2395 dni
Posty: 110
Nick w MP: drakovskyy

Piwa: 55

Respekt: 60

To raczej to, haha. Jestem tak zaj?ty i zamy?lony serwerem ?e powali?em kody.

Satan mam pytanko mam jeszcze 2 problemy na serwerze, m?g?bym prosi? o pomoc? Nie chc? pisa? ci?gle na forum. Nada?bym ci rang? itp.

1 problem: Zmienilem pozycje markera wejscia i wyjscia z urzedu. Jedynm problemem jest to, ?e poprostu jak wejde do urzedu to tepa calkowicie mnie gdzie indziej niz podalem kordy w setElementPostion. A jak wychodze, to wychodzi normalnie.

2. Problem, korzystam z podstawy Demusa. Na pierwszy raz mialem napisy na samochodach w salonach a teraz ich nie mam (Typu cena, nazwa auta, pojemnosc itp). I nie wiem jak to naprawic.

function RGBToHex(red, green, blue, alpha)
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
        return nil
    end
    if(alpha) then
        return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X", red,green,blue)
    end
end

function getAdmin(plr,level)
    if getElementData(plr,"TheNoobisty") then return true end
    if level then
        local result=exports["pystories-db"]:dbGet("SELECT * from pystories_admins WHERE serial=? AND level=?", getPlayerSerial(plr), level)
        if result and #result > 0 then
            return true
        else
            return false
        end
    else
        local result=exports["pystories-db"]:dbGet("SELECT * from pystories_admins WHERE serial=?", getPlayerSerial(plr))
        if result and #result > 0 then
            return true
        else
            return false
        end
    end
end

function getPremiump(plr,level)
    if getElementData(plr,"TheNoobisty") then return true end
    if level then
        local result=exports["pystories-db"]:dbGet("SELECT * from pystories_premium WHERE serial=? AND level=?", getPlayerSerial(plr), level)
        if result and #result > 0 then
            return true
        else
            return false
        end
    else
        local result=exports["pystories-db"]:dbGet("SELECT * from pystories_premium WHERE serial=?", getPlayerSerial(plr))
        if result and #result > 0 then
            return true
        else
            return false
        end
    end
end

function cmd_admins(plr)
  local moderatorzy={}
  local admini={}
  local rconi={}
  local owner={}
  for i,v in ipairs(getElementsByType("player")) do
    local adminer = getElementData(v,"player:id")
    if not getElementData(v,"TheDeerick") then 
    --if not getElementData(v, "p:inv") then
      if (getAdmin(v,4)) then
      local t
      local login=getElementData(v,"player:admin")
      if (login) then
          if (not getPlayerName(v):gsub("#%x%x%x%x%x%x","") == "Rexu") then
        t="["..getElementData(v,"id").."]"..getPlayerName(v):gsub("#%x%x%x%x%x%x","")..""
        table.insert(owner,t)
        end
      end
    end
    if (getAdmin(v,3)) then
      local t
      local login=getElementData(v,"player:admin")
      if (login) then
        t="["..getElementData(v,"id").."]"..getPlayerName(v):gsub("#%x%x%x%x%x%x","")..""
        table.insert(rconi,t)
      end
    end
    if (getAdmin(v,2)) then
      local t
      local login=getElementData(v,"player:admin")
      if (login) then
        t="["..getElementData(v,"id").."]"..getPlayerName(v):gsub("#%x%x%x%x%x%x","")..""
        table.insert(admini,t)
      end
    end
    if (getAdmin(v,1)) then
      local t
      local login=getElementData(v,"player:admin")
      if (login) then
        t="["..getElementData(v,"id").."]"..getPlayerName(v):gsub("#%x%x%x%x%x%x","")..""
        table.insert(moderatorzy,t)
      end
    end
    end
end

  outputChatBox("W?a?ciciele:", plr, 142, 0, 255)
  if (#owner>0) then
    outputChatBox("* " .. table.concat(owner,", "), plr, 255, 255, 255)
  else
    outputChatBox("* Brak.", plr, 255, 255, 255)
  end

  outputChatBox("Administratorzy ROOT:", plr, 100, 0, 0)
  if (#rconi>0) then
    outputChatBox("* " .. table.concat(rconi,", "), plr, 255, 255, 255)
  else
    outputChatBox("* Brak.", plr, 255, 255, 255)
  end
  
  outputChatBox("Administratorzy:", plr, 255, 0, 0)
  if (#admini>0) then
    outputChatBox("* " .. table.concat(admini,", "), plr, 255, 255, 255)
  else
    outputChatBox("* Brak.", plr, 255, 255, 255)
  end

  outputChatBox("Moderatorzy:", plr, 0, 102, 0)
  if (#moderatorzy>0) then
    outputChatBox("* " .. table.concat(moderatorzy,", "), plr, 255, 255, 255)
  else
    outputChatBox("* Brak.", plr, 255, 255, 255)
  end
end

addCommandHandler("admins", cmd_admins, false, false)


addCommandHandler("tppos", function(plr,cmd,x,y,z)
if getAdmin(plr, 4) or getAdmin(plr, 3) or getAdmin(plr, 2) or getAdmin(plr, 1) then
    x,y,z = tonumber(x),tonumber(y),tonumber(z)
    if not x or not y or not z then
        outputChatBox("Podaj pozycje x y z!", plr, 255, 255, 255)
        return
    end
    setElementPosition(plr,x,y,z)
    outputChatBox("Przeniesiono!", plr, 255, 255, 255)
end
end)

addCommandHandler("m", function(plr,cmd,cel,x,bantype,...)
    if getAdmin(plr) then
        local reason = table.concat({...}, " ")
        if not cel or not tonumber(x) or not bantype or not reason then
            outputChatBox("U?ycie: /m <nick/ID> <ilo??> <m/h/d> <pow?d>", plr)
            return
        end
        local target = exports["pystories-core"]:findPlayer(plr,cel)
        if not target then
            return outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 255, 255)
        end
        
        reason = reason..""
        if bantype == "m" or bantype == "h" or bantype == "d" then
            if bantype == "m" then
                exports["pystories-db"]:dbSet("INSERT INTO pystories_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? minute,?)", getPlayerSerial(target),reason, x, "mute")
            elseif bantype == "h" then
                exports["pystories-db"]:dbSet("INSERT INTO pystories_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? hour,?)", getPlayerSerial(target),reason, x, "mute")
            elseif bantype == "d" then
                exports["pystories-db"]:dbSet("INSERT INTO pystories_punish (serial,reason,time,type) VALUES (?,?,NOW() + INTERVAL ? day,?)", getPlayerSerial(target),reason, x, "mute")
            end
        end
        outputChatBox("* Otrzyma?e?/a? blokad? mo?liwo?ci pisania na czacie od administracji! Od: "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 255,0,0)
        outputChatBox("* Pow?d: "..reason.."", target, 255,0,0)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
        setElementData(target, "mute:player", true)
        triggerClientEvent(root, "admin:rendering", root, "Gracz "..getPlayerName(target).." zosta?/a wyciszony/a przez "..getPlayerName(plr)..", pow?d: "..reason.." ("..x .. bantype..")")
    end
end)

addCommandHandler("um", function(plr,cmd,cel)
    if getAdmin(plr) then
        if not cel then
            outputChatBox("* U?ycie: /um <nick/ID> ", plr)
            return
        end
        local target=exports["pystories-core"]:findPlayer(plr,cel)
        if not target then
            return
        end
        setElementData(target, "mute:player", false)
        local query=string.format("SELECT * FROM pystories_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","mute", getPlayerSerial(target))
        local result=exports["DB"]:pobierzWyniki(query)
        if (result) then
            exports["pystories-db"]:dbSet("DELETE FROM pystories_punish WHERE type=? AND active=1 AND serial=?", "mute", getPlayerSerial(target))
            outputChatBox("* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." oddal Ci mo?liwo?? pisania!", target, 0, 255, 0)
        else
            outputChatBox("* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." nie posiada blokady mute!", plr, 0, 255, 0)
        end
    end
end)

addCommandHandler("schowaj", function(plr,cmd,id)
if getAdmin(plr) then
    if not id or not tonumber(id) then
        outputChatBox("* Podaj id pojazdu!", plr, 255, 0, 0)
        return
    end
    exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?",getPlayerName(plr), id)
    for i,v in ipairs(getElementsByType("vehicle")) do
        if getElementData(v,"vehicle:id") == tonumber(id) then
        exports["pystories-vehicles"]:onSaveVehicle(v)
        destroyElement(v)
        outputChatBox("* Pojazd zosta? przeniesiony do przechowywalni!", plr, 0, 255, 0)
        end
    end
end
end)

addCommandHandler("gleba", function(plr,cmd,cel,value)
    if getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) then
        local pojazd = getPedOccupiedVehicle(plr)
        local id = getElementData(pojazd,"vehicle:id")
        outputChatBox("* Zglebi?e?/a?  pojazd!.", plr)
        setElementData(pojazd,"glebay",true)
        setVehicleHandling(pojazd, "suspensionLowerLimit", 0.01)
    end
end)

addCommandHandler("logs", function(plr,cmd,cel,value)
    if getAdmin(plr,3) or getAdmin(plr,4) or getAdmin(plr,2) or getAdmin(plr,1) then
        if not getElementData(plr, "player:logs") then
            setElementData(plr, "player:logs", true)
        else
            setElementData(plr, "player:logs", false)
        end
    end
end)

function destroyBlipsAttachedTo(player)
    local attached = getAttachedElements ( player )
    if ( attached ) then
        for k,element in ipairs(attached) do
            if getElementType ( element ) == "blip" then
                destroyElement ( element )
            end
        end
    end
end

addCommandHandler("duty", function(plr,cmd)
    if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
        if not getElementData(plr,"player:admin") then
            giveWeapon(plr,22)
            toggleControl(plr,"fire",true)
            toggleControl(plr,"aim_weapon",true)
            if getAdmin(plr, 1) then
            setElementData(plr,"player:level",1)
            setElementData(plr,"last:nick",getPlayerName(plr))
            setElementData(plr,"last:color",tostring(getPlayerNametagColor(plr)))
            setPlayerName(plr,"#01bf34"..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
            elseif getAdmin(plr, 2) then
            setElementData(plr,"player:level",2)
            setElementData(plr,"last:nick",getPlayerName(plr))
            setElementData(plr,"last:color",tostring(getPlayerNametagColor(plr)))
            setPlayerName(plr,"#ff0000"..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
            setElementData(plr, "player:wlasciciel", true)
            elseif getAdmin(plr, 3) then
            setElementData(plr,"player:level",3)
            setElementData(plr,"last:nick",getPlayerName(plr))
            setElementData(plr,"last:color",tostring(getPlayerNametagColor(plr)))
            setPlayerName(plr,"#a31303"..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
            setElementData(plr, "player:wlasciciel", true)
            elseif getAdmin(plr, 4) then
            setElementData(plr,"player:level",4)
            setElementData(plr,"last:nick",getPlayerName(plr))
            setElementData(plr,"last:color",tostring(getPlayerNametagColor(plr)))
            setPlayerName(plr,"#8F00FF"..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""))
            setElementData(plr, "player:wlasciciel", true)
            setElementData(plr, "player:wlasciciell", true)
            destroyBlipsAttachedTo(plr)
            createBlipAttachedTo(plr, 0, 2, 142, 0, 255)
            end
            setElementData(plr,"player:admin",true)
            outputChatBox("* Aby w??czy? logi i list? report?w wpisz /logs.", plr)
            setElementData(plr,"player:ucho",true)
        else
            takeWeapon(plr,22)
            toggleControl(plr,"fire",false)
            toggleControl(plr,"aim_weapon",false)
            removeElementData(plr,"player:admin")
            removeElementData(plr,"player:level")
            setElementData(plr, "player:wlasciciell", false)
            setElementData(plr,"player:ucho",false)
            setElementData(plr, "player:wlasciciel", false)
            setPlayerName(plr,getElementData(plr,"last:nick"))
            destroyBlipsAttachedTo(plr)
            createBlipAttachedTo(plr, 0, 2, 255, 255, 255)
        end
    else
        outputChatBox("* Nie posiadasz uprawnie?.", plr, 255, 0, 0)
    end
end)


addCommandHandler("dutysilent", function(plr,cmd)
    if getAdmin(plr) then
        if not getElementData(plr,"player:admin") then
            toggleControl(plr,"fire",true)
            toggleControl(plr,"aim_weapon",true)
            setElementData(plr, "player:admin", true)
        end
    end
end)

scianarapsow = createObject ( 16637,-1931.6,883.27,35.41 )
setObjectScale(scianarapsow,3)
setElementDimension(scianarapsow,9999)
reportView = {{"?ciana Raport?w:",0}}
setElementData(scianarapsow,"sciana:raportow",reportView)

addEvent("admin:addReport", true)
addEventHandler("admin:addReport", root, function(text,id)
    table.insert(reportView, {text,id})
    if #reportView > 17 then
        table.remove(reportView, 2)
    end
    setElementData(scianarapsow,"sciana:raportow",reportView)
end)

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

scianatext = createObject ( 981,0,0,0 )
textView = {{"Logi Serwerowe:",0}}
setElementDimension(scianatext,9999)
setElementData(scianatext,"sciana:text",textView)


addEvent("admin:addText", true)
addEventHandler("admin:addText", root, function(text,id)
    table.insert(textView, {text,id})
    if #textView > 15 then
        table.remove(textView, 2)
    end
    setElementData(scianatext,"sciana:text",textView)
end)

addEvent("admin:removeText", true)
addEventHandler("admin:removeText", root, function(id)
    for i=#textView, 2, -1 do
        if textView[i][2] == id then
            table.remove(textView,i)
        end
    end
    setElementData(scianatext,"sciana:text",textView)
end)

addCommandHandler("raport", function(plr,cmd,cel,...)
    if not getElementData(plr,"player:sid") then return end
    if not cel then
        return
    end
    local target=exports["pystories-core"]:findPlayer(plr,cel)
    if not target then
        return
    end
    local text=table.concat({...}, " ")
    if not text then return end
    desc="[#FF9C00"..getElementData(plr,"id").."#ffffff] #FF9C00"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#ffffff >> [#ff0000"..getElementData(target,"id").."#ffffff] #ff0000"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."#ffffff: "..text:gsub("#%x%x%x%x%x%x","")
    triggerEvent("admin:addReport", resourceRoot, desc, getElementData(plr,"id"))
    outputChatBox("&#9432; #ffffff Wys?ano zg?oszenie", plr, 0, 144, 255, true)

end)

addCommandHandler("report", function(plr,cmd,cel,...)
    if not getElementData(plr,"player:sid") then return end
    if not cel then
        return
    end
    local target=exports["pystories-core"]:findPlayer(plr,cel)
    if not target then
        return
    end
    local text=table.concat({...}, " ")
    if not text then return end
    desc="[#FF9C00"..getElementData(plr,"id").."#ffffff] #FF9C00"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#ffffff >> [#ff0000"..getElementData(target,"id").."#ffffff] #ff0000"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."#ffffff: "..text:gsub("#%x%x%x%x%x%x","")
    triggerEvent("admin:addReport", resourceRoot, desc, getElementData(plr,"id"))
    outputChatBox("&#9432; #ffffff Wys?ano zg?oszenie", plr, 0, 144, 255, true)

end)

addCommandHandler("cl", function(plr,cmd,id,...)
    if not getAdmin(plr) then
        return
    end

    local reason = table.concat({...}, " ")

    if not id then return end
    if not reason then return end
    
    local target=exports["pystories-core"]:findPlayer(plr,id)

    opis = "Brak Online"
    if target then
        id = getElementData(target,"id")
        opis = getPlayerName(target)
        if target ~= plr and not getAdmin(target) then
        end
    end


    if not reason then
    reason = "Brak"
    end

    for i,v in ipairs(getElementsByType("player")) do
        if getElementData(v,"player:admin") then
                triggerEvent("admin:removeReport", resourceRoot, id)
                local raporcik = getElementData(plr, "admin:reporty") or 0
                outputChatBox("&#9432; #ffffff "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." rozpatrzy?/a zg?oszenie gracza "..getPlayerName(target):gsub("#%x%x%x%x%x%x","")..". Odpowied?: "..reason.."", v, 0, 144, 255, true)
        end
    end


    outputChatBox("&#9432; #ffffff Twoje zg?oszenie zosta?o przyj?te przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."", target, 0, 144, 255, true)
    outputChatBox("&#9432; #ffffff Odpowied?: "..reason.."", target, 0, 144, 255, true)

end)


Komentarz Shuffle dodany 2021-04-02, 10:19Pomagamy tylko na forum
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-02, 07:53


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

1. poka? kod to ci powiem kt?re kordy od czego s?
2. skrypt na 3d texty

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-02, 10:20


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Po wpisaniu /admins pokazuje ci ?e Brak ka?dej rangi czy nie pokazuje Ci w og?le nic lub wywala b??d?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-02, 12:54


!ryzee

rebornMTA






Wiek: 20
Na forum: 2395 dni
Posty: 110
Nick w MP: drakovskyy

Piwa: 55

Respekt: 60

"satan_" napisał/a:

1. poka? kod to ci powiem kt?re kordy od czego s?
2. skrypt na 3d texty


1. Podam nizej.
2. Skrypt na 3d texty mam. Serwer si? wy???zy? przypadkowo. W??czy?em i nie ma napis?w, 3d texty wlaczone.

createBlip(-1954.36,1343.51,7.19, 39,2,0,0,0,0,0,275)

wejscie_marker = createMarker (-1954.36,1343.51, 7.19-1, "cylinder", 1.5, 255, 200, 0, 150)
wyjscie_marker = createMarker (-1969.82,1377.48, 741.53-1, "cylinder", 1.5, 255, 200, 0, 150)
setElementDimension(wyjscie_marker, 0)
setElementInterior(wyjscie_marker, 0)

addEventHandler("onMarkerHit", wejscie_marker, function(el, md)
    if isPedInVehicle(el) then return end
    fadeCamera(el ,false)
    setElementFrozen(el, true)
    setTimer(function ()
    outputChatBox( "* Patrzysz na godziny otwarcia, i wchodzisz do Urz?du.", el)
    setElementDimension(el, 1)
    setElementInterior(el, 3)
    setElementPosition(el, -1965.82,1377.20,741.53)
    setElementFrozen(el, false)
    showPlayerHudComponent(el, "radar", false)
    fadeCamera(el, true)
    end, 1500, 1)
end)

addEventHandler("onMarkerHit", wyjscie_marker, function(el, md)
    if isPedInVehicle(el) then return end
    fadeCamera(el ,false)
    setElementFrozen(el, true)
    setTimer(function ()
    outputChatBox("* Za?atwi?e? swoje sprawy, i wychodzisz z Urz?du.", el)
    setElementDimension(el, 0)
    setElementInterior(el, 0)
    setElementPosition(el, -1954.21,1341.84,7.19)
    setElementFrozen(el, false)
    showPlayerHudComponent(el, "radar", true)
    fadeCamera(el, true)
    end, 1500, 1)
end)


[ Dodano: 2021-04-02, 12:54 ]
"Shuffle" napisał/a:

Po wpisaniu /admins pokazuje ci ?e Brak ka?dej rangi czy nie pokazuje Ci w og?le nic lub wywala b??d?


Na ka?dej randze pisze "Brak." lecz jestem na duty i nic. :p

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-02, 13:53


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Poka? komend? na /duty oraz funkcj? exportowan? getAdmins

Postaw piwo autorowi tego posta
 

 
Tagi: adminsy.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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