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

Wysłany: 2019-01-29, 15:55


Jodla

Majster






Wiek: 22
Na forum: 3267 dni
Posty: 41
Nick w MP: Stajl

Piwa: 821

Respekt: 20,5

Siema mam tutaj taki kod z ITS'a i nie wiem dla czego /tt /vth itd. nie dzia?a.
Szuka?em b??d?w w kodzie ale nic nie znalaz?em.
Je?li kto? ma dzia?aj?cy to prosze.


addCommandHandler("kick", function(plr,cmd,cel,...)
    if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
        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
            triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
            return
        end
        exports["ogrpg-db"]:dbSet("insert into kartoteka (typ,karajacy,data,powod,ofiara) VALUES(?,?,NOW(),?,?)", "KICK", plr.name:gsub("#%x%x%x%x%x%x",""), reason, getElementData(target, "player:uid"))
        triggerClientEvent(root, "adminRender", root, "Gracz "..getPlayerName(target).." zosta? wyrzucony przez "..plr.name..", pow?d: "..reason.."")
        exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "kick "..getPlayerName(target).."")
        kickPlayer(target, plr, reason)
    end
end)
addCommandHandler("prezent", function(plr, cmd, money, ...)
    if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
        local help = table.concat({...}, " ")
        if (not money or not help) then
            outputChatBox("U?yj: /prezent <hajsy> <podpowied?>", plr)
        return end
        if not tonumber(money) or not help then
            outputChatBox("U?yj: /prezent <hajsy> <podpowied?>", plr)
        return end
            money = tonumber(money)
        if money <= 0 then
            outputChatBox("Podana warto??, musi by? wi?ksza od zera!", plr)
        return end
        if money > 300000 then
            outputChatBox("Maksymalna kwota w prezencie to 300.000PLN!", plr)
        return end
        if not ... then outputChatBox("U?yj: /prezent <hajsy> <podpowied?>", plr) return end
        takePlayerMoney(plr,money)
        local x,y,z = getElementPosition(plr)
        local city = getZoneName(x, y, z, true)
        local street = getZoneName(x, y, z, false)
        plr:setData("player:created", true)
        local cub = createPickup(x, y, z, 3, 1274, 50)
        local t = createElement("text")
        setElementPosition(t,x,y,z)
        setElementData(t,"name","Prezent o warto?ci "..money.." PLN\nPozdrawiamy, administracja!")
        outputChatBox("Kto? z administracji, wyrzuci? prezent o warto?ci "..money.." PLN.", root, 0, 255, 0)
        outputChatBox("Podpowied?: "..help..".", root, 0, 255, 0)
        addEventHandler("onPickupHit", cub, function(el, md)
            if getElementType ( el) == "player" then
                if not el:getData("player:created") then
                    plr:getData("player:created", false)
                    outputChatBox(""..getPlayerName(el):gsub("#%x%x%x%x%x%x","").." zgarnia prezent o warto?ci "..money.."PLN!",root,0,255,0)
                    givePlayerMoney(el,money)
                    destroyElement(source)
                    destroyElement(t)
                end
            end
        end)
        setTimer(function() if isElement(cub) then destroyElement(cub); destroyElement(t) end end,60000*30,1)
    end
end)
addCommandHandler("portfel", function(plr, cmd, money)
    if getAdmin(plr,4) or getAdmin(plr,3) then
        if (not money) then
            outputChatBox("U?yj: /portfel <hajsy>", plr)
        return end
        if not tonumber(money) then
        outputChatBox("* /portfel <hahsy>", plr)
        return end
        money = tonumber(money)
        if money <= 0 then
        outputChatBox("* Za mala ilosc pieniedzy w portfelu", plr)
        return end
        if money > 5000 then
        outputChatBox("* Za duza ilosc pieniedzy w portfelu max: 5000 PLN", plr)
        return end
        takePlayerMoney(plr,money)
        local x,y,z = getElementPosition(plr)
        local cub = createMarker (x,y+2,z ,"corona", 1, 0, 153, 0, 155 )
        local t = createElement("text")
        setElementPosition(t,x,y+2,z)
        setElementData(t,"name","Zgubiony Portfel")
        outputChatBox("#00FF00* Kto? zgubi? portfel, ciekawe gdzie on le?y.", root, 0,153,0,true)
        addEventHandler("onMarkerHit", cub, function(el, md)
        if getElementType ( el) == "player" then
        outputChatBox("#00FF00*Gracz "..getPlayerName(el):gsub("#%x%x%x%x%x%x","").." znalaz?/a czyj? portfel, a w nim #FFFF00"..money.."PLN!",root,0,153,0,true)
        givePlayerMoney(el,money)
        destroyElement(source)
        destroyElement(t)
        end
        end)
        setTimer(function() if isElement(cub) then destroyElement(cub); destroyElement(t) end end,60000 * 30,1)
    end
end)
addCommandHandler("rprezent", function(plr, cmd, money)
    if getAdmin(plr,4) or getAdmin(plr,3) then
        if (not money) then
            outputChatBox("U?yj: /rprezent <hajsy>", plr)
        return end
        if not tonumber(money) then
        outputChatBox("* /rprezent <hajsy>", plr)
        return end
        money = tonumber(money)
        if money <= 0 then
        outputChatBox("* Za mala odleglosc", plr)
        return end
takePlayerMoney(plr,money)
        local x,y,z = getElementPosition(plr)
        local cub = createMarker (x,y+2,z ,"corona", 1, 255, 120, 255, 155 )
        local t = createElement("text")
        setElementPosition(t,x,y+2,z)
        setElementData(t,"name","Prezent :)")
        addEventHandler("onMarkerHit", cub, function(el, md)
        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(cub) then destroyElement(cub); destroyElement(t) end end,15000,1)
    end
end)

