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

Wysłany: 2018-06-25, 13:29


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

Witam, mam problem gdy? mam wgrany plik na jailsapd, i nie dzia?a mi komenda /jail (oczywi?cie jestem zalogowany do sapd gdy wpisuje t? komend?), pomo?ecie?
mam gm PYSA
Kod:
 local cub = createColCuboid(-2462.43, 3734.53, 300.57-1, 19, 15, 4)

function u(e)
getElementData(e, "dbid")
end

local cele = { -- x,y,z,int,dim
{1582.41, 1634.12, 10.83,0,0},
{1586.83, 1633.80, 10.83,0,0},
{1591.07, 1633.65, 10.83,0,0},
{1594.92, 1633.73, 10.83,0,0},
}
local x,y,z = -2446.84, 3777.43, 300.57
local function wypusc(plr)
setElementDimension(plr,0)
setElementInterior(plr,0)
setElementPosition(plr,x,y,z)
outputChatBox("Zosta?e? wypuszczony z wi?zienia.",plr, 255, 255, 255)
end

function getPlayerName2(plr)
if not plr then return end
return getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
end

local function sprawdz(plr)
if not plr then return end
if not getElementData(plr,"dbid") then return end
local x = exports.mysql:wykonaj("SELECT * FROM jail WHERE Serial=?",getPlayerSerial(plr))
if not x or #x < 1 then return end
local x2=exports.mysql:wykonaj("SELECT Termin FROM jail WHERE Serial=? and Termin < NOW()",getPlayerSerial(plr))
if x2 and #x2 > 0 then
exports.mysql:wykonaj("DELETE FROM jail WHERE Serial=?", getPlayerSerial(plr))
wypusc(plr)
return end
if isElementWithinColShape(plr,cub) then return end
setElementPosition(plr,cele[x[1].Cela][1],cele[x[1].Cela][2],cele[x[1].Cela][3])
setElementDimension(plr, 0)
end

local function sprawdzczas(plr)
if not plr then return end
if not getElementData(plr,"dbid") then return end
local x = exports.mysql:wykonaj("SELECT * FROM jail WHERE Serial=?",getPlayerSerial(plr))
if not x or #x < 1 then return end
local x2=exports.mysql:wykonaj("SELECT Termin FROM jail WHERE Serial=? and Termin < NOW()",getPlayerSerial(plr))
if x2 and #x2 > 0 then
exports.mysql:wykonaj("DELETE FROM jail WHERE Serial=?", getPlayerSerial(plr))
wypusc(plr)
return end
outputChatBox("Jeste? uwi?ziony w wi?zieniu do: #ff000"..x[1].Termin.." #ffffffza: #ff0000"..x[1].Powod.."", plr, 255, 255, 255, true)
end

