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

Wysłany: 2017-07-31, 15:12


KilusTv







Wiek: 28
Na forum: 3998 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

Czesc, mam serwer od dluzszego czasu no i wszystko dzialalo. Moglem zabierac prawka bany dawac i all dzialalo. Dzisiaj wchodze i juz nie dziala.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 15:16


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

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

Dodaj skrypt do grupy ACL "Admin": resource.[nazwa skryptu]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 15:34


KilusTv







Wiek: 28
Na forum: 3998 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

mmowilem ze kiedys dzialalo ;-; wszystko dodalem juz kiedys. Uprzedzam ze module tez wczytalem juz dawno.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 15:37


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

KilusTv, nie m?wi?e? tylko pisa?e? wiem mo?e to g?upie, ale mo?e przez przypadek usun??e? tabele z mysql lub kto? to zrobi? za ciebie.

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 15:42


KilusTv







Wiek: 28
Na forum: 3998 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

Nie no tabela jest bo sprawdzilem mysql. Dalem sb zpj i sprawdzilem w tabeli to wyskakuje mi type "mute". Nie wiem jak moze byc tam mute skoro czegos takiego nie mam

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 16:22


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

KilusTv, Poka? kod lub dutyadmin-->s_cmd mo?e co? edytowa?e? lub kto? edytowa? :)

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 16:26


KilusTv







Wiek: 28
Na forum: 3998 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

STOPseba, heh ktos napewno nie bo tylko ja mam dostep. Czekaj mam jeszcze jeden pomysl. Jak nie zadziala to wysle

[ Dodano: 2017-07-31, 16:40 ]

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

-- Settings
function pobierzDate(type,time)
    
    realTime=getRealTime()
    type=tostring(type)
    time=tonumber(time)
    if time 0 then return end
    if type == "m" then if time 59 then return end value1=realTime.minute+time else value1=realTime.minute end
    if type == "h" then if time 23 then return end value2=realTime.hour+time else value2=realTime.hour end
    if type == "d" then if time 31 then return end value3=realTime.monthday+time else value3=realTime.monthday end
    if type == "w" then  if time 11 then return end value4=realTime.month+time else value4=realTime.month end
    if value1 >= 60 then value1 value1-60value2=value2+1 end
    if value2 >= 24 then value2 value2-24value3=value3+1 end
    if value3 >= 31 then value3 value3-31value4=value4+1 end
    date=string.format("%04d-%02d-%02d "realTime.year+1900value4+1value3)
    time=string.format("%02d:%02d:%02d"value2value1realTime.second)
    --outputChatBox(date..time,root)
    return date..time
end