addCommandHandler("ztp", function(plr, cmd)
    if getAdmin(plr) then
        setElementPosition(plr, -4550.88, 2888.54, 9.45)
        giveWeapon(plr, 38, 1000)
        triggerClientEvent(plr, "onClientAddNotification", plr, "Otrzyma?e?(a?) miniguna - pami?taj, ?eby przedstawi? wszystkim zasady ZTP", "success")
    end
end)

addCommandHandler("tt", function(plr, cmd, cel)
    if getAdmin(plr) then
        if not cel then
                triggerClientEvent(plr, "onClientAddNotification", plr, "Podaj u?ytkownika, do kt?rego chcesz si? przeteleportowa?!", "error") 
                triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." - u?yto z?ej sk?adni! (brak u?ytkownika)", math.random(0, 99)) 
            return
        end
        
        local target = exports["ogrpg-core"]:findPlayer(plr, cel)
        if not target then
                triggerClientEvent(plr, "onClientAddNotification", plr, "Taki u?ytkownik nie istnieje!", "error") 
                triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..cel.." - taki u?ytkownik nie istnieje!", math.random(0, 99)) 
            return
        end
        
        if isPedInVehicle(plr) then
                triggerClientEvent(plr, "onClientAddNotification", plr, "Aby u?y? tej komendy, musisz znajdowa? si? poza pojazdem!", "error") 
                triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..cel.." - pr?ba teleportowania z pojazdem.", math.random(0, 99)) 
            return
        end
        
        local position = {getElementPosition(target)}
        setElementInterior(plr, getElementInterior(target))
        setElementDimension(plr, getElementDimension(target))
        setElementPosition(plr, position[1] + math.random(1, 2), position[2] + math.random(1, 2), position[3])
        triggerEvent("admin:addText", resourceRoot, "TT > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." (UID: "..getElementData(target, "player:uid")..")", math.random(0, 99))
    end
end)