function ajotceju(plr,cmd,target,ile,typ,zaco)
    if getElementData(plr, "frakcja")=="KGP" then
        if not target or not ile or not typ or not zaco then
        outputChatBox("U?ycie: /jail <gracz/ID> <czas> <m/h> <pow?d>", plr, 255, 255, 255)
        return
    end
    local osoba = findPlayer(plr, target)
    if not osoba then
        outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 255, 255)
        return
    end
    x1,x2,x3 = getElementPosition(plr)
    y1,y2,y3 = getElementPosition(osoba)
    dystans = getDistanceBetweenPoints3D(x1,x2,x3,y1,y2,y3)
    if dystans > 20.0 then outputChatBox("Ten gracz jest za daleko!", plr, 255, 255, 255) return end
    local cela=math.random(1, #cele)
    if typ=="m" or typ=="h" then
        if typ=="m"then
            exports.mysql:wykonaj("INSERT INTO jail (Serial,Termin,Cela,Powod) VALUES (?,NOW() + INTERVAL ?? minute,??,?)", getPlayerSerial(osoba), ile,cela, zaco)
            outputChatBox("Zosta?e? uwi?ziony w wi?zieniu przez #ff0000"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #ffffffza #ff0000"..zaco.." #ffffffna #ff0000"..ile.."#ffffff minut(-a/-y)", osoba, 255, 255, 255)
            outputChatBox("Uwi?ziono gracza "..getPlayerName(osoba):gsub("#%x%x%x%x%x%x","").." w wi?zieniu za "..zaco.." na "..ile.." minut(-a/-y)", plr, 255, 255, 255)
            sprawdz(plr)
        end
        if typ=="h" then
            exports.mysql:wykonaj("INSERT INTO jail (Serial,Termin,Cela,Powod) VALUES (?,NOW() + INTERVAL ?? hour,??,?)", getPlayerSerial(osoba), ile,cela, zaco)
            outputChatBox("Zosta?e? uwi?ziony w wi?zieniu przez #ff0000"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #ffffffza #ff0000"..zaco.." #ffffffna #ff0000"..ile.."#ffffff godzin(a/y)", osoba, 255, 255, 255)
            outputChatBox("Uwi?ziono gracza "..getPlayerName(osoba):gsub("#%x%x%x%x%x%x","").." w wi?zieniu za "..zaco.." na "..ile.." godzin(-a/-y)", plr, 255, 255, 255)
            sprawdz(plr)
        end
    end
    sprawdz(plr)
    cela=math.random(1, #cele)
    sprawdzczas(plr)
end
end
addCommandHandler("jail", ajotceju)

function unaj(plr,cmd,target)
if getElementData(plr, "frakcja")=="KGP" then
    local osoba = findPlayer(plr, target)
    if not osoba then
        outputChatBox("Nie znaleziono podanego gracza.", plr, 255, 255, 255)
        return
    end
    local jebnijsie=exports.mysql:wykonaj("SELECT Termin FROM jail WHERE Serial=? and Termin > NOW()",getPlayerSerial(osoba))
    if jebnijsie and #jebnijsie <= 0 then outputChatBox("Ten gracz nie jest w wi?zieniu! ("..getPlayerName(osoba)..")", plr,255,255,255) return end
    exports.mysql:wykonaj("DELETE FROM jail WHERE Serial=?", getPlayerSerial(osoba))
    outputChatBox("Gracz zosta? uwolniony z wi?zienia.", plr, 255, 255, 255)
    sprawdz(osoba)
    wypusc(osoba)
end
end
addCommandHandler("unjail", unaj)

setTimer(function()
for _,p in pairs(getElementsByType("player")) do
sprawdz(p)
end
 end,5000,0)

function spawn()
local x=exports.mysql:wykonaj("SELECT Termin FROM jail WHERE Serial=? and Termin > NOW()",getPlayerSerial(source))
if x and #x <= 0 then return end
sprawdzczas(source)
end
addEventHandler("onPlayerSpawn", getRootElement(), spawn)

function findPlayer(plr, cel)
    local target = nil
    if (tonumber(cel) ~= nil) then
        target = getElementByID("p"..cel)
    else
        for _,thePlayer in ipairs(getElementsByType("player")) do
            if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 1, true) then
                if (target) then
                    outputChatBox("Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter.", plr)
                    return nil
                end
                target=thePlayer
            end
        end
    end
    return target
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:02


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

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

poka? b??dy db3 oraz czy posiadasz element-dat? "frakcja" o warto?ci "KGP"?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:06


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

Jak wklei? i znale?? b??dy db3? Wiem jak si? w??cza na serwerze ale nie wiem gdzie to sie zapisuje xd Nic tam nie ma o /jail ani o tym skrypcie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:07


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

Kulegg, Nie dasz rady skopiowa?. Zr?b ssy.

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:39


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:42


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

Pokaz mi linijk? 124 z pystories-gui ze skryptu c_gui.lua reszta to error z shaderow i podmianek skin?w.

Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:44


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

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

Poka? kod logowania na s?u?b? SAPD.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:45


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

 fileDelete("c_gui.lua")  -- usuwamy 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:49


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

Kulegg, Zamiast robi? w taki spos?b, w mecie mo?esz wy??czy? pobieranie plik?w c-side:


<meta>
<script src = "c.lua" type = "client" cache = "false" />
</meta>


Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:53


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

 &#65279;--[[
    Developers: Yolos And Split
]]

local marker=createMarker(1538.24, 1598.67, 10.88-1, 'cylinder', 1.5, 0, 0, 255, 150)
setElementDimension(marker, 666)
setElementInterior(marker, 112)


local licz = {}
local t=createElement('text')
setElementData(t,'name','S?u?ba\nSan Andreas Police Department\n[SAPD]')
setElementDimension(t, 666)
setElementInterior(t, 112)
setElementPosition(t,1538.24, 1598.67, 10.88)



function isPlayerInPoliceFaction(plr)
 local sid=getElementData(plr,'player:sid')
 if not sid then return end

 local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SAPD", sid)
 if result[1] then
  return true
 else
  return false
 end
end

addEventHandler('onMarkerHit', marker, function(el,md)
 if isPlayerInPoliceFaction(el) then
  if not getElementData(el,'player:faction') then
    exports['pystories-frakcja-ustawienia']:rozpocznijnaliczanie(el)
   setElementData(el,'player:faction','SAPD')
    local rank = exports['pystories-frakcja-ustawienia']:getPlayerFactionRank(el,'SAPD')
    setElementData(el,"player:rank",rank)
    --giveWeapon(el,23,9999)
    --giveWeapon(el,22,9999)
    setElementData(el,"last:nick",getPlayerName(el))
    setElementData(el,"last:color",tostring(getPlayerNametagColor(el)))
    setPlayerName(el,"#0000CD"..getPlayerName(el):gsub("#%x%x%x%x%x%x",""))
    outputChatBox("* Rozpocz??e?(a?) s?u?be w Policji, udaj si? do przebieralni aby zmieni? skina!", el)
  else
   takeWeapon(el,23)
   --takeWeapon(el,22)
    exports['pystories-frakcja-ustawienia']:zatrzymajnaliczanie(el)
   setElementData(el, 'player:faction', false)
    setElementData(el,"player:rank",false)
   local skin=getElementData(el,"player:skin")
   setElementModel(el, skin)
   setPlayerName(el,getElementData(el,"last:nick"))
   outputChatBox("* Zako?czy?e?(a?) s?u?be w Policji.", el)
  end
 else
  outputChatBox('* Nie jeste? zatrudniony(a) jako Policjant.', el, 255, 0, 0)
 end
end)

function naliczanie(el)
    if isElement(el) then
   local x = getElementData(el,"player:workinjob") or 0
   setElementData(el,"player:workinjob",x+1)
   else
    if isTimer(licz[el]) then
    killTimer(licz[el])
    licz[el] = nil
    end
   end
end

local bronie2 = createMarker (1568.20, 1577.70, 10.90-1, "cylinder", 1.5, 0, 255, 0, 255 )
setElementDimension(bronie2, 666)
setElementInterior(bronie2, 112)
local t=createElement("text")
setElementData(t,"name", "Wyposa?enie Funkcjonariusza")
setElementPosition(t,1568.20, 1577.70, 10.90)
setElementDimension(t, 666)
setElementInterior(t, 112)


function bronie11(hitElement, matchingDimension)
    if source == bronie2 then
        if getElementData(hitElement,"player:faction") == "SAPD" then
        --if getElementData(hitElement,'player:rank') <= 4 then hitElement:outputChat("* Jeste? aktualnie podczas akademii, nie przys?uguje Ci wyposa?enie!") return end
            outputChatBox("* Wzi??e?(a?) swoje wyposa?enie!", hitElement)
            giveWeapon(hitElement, 23, 100000)
        else
            outputChatBox ("* Nie jeste? na s?u?bie, lub nie pracujesz w Policji", hitElement)
        end
    end
end
addEventHandler ("onMarkerHit", bronie2, bronie11)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:55


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

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

M?wisz, ?e jeste? na s?u?bie bla, bla...
Nie dzia?a Ci, bo nie masz takiej element-daty jak? wymaga komenda /jail.
Twoja element-data:
setElementData(el,'player:faction','SAPD')


A skrypt wymaga takiej:
if getElementData(plr, "frakcja")=="KGP" then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:56


Kulegg







Wiek: 46
Na forum: 3266 dni
Posty: 283

Piwa: 20

Respekt: 50

Czyli co mam zrobi? aby dzia?a?o?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:56


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

ElementDate do skryptu wsadzi?

Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:59


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

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

Kilka opcji:
1. Edytowa? obecn? element-dat? jak? otrzymujesz po zalogowaniu na s?u?b? (ale b?dzie to powodowa?o problemy np. innymi systemami zwi?zanymi z SAPD)
2. Doda? now? linijk? element-daty po zalogowaniu si? czyli
setElementData(el,'frakcja','KGP')

3. Lub zmieni? wymagania dla komendy /jail we wi?zieniu na:
if getElementData(plr, "player:faction")=="SAPD" then

Zaleci?bym zrobi? ostatni? opcj?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 14:59


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

&#65279;--[[
    Developers: Yolos And Split
]]

