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

Wysłany: 2018-10-01, 17:22


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? mam 2 prace g?rnik oraz magazynier inaczej noszenie cegie?, wi?c tak w bazie danych wszystko ok, magazynier topki dzia?aj? prawid?owo, lecz w g?rniku co? nie tak 2 kody

Kod g?rnika
local weapon_id 7
local category_animation "BASEBALL"
local digging_animation "bat_4"

str="(odswie?anie: 10 sekund)\nRanking pracy (G?rnik):"
local t=createElement("text")
setElementData(t,"name",str)
setElementPosition(t,-1983.73, -715.0832.02+2)

function aktualizujText()
local q=exports["ogrpg-db"]:dbGet("select * from job_top_gornik order by ilosc desc limit 10")
str="(odswie?anie: 10 sekund)\nRanking pracy (G?rnik):"
for i,v in ipairs(q) do
iii=i
local nick=exports["ogrpg-db"]:dbGet("select login,login2 from ogrpg_users where id=?"v["uid"])
for i2,v2 in ipairs(nick) do
if i2 1 then return end
if v2["login2"] == false then
str=""..str.."\n"..iii..". "..v2["login"].." - "..v["ilosc"].." wydobytych surowc?w"
else
str=""..str.."\n"..iii..". "..v2["login2"].." - "..v["ilosc"].." wydobytych surowc?w"
end
end
end
setElementData(t"name"str)
end
setTimer(aktualizujText100000)

function give_weapon()
giveWeapon(sourceweapon_id1)
setPedWeaponSlot(source1)
end
addEvent("kilof"trueaddEventHandler("kilof"getRootElement(), give_weapon)

function animation()
setPedAnimation(source"BASEBALL""Bat_4")
end
addEvent("animation"trueaddEventHandler("animation"getRootElement(), animation)

function end_job()
setPedAnimation(sourcefalse)
takeWeapon(sourceweapon_id)
end
addEvent("end_job"trueaddEventHandler("end_job"getRootElement(), end_job)

function koniec_animka()
setPedAnimation(sourcefalse)
end
addEvent("end_animation"trueaddEventHandler("end_animation"getRootElement(), koniec_animka)

addEvent("hajsikkopalnia",true)
addEventHandler("hajsikkopalnia",root,function(kwota)
givePlayerMoney(sourcekwota)
end)

local t=createElement("text")
setElementData(t,"scale",1.7)
setElementData(t,"name","Wejscie Do Kopalni")
setElementInterior(t,0)
setElementDimension(t,0)
setElementPosition(t,-989.07, -1380.37130.63)
createBlipAttachedTo (t46)

local t=createElement("text")
setElementData(t,"scale",1.7)
setElementData(t,"name","Wyjscie Z Kopalni")
setElementInterior(t,0)
setElementDimension(t,0)
setElementPosition(t,-981.63, -1361.31116.80)

door createMarker (-989.07, -1380.37130.63-1"cylinder"1.3255255255,0)
        setElementData(door"markery7"true)
setElementDimension(door0)
setElementInterior(door0)


addEventHandler("onMarkerHit"door, function(elmd)
    if getElementType(el) ~= "player" then return end
    if isPedInVehicle(elthen return end
    setElementDimension(el0)
    setElementInterior(el0)
    setElementPosition(el,  -978.13, -1361.11116.80)
end)


Kod Magazyniera (noszenia cegie?) kt?ry dzia?a


function odbierzWyplate(pln)
    local uid getElementData(source,"player:uid")
    local hajs getPlayerMoney(source)
    local rnd = {math.random(125), math.random(12)}
    if rnd[1] == or rnd[1] == or rnd[1] == 9 then setElementData(source"player:reputation", (getElementData(source"player:reputation") or 0)+rnd[2]) end
    givePlayerMoney(sourcepln)
    exports["ogrpg-db"]:dbSet("insert into Logi_wyplaty_pracedorywcze values (null,null,?,?,?,?,?,?)",uid,getPlayerSerial(source),"Magazynier",pln,hajs,hajs+pln)
    local q1=exports["ogrpg-db"]:dbGet("select * from job_top_magazyn where uid=?"tonumber(uid))
    if not q1 or #q1 < 1 then
        exports["ogrpg-db"]:dbSet("insert into job_top_magazyn (uid, ilosc) VALUES(?, 1)"uid)
    else
        exports["ogrpg-db"]:dbSet("update job_top_magazyn set ilosc = ilosc + 1 where uid=?"uid)
    end
end
addEvent("prace:wyplata:magazyn",true)
addEventHandler("prace:wyplata:magazyn",getRootElement(),odbierzWyplate)

str="(odswie?anie: 10 sekund)\nRanking pracy (Dostarczania Cegie?):"
local t=createElement("text")
setElementData(t,"name",str)
setElementPosition(t,2493.741874.6810.82+1.1)

function aktualizujText()
local q=exports["ogrpg-db"]:dbGet("select * from job_top_magazyn order by ilosc desc limit 10")
str="(odswie?anie: 10 sekund)\nRanking pracy (Dostarczania Cegie?):"
for i,v in ipairs(q) do
iii=i
local nick=exports["ogrpg-db"]:dbGet("select login,login2 from ogrpg_users where id=?"v["uid"])
for i2,v2 in ipairs(nick) do
if i2 1 then return end
if v2["login2"] == false then
str=""..str.."\n"..iii..". "..v2["login"].." - "..v["ilosc"].." od?o?one ceg?y"
else
str=""..str.."\n"..iii..". "..v2["login2"].." - "..v["ilosc"].." od?o?one ceg?y"
end
end
end
setElementData(t"name"str)
end
setTimer(aktualizujText100000)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-01, 17:24


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Jakie? b??dy db3 s??

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-01, 18:18


DomineQ

lua mejster






Wiek: 22
Na forum: 3960 dni
Posty: 309
Nick w MP: EZ3N

Piwa: 5186

Respekt: 85,8

Bez DB3 Ci nikt nie pomo?e.
Mo?liwe, ?e brakuje kolumny.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-01, 19:56


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

w db3 nie ma ?adnego b??du

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-02, 17:57


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Podmie? na to i poka? co Ci wyskoczy w db3.
function aktualizujText()
    local q=exports["ogrpg-db"]:dbGet("select * from job_top_gornik order by ilosc desc limit 10")
    iprint("LOCAL q =" ..q)
    str="(odswie?anie: 10 sekund)\nRanking pracy (G?rnik):"
    for i,v in ipairs(q) do
    iii=i
    local nick=exports["ogrpg-db"]:dbGet("select login,login2 from ogrpg_users where id=?"v["uid"])
    iprint("LOCAL nick =" ..nick)
    for i2,v2 in ipairs(nick) do
    if i2 1 then return end
    if v2["login2"] == false then
    str=""..str.."\n"..iii..". "..v2["login"].." - "..v["ilosc"].." wydobytych surowc?w"
    else
    str=""..str.."\n"..iii..". "..v2["login2"].." - "..v["ilosc"].." wydobytych surowc?w"
    end
    end
    end
    setElementData(t"name"str)
    end
    setTimer(aktualizujText100000)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-05, 22:15


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3210 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

dalej s? b??dy?

Podpis
Pomogłem Ci
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
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