addCommandHandler('e', function(plr,cmd, ...)
    if not (...) then return end
    local ranga nil
    local msg=table.concat({...}, " ")
      if (getAdmin(plr,3)) then
        ranga "Rcon"
    end
      if (getAdmin(plr,2)) then
        ranga "Administrator"
    end
      if (getAdmin(plr,1)) then
        ranga "Moderator"
    end
    for _p in pairs(getElementsByType('player')) do
        if getAdmin(pthen
            outputChatBox("[Czat Ekipy(/e)]"..getPlayerName(plr).."("..tonumber(getElementData(plr,"id"))..")".."["..ranga.."]:"..RGBToHex(255,255,255)..""..msg,p,60,172,120,true)
        end
    end
end)


-- Teksty
addCommandHandler("r", function(plr,cmd,...)
    if getAdmin(plr,3then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot10000)
    end
end)

addCommandHandler("a", function(plr,cmd,...)
    if getAdmin(plr,2) or getAdmin(plr,3then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot25500)
    end
end)

addCommandHandler("m", function(plr,cmd,...)
    if getAdmin(plr,1) or getAdmin(plr,3then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot01020)
    end
end)

--[[addCommandHandler("ogloszenie", function(plr,cmd,...)
    if not getElementData(plr"player:premium"then outputChatBox("*Brak uprawnien",plr,255,0,0) return end
        local text=table.concat({...}, " ")
        triggerClientEvent(root,"admin:rendering"root"[PREMIUM] ("..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..") >>   "..text)
end)]]

addCommandHandler("c", function(plr,cmd,...)
    if getAdmin(plr,3then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot000)
    end
end)


addCommandHandler("notification", function(plr,cmd,tyr,...)
    if getAdmin(plr,3then
        if not ... or not tyr then triggerClientEvent(plr,"addNotification",root,"Wpisz /notification [error/success/warning/info] (tekst) ","error") return end
        local text=table.concat({...}, " ")
        for _p in pairs(getElementsByType('player')) do
        triggerClientEvent(p,"addNotificatione",root,text,tyr)
        end
    end
end)



-- Komendy rcon?w
addCommandHandler("przepisz.gracz", function(plr,cmd,value)
    if getAdmin(plr,3then
        local veh=getPedOccupiedVehicle(plr)
        if not veh then
            outputChatBox("* Nie siedzisz w poje?dzie."plr25500)
            return
        end
        setElementData(veh,"vehicle:ownedPlayer",tonumber(value))
        outputChatBox("* Przepisa?e?(a?) pojazd do gracza: "..valueplr)
    end
end)

addCommandHandler("daj.kase", function(plr,cmd,cel,value)
    if getAdmin(plr,3then
        if not cel or not tonumber(valuethen
            outputChatBox("* U?ycie: /daj.kase <nick/ID> <koszt>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        givePlayerMoney(targetvalue)
        outputChatBox("* Otrzyma?e?(a?) od systemu "..value.." PLN"target)
    end
end)

addCommandHandler("daj.ogp", function(plr,cmd,cel,value)
    if getAdmin(plr,3then
        if not cel or not tonumber(valuethen
            outputChatBox("* U?ycie: /daj.ogp <nick/ID> <ilosc>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setElementData(target,"player:reputation"getElementData(target,"player:reputation")+value)
        outputChatBox("* Otrzyma?e?(a?)  "..value.." Reputacji!"target)
    end
end)

-- Komendy admin?w



addCommandHandler("jp", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if isPedInVehicle(plrthen
            removePedFromVehicle(plr)
        end
        if doesPedHaveJetPack(plrthen
            removePedJetPack(plr)
        else
            givePedJetPack(plr)
        end
    end
end)

-- komendy support?w
addCommandHandler("przeladuj", function(plr,cmd,cel,...)
    if getAdmin(plr,3then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /przeladuj <nick/ID>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
    end
end)
addCommandHandler("zaladuj", function(plr,cmd,cel,...)
    if getAdmin(plr,3then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /zaladuj <nick/ID>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        triggerEvent("load:player",root,target)
    end
end)
addCommandHandler("przeladujall", function(plr,cmd,cel,...)
    if getAdmin(plr,3then
        for i,v in ipairs(getElementsByType("player")) do
        if isElement(vthen
        triggerEvent("save:player",root,v)
        triggerEvent("load:player",root,v)
        end
        end
        outputChatBox("* Administrator przeladowal wszystkim statystyki"root21,0,170,true)
    end
end)
addCommandHandler("zapisz", function(plr,cmd)
    if getAdmin(plr,3then
        for i,v in ipairs(getElementsByType("player")) do
        if isElement(vthen
        triggerEvent("save:player",root,v)
        end
        end
        outputChatBox("* Administrator zapisal wszystkim statystyki"root21,0,170,true)
    end
end)

addCommandHandler("rozdajpienionzki", function(plr,cmd,pinion)
    if not pinion then return end
    if not tonumber(pinionthen return end
    if getAdmin(plr,3then
        for i,v in ipairs(getElementsByType("player")) do
        if isElement(vthen
        givePlayerMoney(v,pinion)
        end
        end
        outputChatBox("* Administrator doda? ka?demu graczowi "..pinion.." PLN"root255,0,0,true)
    end
end)


addCommandHandler("k", function(plr,cmd,cel,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /kick <nick/ID> <pow?d>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") zosta?(a) wyrzucony(a) przez ' "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." ' z powodu: "..reason.."")
        kickPlayer(targetplrreason)
    end
end)

addCommandHandler("kick", function(plr,cmd,cel,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /kick <nick/ID> <pow?d>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") zosta?(a) wyrzucony(a) przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..reason.."")
        kickPlayer(targetplrreason)
    end
end)
addCommandHandler("prezent", function(plrcmdmoney)
    if getAdmin(plr,3) or getAdmin(plr,2then
        if (not moneythen
            outputChatBox("U?yj: /prezent <hajsy>"plr)
        return end
        if not tonumber(moneythen
        outputChatBox("* /prezent <hahsy>"plr)
        return end
        money tonumber(money)
        if money <= 0 then
        outputChatBox("* Za mala odleglosc"plr)
        return end
        if money 10000 then 
        outputChatBox("* Za duza odleglosc maks 10k"plr)
        return end
takePlayerMoney(plr,money)
        local x,y,getElementPosition(plr)
        local cub createMarker (x,y+2,,"corona"1255120255155 )
        local t=createElement("text")
        setElementPosition(t,x,y+2,z)
        setElementData(t,"name","Prezent :)")
        addEventHandler("onMarkerHit"cub, function(elmd)
        if getElementType el) == "player" then
        outputChatBox("*Gracz "..getPlayerName(el):gsub("#%x%x%x%x%x%x","").." zgarnia prezent o wartosci "..money.."PLN!",root,255,0,0)
        givePlayerMoney(el,money)
        destroyElement(source)
        destroyElement(t)
        end
        end)
        setTimer(function() if isElement(cubthen destroyElement(cub); destroyElement(tend end,15000,1)
    end
end)

addCommandHandler("tt", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("* U?ycie: /tt <nick/ID>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        if isPedInVehicle(plrthen
            removePedFromVehicle(plr)
        end
        local x,y,z=getElementPosition(target)
        setElementInterior(plr,getElementInterior(target))
        setElementDimension(plr,getElementDimension(target))
        setElementPosition(plr,x+math.random(1,2),y+math.random(1,2),z)
    end
end)

addCommandHandler("th", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("* U?ycie: /th <nick/ID>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        if isPedInVehicle(targetthen
            removePedFromVehicle(target)
        end
        local x,y,z=getElementPosition(plr)
        setElementInterior(target,getElementInterior(plr))
        setElementDimension(target,getElementDimension(plr))
        setElementPosition(target,x+math.random(1,2),y+math.random(1,2),z)
    end
end)

addCommandHandler("warn", function(plr,cmd,cel,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /warn <nick/ID> <powod>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        outputChatBox("******************************"target25500)
        outputChatBox("* Otrzyma?e?(a?) ostrze?enie..."target25500)
        outputChatBox("* Nie stosowanie si? do ostrze?e?,"target25500)
        outputChatBox("* Mo?e skutkowa? kicki'em lub ban'em."target25500)
        outputChatBox("*****************************"target25500)
        outputChatBox("Pow?d: "..reasontarget25500)
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) ostrze?enie od ' "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." ' z powodu: "..reason.."")
    end
end)

addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not tonumber(time) or not type or not reason then
            outputChatBox("* U?ycie: /zpj <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","prawko"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            return outputChatBox(" Gracz Posiada zawieszone prawo jazdy do "..result["time"]..", za: "..result["reason"], plr25500)
        else
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?""prawko"getPlayerSerial(plr))
        end
        if isPedInVehicle(targetthen
            removePedFromVehicle(target)
        end
        result=pobierzDate(type,time)
        reason reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
        
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) zakaz prowadzenia pojazd?w kat(ABC) "..reason.."("..time .. type ..")")
        exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)"getPlayerSerial(target), reasonresult"prawko")
        --outputChatBox("* Dodanych rekord"plr)
    end
end)

addCommandHandler("zpl", function(plr,cmd,cel,time,type,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not tonumber(time) or not type or not reason then
            outputChatBox("* U?ycie: /zpl <nick/ID> <czas> <jednostka: m/h/y/w> <pow?d>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","L"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            return outputChatBox(" Gracz Posiada zawieszone prawo jazdy do "..result["time"]..", za: "..result["reason"], plr25500)
        else
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?""L"getPlayerSerial(plr))
        end
        if isPedInVehicle(targetthen
            removePedFromVehicle(target)
        end
        result=pobierzDate(type,time)
        reason reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
        
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) zakaz prowadzenia pojazd?w lotniczych(L) "..reason.."("..time .. type ..")")
        exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)"getPlayerSerial(target), reasonresult"L")
        --outputChatBox("* Dodanych rekord"plr)
    end
end)

addCommandHandler("opj", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("* U?ycie: /opj <nick/ID> "plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","prawko"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?""prawko"getPlayerSerial(target))
            outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." odzyskal swoje prawo jazdy!"plr02550)
            outputChatBox("* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." oddal Twoje prawo jazdy!"target02550)
        else
            outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." nie posiada zabranego prawka!"plr02550)
        end
    end
end)
addCommandHandler("opl", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("* U?ycie: /opl <nick/ID> "plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","L"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?""L"getPlayerSerial(target))
            outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." odzyskal swoja Licencje!"plr02550)
            outputChatBox("* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." oddal Twoja Licencje!"target02550)
        else
            outputChatBox("* Gracz "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." nie posiada zabranej Licencji!"plr02550)
        end
    end
end)

addCommandHandler("ban", function(plr,cmd,cel,time,type,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not tonumber(time) or not type or not reason then
            outputChatBox("* U?ycie: /ban <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        if (getAdmin(plr,3) == false) and getAdmin(target,3then outputChatBox("Nie mozesz tego zrobic na rconie!",plr,255,0,0) return end
        local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            return outputChatBox(" Gracz Posiada Bana do "..result["time"]..", za: "..result["reason"], plr25500)
        else
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?""ban"getPlayerSerial(target))
        end
        result=pobierzDate(type,time)
        reason reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
        if not result then outputChatBox("*Wpisales zla date **",plr,255,0,0) return end
        
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) bana z powodu: "..reason.."("..time .. type ..")")
        exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)"getPlayerSerial(target), reasonresult"ban")
        kickPlayer(target,reason)
        --outputChatBox("* Dodanych rekord"plr)
    end
end)

addCommandHandler("pban", function(plr,cmd,cel,...)
    if getAdmin(plr,3) or getAdmin(plr,2then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /pban <nick/ID> <pow?d>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        if (getAdmin(plr,3) == false) and getAdmin(target,3then outputChatBox("Nie mozesz tego zrobic na rconie!",plr,255,0,0) return end
        local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban"getPlayerSerial(target))
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            return outputChatBox(" Gracz Posiada Bana do "..result["time"]..", za: "..result["reason"], plr25500)
        else
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?""ban"getPlayerSerial(target))
        end
        reason reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."|"
        
        triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") otrzyma?(a) bana "..reason.."(Na zawsze!)")
        exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)"getPlayerSerial(target), reason,"2030-12-31 23:59:59""ban")
        kickPlayer(target,reason)
        --outputChatBox("* Dodanych rekord"plr)
    end
end)

addCommandHandler("unban", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2then
        if not cel then
            outputChatBox("* U?ycie: /unban <serial>"plr)
            return
        end
    --    if string.len(cel) ~= 32 then return outputChatBox("* B??dny serial "plrend
        local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban"cel)
        local result=exports["ogrpg-db"]:pobierzWyniki(query)
        if (resultthen
            exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?""ban"cel)
            outputChatBox("* Usunieto bana o serialu ("..cel..")!"plr02550)
        else
            outputChatBox("* Nie wykryto bana o serialu ("..cel..")!"plr02550)
        end
    end
end)

addCommandHandler("fix", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local veh=getPedOccupiedVehicle(plr)
        if not veh then
            outputChatBox("* Nie znajdujesz si? w poje?dzie"plr)
            return
        end
        setElementHealth(veh1000)
        fixVehicle(veh)
    end
end)

addCommandHandler("vtt", function(plr,cmd,vid)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not vid or not tonumber(vidthen return end
        vid=tonumber(vid)
        for i,v in ipairs(getElementsByType("vehicle")) do
            local dbid=getElementData(v,"vehicle:id")
            if dbid and tonumber(dbid) == vid then
                local x,y,z=getElementPosition(v)
                setElementPosition(plr,x,y,z+4)
                setElementInterior(plrgetElementInterior(v))
                setElementDimension(plrgetElementDimension(v))
                if getAdmin(plr,3then
                warpPedIntoVehicle(plr,v)
                end
                return
            end
        end
        local query=exports["ogrpg-db"]:dbGet("SELECT 1 FROM ogrpg_vehicles WHERE id=? AND parking>0"vid)
        if query then
            outputChatBox("* Pojazd znajduje sie na parkingu/w przechowalni."plr25500)
        else
            outputChatBox("* Nie znaleziono podanego pojazdu na mapie."plr25500)
        end
    end
end)

addCommandHandler("vth", function(plr,cmd,vid)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not vid or not tonumber(vidthen return end
        vid=tonumber(vid)
        for i,v in ipairs(getElementsByType("vehicle")) do
            local dbid=getElementData(v,"vehicle:id")
            if dbid and tonumber(dbid) == vid then
                if getElementData(v,"vehicle:police_parking"then outputChatBox("*Auto jest na parkingu policyjnym!",plr,255,0,0) return end
                local x,y,z=getElementPosition(plr)
                setElementPosition(v,x,y,z+0.1)
                setElementInterior(vgetElementInterior(plr))
                setElementDimension(vgetElementDimension(plr))
                if getAdmin(plr,3then
                warpPedIntoVehicle(plr,v)
                end
                return
               end
        end
        local query=exports["ogrpg-db"]:dbGet("SELECT 1 FROM ogrpg_vehicles WHERE id=? AND parking>0"vid)
        if query then
            outputChatBox("* Pojazd znajduje sie na parkingu/w przechowalni."plr25500)
        else
            outputChatBox("* Nie znaleziono podanego pojazdu na mapie."plr25500)
        end
    end
end)


addCommandHandler("heal", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("Uzyj: /heal <id/nick>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setElementHealth(target100)
        outputChatBox("* Uleczy?e?(a?) gracza " ..getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr)
        outputChatBox("* Zosta?e? uleczony(a) przez "..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), target)
    end
end)

addCommandHandler("checkserial", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("Uzyj: /checkserial <id/nick>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        outputChatBox("* Serial gracza("..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."): "..getPlayerSerial(target), plr)
    end
end)

addCommandHandler("spec", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("Uzyj: /spec <id/nick>"plr)
            return
        end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        local x,y,z=getElementPosition(plr)
        removePedFromVehicle(plr)
        setElementInterior(plrgetElementInterior(target))
        setElementDimension(plrgetElementDimension(target))
        setCameraTarget(plrtarget)
        setElementData(plr,"spec:pos",{x,y,z})
    end
end)

addCommandHandler("specoff", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local spec=getElementData(plr,"spec:pos")
        if not spec then return end
        setElementPosition(plrspec[1], spec[2], spec[3])
        setCameraTarget(plrplr)
    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("inv", function(plr)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if getElementAlpha(plr) > 0 then
            setElementAlpha(plr,0)
            destroyBlipsAttachedTo plr )
        else
            setElementAlpha(plr,255)
            local newValue getElementData(plr,"player:admin") -- find the new value
            if newValue == true then
                destroyBlipsAttachedTo (plr)
                createBlipAttachedTo plr02255255255 )
            else
                destroyBlipsAttachedTo plr )
                createBlipAttachedTo plr02255255255 )
            end
        end
    end
end)

addCommandHandler("invveh", function(plr)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local plr=getPedOccupiedVehicle(plr)
        if not plr then return end
        if getElementAlpha(plr) > 0 then
            setElementAlpha(plr,0)
        else
            setElementAlpha(plr,255)
        end
    end
end)



Dalej nie dzala ;-; ale np wiezienie sapd dziala

Postaw piwo autorowi tego posta
 

 
Tagi: zpj :: zpl :: ban :: dzialaja :: niepoprawnie
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