local marker=createMarker(1538.24, 1598.67, 10.88-1, 'cylinder', 1.5, 0, 0, 255, 150)
setElementDimension(marker, 666)
setElementInterior(marker, 112)


local licz = {}
local t=createElement('text')
setElementData(t,'name','S?u?ba\nSan Andreas Police Department\n[SAPD]')
setElementDimension(t, 666)
setElementInterior(t, 112)
setElementPosition(t,1538.24, 1598.67, 10.88)



function isPlayerInPoliceFaction(plr)
 local sid=getElementData(plr,'player:sid')
 if not sid then return end

 local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SAPD", sid)
 if result[1] then
  return true
 else
  return false
 end
end

addEventHandler('onMarkerHit', marker, function(el,md)
 if isPlayerInPoliceFaction(el) then
  if not getElementData(el,'player:faction') then
    exports['pystories-frakcja-ustawienia']:rozpocznijnaliczanie(el)
 if getElementData(plr, "player:faction")=="SAPD" then
    local rank = exports['pystories-frakcja-ustawienia']:getPlayerFactionRank(el,'SAPD')
    setElementData(el,"player:rank",rank)
    --giveWeapon(el,23,9999)
    --giveWeapon(el,22,9999)
    setElementData(el,"last:nick",getPlayerName(el))
    setElementData(el,"last:color",tostring(getPlayerNametagColor(el)))
    setPlayerName(el,"#0000CD"..getPlayerName(el):gsub("#%x%x%x%x%x%x",""))
    outputChatBox("* Rozpocz??e?(a?) s?u?be w Policji, udaj si? do przebieralni aby zmieni? skina!", el)
  else
   takeWeapon(el,23)
   --takeWeapon(el,22)
    exports['pystories-frakcja-ustawienia']:zatrzymajnaliczanie(el)
   setElementData(el, 'player:faction', false)
    setElementData(el,"player:rank",false)
   local skin=getElementData(el,"player:skin")
   setElementModel(el, skin)
   setPlayerName(el,getElementData(el,"last:nick"))
   outputChatBox("* Zako?czy?e?(a?) s?u?be w Policji.", el)
  end
 else
  outputChatBox('* Nie jeste? zatrudniony(a) jako Policjant.', el, 255, 0, 0)
 end
end)