addCommandHandler("th", function(plr, cmd, cel)
    if getAdmin(plr) then
        if not cel then
                triggerClientEvent(plr, "onClientAddNotification", plr, "Podaj u?ytkownika, kt?rego chcesz przeteleportowa? do siebie!", "error") 
                triggerEvent("admin:addText", resourceRoot, "TH > "..plr.name:gsub("#%x%x%x%x%x%x","").." - u?yto z?ej sk?adni! (brak u?ytkownika)", math.random(0, 99)) 
            return
        end
        
        local target = exports["ogrpg-core"]:findPlayer(plr, cel)
        if not target then
                triggerClientEvent(plr, "onClientAddNotification", plr, "Taki u?ytkownik nie istnieje!", "error") 
                triggerEvent("admin:addText", resourceRoot, "TH > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..cel.." - taki u?ytkownik nie istnieje!", math.random(0, 99)) 
            return
        end
        
        if isPedInVehicle(target) then
            removePedFromVehicle(target)
        end
        
        local position = {getElementPosition(plr)}
        setElementInterior(target, getElementInterior(plr))
        setElementDimension(target, getElementDimension(plr))
        setElementPosition(target, position[1] + math.random(1, 2), position[2] + math.random(1, 2), position[3])
        triggerEvent("admin:addText", resourceRoot, "TH > "..plr.name:gsub("#%x%x%x%x%x%x","").." > "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." (UID: "..getElementData(target, "player:uid")..")", math.random(0, 99))
    end
end)

addCommandHandler("vth", function(plr,cmd,cel)
    if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) then
        if not cel then
            outputChatBox("* U?ycie: /vth <ID>", plr)
            return
        end
        local target = exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
            return
        end
  veh = getPedOccupiedVehicle(target)
  x,y,z = getElementPosition(plr)
  
  if(veh)then
   setElementInterior(veh,getElementInterior(plr))
   setElementDimension(veh,getElementDimension(plr))
   setElementPosition(veh,x+math.random(1,2),y+math.random(1,2),z)
        exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "thv "..getPlayerName(target).."")
  else
   setElementInterior(target,getElementInterior(plr))
   setElementDimension(target,getElementDimension(plr))
   setElementPosition(target,x+math.random(1,2),y+math.random(1,2),z)
        exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "thv "..getPlayerName(target).."")
  end
    end
end)


Komentarz DsJ3 dodany 2019-01-29, 17:00Następnym razem dodaj załącznik[BBCode] [lua]Kod[./lua] bez kropki
Podpis
znam jakieś tam podstawy

==
Skrypt wojsko ACL -
https://gtao.pl/skrypt-wojsko-acl-vt134899.htm#833500
--
Skrypt Whitelista -
https://gtao.pl/skrypt-whitelista-vt135327.htm#835548
===
Ostatnio zmieniony przez DsJ3 2019-01-29, 17:00, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-29, 16:57


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wstaw konkretnie kod komend, ktore nie dzia?aj? a nie caly skrypt.
Uzyj znacznik?w [.lua] [./lua] bez kropek

Jakies bledy /debugscript 3?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-30, 02:24


OCBSlim







Wiek: 27
Na forum: 2844 dni
Posty: 43
Nick w MP: OCBSlim

Piwa: 415

Respekt: 60

Czy aby napewno masz dost?p do /duty? Sorry, ?e pytam ale widzia?em te? takich agent?w :mrgreen:

Podpis
Może kiedyś wrócę z nowym projektem! ;-) Pozdrawiam!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-03, 10:51


Mezo.

Mod-Team






Wiek: 25
Na forum: 3352 dni
Posty: 548
Nick w MP: Mezo

Piwa: 6085

Respekt: 517
Respekt: 517

Bez jakiegokolwiek infa b?dziemy tutaj sta? i ci??ko b?dzie nam Ci pom?c. Najlepiej by by?o jakby? poda? nam jakie? b?edy, je?eli takowe s? pod /debugscript 3. Je?eli masz dost?p do duty, odpal wcze?niej /debugscript3, wykonaj komende na kicka, i je?eli on faktycznie nie dzia?a, to wtedy na db3 wy?wietl? si? jakie? b??dy kt?re nam podaj tutaj.

Podpis
- Na forum pomagam na miarę swoich możliwości, oraz bezpłatnie.
- Jeżeli potrzebujesz pomocy, pisz do mnie w prywatnej wiadomości, pomoc uzyskasz szybciej.
Współpraca - [email protected]


Użytkownik - 19.08.2017
GTAO MEMBER - 29.03.2019
Support-Team - 03.02.2019 - 07.05.2019
Moderator - 07.05.2019 - 02.08.2020
Mod-Team - 02.08.2020 - 25.03.2022

Postaw piwo autorowi tego posta
 

 
Tagi: its :: /tt :: itd. :: nie :: dziala
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