function naliczanie(el)
    if isElement(el) then
   local x = getElementData(el,"player:workinjob") or 0
   setElementData(el,"player:workinjob",x+1)
   else
    if isTimer(licz[el]) then
    killTimer(licz[el])
    licz[el] = nil
    end
   end
end

local bronie2 = createMarker (1568.20, 1577.70, 10.90-1, "cylinder", 1.5, 0, 255, 0, 255 )
setElementDimension(bronie2, 666)
setElementInterior(bronie2, 112)
local t=createElement("text")
setElementData(t,"name", "Wyposa?enie Funkcjonariusza")
setElementPosition(t,1568.20, 1577.70, 10.90)
setElementDimension(t, 666)
setElementInterior(t, 112)


function bronie11(hitElement, matchingDimension)
    if source == bronie2 then
        if getElementData(hitElement,"player:faction") == "SAPD" then
        --if getElementData(hitElement,'player:rank') <= 4 then hitElement:outputChat("* Jeste? aktualnie podczas akademii, nie przys?uguje Ci wyposa?enie!") return end
            outputChatBox("* Wzi??e?(a?) swoje wyposa?enie!", hitElement)
            giveWeapon(hitElement, 23, 100000)
        else
            outputChatBox ("* Nie jeste? na s?u?bie, lub nie pracujesz w Policji", hitElement)
        end
    end
end
addEventHandler ("onMarkerHit", bronie2, bronie11)


Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Tagi: skrypt :: jailsapd :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Skrypt z jailsapd nie działa 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