Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: pracy
1. Nie zapisuje reputacji z pracy
Witam robi? serwer RPG I Chchcia?em sobie sprawdzi? Prace na pracy nabija?o reputacje a po reconnect tej reputacji nie by?o na koncie pare razy zmienia?em prace oraz core i dalej nic pomog?by ktos
2. Koniec pracy gdy pojazd wybuchnie
Tak jak w temacie potrzebuje zrobi? funkcje kt?ra b?dzie ko?czy?a prace gdy pojazd z pracy wybuchnie.
3. math.random w pracy
Cze??, wr?ci?em do lua, aktualnie zajmuj? si? prac?..
mam wypisane w tabeli punkty (markery do oddawania list?w) i nie wiem jak zrobi? by wybra?o tylko 3 markery.


local punktyListonosza 
= {
tutaj wypisane punkty
}

-- 
reszta kodu

local rand 
math.random(1punktyListonosza)
local markerList createMarker(punktyListonosza[rand][1],punktyListonosza[rand][2], punktyListonosza[rand][3]-.9"cylinder"3.22550080)


Czy m?g?by kto? mi to wyt?umaczy? ewentualnie poprawi? mnie?

Kod nie tworzy punkt?w, gdy wpisze v1 v2 v3 z pliku to tworzy wszystkie markery z pliku.
4. po wykonaniu pracy nie d
po wykonaniu pracy nie dostaje pieni?dzy MTA
wie mo?e kto? jak to naprawi??
prosze o szybk? odpowiedz!
5. Gui w pracy import-export.
Siema mam prac? import-export i po wej?ciu w blip do jej rozpocz?cia pokazuje si? kursor a gui nie prosz? o pomoc. Kod pracy.
c.lua
[lua]
local sx, sy = guiGetScreenSize()
zoom = 1
local minZoom = 2.2
if sx < 2048 then
zoom = math.min(minZoom, 2048/sx)
end
local data = false
local clickTick = getTickCount()
local garageVehicles = {}
local importVehicle = false
local importBlip = false
local font = dxCreateFont("files/normal.ttf", 30, false)
local vehiclesToTheft = {
["models"] = {
411, 541, 477, 562, 415, 451, 429, 560 , 402, 475, 580
},
["positions"] = {
{-1697.343, 9.01, 3.194, 359.871, 0, 357.735}, --SF Garage
{-617.977, -507.099, 25.16, 359.927, 359.912, 0.641}, -- SF opuszczony kurier
{168.506, -22.163, 1.219, 359.872, 0, 271.001}, -- BB
{1236.067, 213.407, 19.194, 359.87, 360, 99.89}, -- Montogomery
{2258.26, -83.444, 26.164, 359.865, 0.477, 269.188}, -- PC
{1544.807, 16.282, 23.778, 359.863, 0.2, 303.619}, -- Autostrada LV-LS
{1047.138, 2133.755, 10.461, 359.872, 0, 87.67}, -- LV obok lawety
{2625.921, 1136.281, 10.461, 359.872, 0, 181.257}, -- LV stacja
{2825.476, 967.843, 10.39, 359.872, 0.001, 175.67}, -- LV magazyny niby
{-155.495, 1083.222, 19.381, 359.873, 359.953, 50.308}, -- FC
{-884.932, 1520.25, 25.56, 359.879, 360, 54.315}, -- Za FC Zadupie
{-1249.279, 2703.418, 49.702, 359....
6. Zarobki z pracy do bankomatu.
Witam chcia?bym aby kto? pom?g? z tym ?eby pieni?dze sz?y do bankomatu a nie tak jakby na konto gracza (portfela). Chcia?bym jeszcze wiedzie? jak doda? wymagania do tej pracy. Kod podaj? ni?ej.
c.lua
[lua]
--[[
Praca busa

]]--

sx,sy = guiGetScreenSize()
screenW, screenH = guiGetScreenSize()
px, py = (screenW/1366),(screenH/768)

function mysz(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end


local code = "StreetView"
local districtsBus = {
{-1980.01,102.42,27.21},
{-1990.61,143.75,27.06},
{-2000.20,193.23,27.06},
{-1999.88,275.62,32.47},
{-2000.75,399.76,34.54},
{-2001.22,502.10,34.53},
{-2002.00,616.51,34.52},
{-2000.80,741.70,44.65},
{-2001.62,805.51,45.01},
{-2063.04,810.21,62.82},
{-2145.20,809.54,68.98},
{-2233.90,809.84,48.82},
{-2270.64,736.77,48.82},
{-2269.46,584.38,35.52},
{-2232.24,561.70,34.53},
{-2227.88,506.82,34.55},
{-2230.85,452.69,34.52},
{-2274.16,402.25,34.24},
{-2256.68,349.16,32.47},
{-2217.25,318.75,34.70},
{-2150.78,316.12,34.68},
{-2148.42,196.08,34.69},
{-2154.87,115.83,34.70},
{-2078.75,108.29,31.95},
{-2020.10,106.85,27.20},
{-1992.52, 101.07, 27.54},
}

local districtsBus2 = {
{-2004.80, 108.46, 27.75},
{-2043.68, 110.98, 28.87},
{-2120.67, 112.17,...
7. Dodanei gui do pracy
Witam, czy kto? podpowie jakich funkcji u?y? aby doda? do pracy autobus?w z paczki pys 3.0 gui ?? Gui ma by? prost?, ma by? zdj?cie i dwa buttony rozpocznij i zamknij
8. kończenie pracy wszystkim na magazynie
odczas wej??ia w blip ko?czenia pracy, zaka?cza prac? wszystkim raz wy?wietla notke wszystkim wok??
Jak kto? mo?e to prosze o wys?anie naprawionego kodu (ko?czenie pracy na samym ko?cu)
kod:

[lua]local screenW, screenH = guiGetScreenSize()
local startMagazyn = createMarker(2128.73, -2281.29, 14.24, "cylinder", 1.2)
setElementData(startMagazyn, "praca", true)
setElementDimension(startMagazyn, 0)

x, y = guiGetScreenSize()
px, py = (x/1024), (y/768)

pkt = {
{2162.06, -2263.93, 13.80},
{2159.68, -2270.21, 13.80},
{2137.31, -2255.17, 13.80},
{2143.15, -2254.54, 13.80},
{2143.77, -2249.24, 13.80},
{2150.12, -2252.99, 13.80},
{2148.86, -2248.05, 13.80},
{2160.23, -2258.49, 13.80},
--
{2163.50, -2259.14, 13.80},
{2165.94, -2261.86, 13.80},
{2166.06, -2242.07, 13.80},
{2163.87, -2244.06, 13.80},
{2165.07, -2250.83, 13.80},
{2167.08, -2252.51, 13.80},
{2170.59, -2252.84, 13.80},
{2172.83, -2250.83, 13.80},
{2174.66, -2249.49, 13.80},

}


setElementData(localPlayer, "skrzynia:magazyn", nil)

function isMouseIn ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end

posx, posy = 465, 6...
9. kończenie wszystkim pracy
Podczas wej??ia w blip ko?czenia pracy, zaka?cza prac? wszystkim raz wy?wietla notke wszystkim wok??

kod:
[lua]ocal screenW, screenH = guiGetScreenSize()
local startMagazyn = createMarker(2128.73, -2281.29, 14.24, "cylinder", 1.2)
setElementData(startMagazyn, "praca", true)
setElementDimension(startMagazyn, 0)

x, y = guiGetScreenSize()
px, py = (x/1024), (y/768)

pkt = {
{2162.06, -2263.93, 13.80},
{2159.68, -2270.21, 13.80},
{2137.31, -2255.17, 13.80},
{2143.15, -2254.54, 13.80},
{2143.77, -2249.24, 13.80},
{2150.12, -2252.99, 13.80},
{2148.86, -2248.05, 13.80},
{2160.23, -2258.49, 13.80},
--
{2163.50, -2259.14, 13.80},
{2165.94, -2261.86, 13.80},
{2166.06, -2242.07, 13.80},
{2163.87, -2244.06, 13.80},
{2165.07, -2250.83, 13.80},
{2167.08, -2252.51, 13.80},
{2170.59, -2252.84, 13.80},
{2172.83, -2250.83, 13.80},
{2174.66, -2249.49, 13.80},

}


setElementData(localPlayer, "skrzynia:magazyn", nil)

function isMouseIn ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end

posx, posy = 465, 621

addEventHandler("onClientRender", root, function()
if not getElementData(localPlayer, &...
10. Restart pracy
Witam, mam problem z wykonaniem kodu, ktory w momencie restartu/wylaczenia pracy, teleportuje gracza z elementdata "pracuje:laweta".


Kod jaki wykona?em na aktualn? chwil?:


addEventHandler
("onResourceStop"resourceRoot, function()
    for 
iv in ipairs(getElementsByType("player")) do
    if 
getElementData(v"pracuje:laweta"then
        exports
.ad_notifications:addNotification(v"Praca laweciarza zosta?a zrestartowana! Zosta?e? spowrotem przeteleportowany do miejsca rozpoczecia pracy.""info")
        
setElementPosition(v, -2449.60504.1230.09)
        
end
    end
end
)

11. Jak zrobić przenikające auta w pracy
Witam wie ktos mo?e jak zrobi? ?eby auta z jednej pracy przez siebie przenika?y ??
12. Menu do pracy
Witam jak w temacie chcialbym sie naucz jak zrobic menu do pracy np jest magazynier wchodze w blip i mam opcje Rozpocznij/Zakkoncz Zamiknij
13. Dwa bledy w pracy jeden przy rozpoczęciu drugi przy zakończe
Witam, gdy rozpoczynam prac? i ko?czepojawiaj? mi si? dwa blendy

Kod:


ERROR: Client (#800080Konrad) triggered serverside event destroyVeh, but event is not added serverside
Oraz
ERROR: Server triggered clientside event STARTJobBus, but event is not added clientside
[/code]

Pom?g?by kto??
14. dawanie zarobkow z pracy do bankomatu
Witam Chc? zrobi? export do bazy danych tak aby po wjechaniu w punkt na pracy dostawalo si? hajs do bankomatu nie do hudu


[lua]function busDriver(el, md)
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end

if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
addEventHandler("onClientRender",root,render3)
setTimer(renderstop3,2000,1)
--outputChatBox("* Zako�czy�e�/a� prac�.")
else
kasa = math.random(75,150)
showMarker()
playSoundFrontEnd(12)
if getElementData(el,"player:premium") then
addEventHandler("onClientRender",root,render4)
setTimer(renderstop4,1000,1)
--outputChatBox("* Zidentyfikowa?e?(a?) punkt i otrzymujesz 100 PLN.")
local id = getElementData(el, "player:sid")
exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money+15000 WHERE id=?", id)
setElementData(el,"player:srp", getElementData(el,"player:srp")+math.random(0,1))
else
--outputChatBox("* Zidentyfikowa?e?(a?) punkt i otrzymujesz 75 PLN.")
addEventHandler("onClientRender",root,render4)
...
15. Skrypt pracy - dawanie kasy
Witam mamy taki kod, zmieni?em nadanie kasy domy?lne na takie z bazy danych, ale kasy nie nadaje

[ Dodano: 2020-03-30, 12:13 ]
Kod:

else
exports.hud:sendBottomNotification(localPlayer, "Sadzenie Truskawek", "Zasadzi?e? Truskawki, zarobi?e? 15$")
setElementData(el,"player:reputation", getElementData(el,"player:reputation")+math.random(0,1))
exports.global:giveMoney(client, rate)
16. NIe daje hajsu za kursy w kazdej pracy
https://imgur.com/a/F14wsyp

O co chodzi? W debugu pisze co? z clientem. Pomocy! Prosz? o szybkie rozwi?zanie!
17. EMS nie zapisuje doświadczenia w pracy
Witam, ot?? mam ma?y problem z paczk? Emergency Stories 2.0. Wszystko jest podpi?te jak nale?y, interiory i modele wsio jest, ale w pracach nie zapisuje si? do?wiadczenie, mimo pracy nie zostaje naliczona kasa za wykonan? prac?, nie mog? doda? nikogo do Frakcji poprzez tabel?, dodam ?e logowanie i wszystko dzia?a, tylko nie zapisuje prac oraz nie mo?na doda? nikogo do frakcji. Za pomoc z g?ry dzi?kuj? i postawi? :piwo: nie jedno! :eye:
18. Zakańczanie pracy
Witam pisz? prac?, mam problem z zako?czeniem pracy, dok?adnie nie wiem jak funkcje na wjazd w marker "marko" napisa?. Chodzi o to, ?e gdy wjedziemy w marker nazwany "marko" marker ten usuwa.
kod
local ciezarowka createMarker(-1976.12,1329.43,7.19-1.1"cylinder"22551700100)

function 
MarkerHit(el2)
if 
getElementData(el2"player:ciezarowka"truethen 
    triggerClientEvent
(el2"onClientAddNotification"el2"Posiadasz ju? zrespion? ci??ar?wk? !""info")        
return 
end
local veh 
createVehicle(433,-1955.59,1326.85,7.68,0.5,360.0,180.5)
warpPedIntoVehicle (el2veh0)
setElementData(el2"player:ciezarowka"true)
ShowMarker()
end


addEventHandler
"onMarkerHit"ciezarowkaMarkerHit )
    

function 
ShowMarker()
local marko createMarker(-1891.13,1360.56,7.19-1.1,"cylinder"42551700,100)
end


Pr?bowa?em tak, lecz nic

function Koniec()
destroyElement(marko)
end
addEventHandler
"onMarkerHit"markoKoniec )
19. Usunięcie obiektu(skrzynki) po zakończeniu pracy
Hej,
Gdy pracuje na magazynier i chc? zako?czy? prac? na nim to musze wpisa? /zakoncz.magazynier.
Po wpisaniu tego, blipy(cel?w, czyli marker?w tam gdzie oddajemy skrzynke) znikaj? oraz praca si? zaka?cza, jednak?e tym samym obiekt(skrzynka), kt?ry trzymam po rozpocz?ciu tej pracy, dodany w skrypcie gdy pracujemy aby ta praca wygl?da?a "realistyczniej", nie znika. Ma?o tego, Po umarciu nadal mam t? skrzynk?, i tylko reconnect pomaga.

[lua]
local startPracy = createMarker(1788.29, -2056.47, 12.58, "cylinder", 1.5, 133, 133, 133, 50)
setElementData(startPracy,"custom44", true)
createBlipAttachedTo(startPracy, 46)

local punktyOgrodnik = {
{1802.99, -2031.37, 13.52},
{1787.07, -2024.83, 13.48},
{1796.59, -2038.03, 13.53},
{1806.03, -2051.78, 13.56},
{1788.29, -2044.61, 13.54},
{1768.58, -2040.66, 13.53},
{1780.94, -2035.44, 13.51},
{1779.75, -2071.79, 13.59},
{1766.35, -2056.17, 13.59},
{1753.01, -2072.80, 13.63},
}

x,y = guiGetScreenSize()
px, py = (x/1024), (y/768)

local mousePoints = {
{246*px, 387*py, 15*px, 15*px},
{276*px, 370*py, 15*px, 15*px},
{302*px, 377*py, 15*px, 15*px},
{342*px, 377*py, 15*px, 15*px},
{372*px, 360*py, 15*px, 15*px},
{402*px, 387*py, 15*px, 15*px},
{432*px, 387*py, 15*px, 15*px},
{442*px, 365*py, 15*px, 15*px},
{478*px, 365*py, 15*px, 15*px},
{498*px, 383*py, 15*px, 15*px},
{549*px, 366*py, 15*px, 15*px},
{569*px, 373*py, 15*px, 15*px},
{589*px, 383*py, 15*px, 15*px},
{595*px, 3...
20. Chat pm nie działa i zarobki w pracy
Witam nw co jest ale komenda ./pm dzia?a dla 10 pierwszych graczy i po reconnect przestaje dzia?a tak samo zarobkami w pracach
21. Dodanie wymagań do Pracy
Witam chce doda? wymagania np RP i Prawojazdy a nw jak prosz? o wyt?umaczenie i o gotowca




[lua]--[[
Resource: OURGame
Developers: Split <[email protected]>
Copyright <[email protected]> 2015-2016
You have no right to use this code without my permission.
]]

local m=createMarker(2743.95,-2453.70,13.86-1, "cylinder", 3, 0, 71, 255,65)
createBlipAttachedTo(m, 46,2,0,0,0,0,0,275)

local t=createElement("text")
setElementPosition(t,2743.95,-2453.70,13.86)
setElementData(t,"name","Praca dorywczanKurier")

addEvent("benson:stopJOB", true)
addEventHandler("benson:stopJOB", root, function(veh)
if not veh then return end
destroyElement(veh)
end)

addEventHandler("onMarkerHit", m, function(el,md)
if getElementType(el) == "player" and md then
if getElementData(el,"player:job") then
outputChatBox("* Ju? posiadasz aktywn? prac?: "..getElementData(el,"player:job"),el,255,0,0)
return
end
local veh=createVehicle(getVehicleModelFromName("Benson"), 2745.10, -2445.74, 13.64, 359.4, 359.9, 270.0)
setElementData(veh,"temporary", true)
setElementData(veh,"spawnedBy", el)
setElementData(veh,"vehicle:mileage",0)
setElementData(veh,"vehicle:fuel",120)
warpPedI...
22. Bot przy pracy
Siema! Mam taki pomys?. Je?li jestem w samochodzie, wjad? w marker, to pojawia si? bot, kt?ry mia?by ustawion? animacj? jak??, ?e co? podnosi i idzie w wyznaczone miejsce. Tylko kompletnie, nie wiem czego u?y?, ?eby tak by?o. M?g?bym od kogo? do?wiadczonego, otrzyma? podpowied? plus jakby by?o to wyt?umaczy? co do czego?

Nic za darmo!
Pomoc :=:
:piwo: :+: R*

Z g?ry dzi?kuje!
23. Wymagane RP do rozpoczecia pracy
Witam ot?? mam kod jak i linijke lecz nie wiem jak to wstawi? by zadzialalo poprawnie. Chodzi mi g?ownie o to, ze jak gracz wejdzie w marker wy?wietla si? informacja ze nie posiada danej reputacji
kod kt?ry chce doda?
[lua]if getElementData(localPlayer, "player:reputation") < 350 then triggerEvent("onClientAddNotification", localPlayer, "Nie posiadasz 350 REP", "error") return end[/lua]

kod pracy
[lua]local missionText=createElement("text")
setElementData(missionText, "name", "Rozpocz?cie Pracy MoveLineTrain")
setElementPosition(missionText, -2275.65, 521.40, 35.11)
local parking=createElement("text")
--setElementData(parking, "name", "Zajezdnia FirmynPSRPG Company.nnNie Zastawia?!")
--setElementPosition(parking, -2270.48, 510.18, 35.02)
--local parking2=createElement("text")
--setElementData(parking2, "name", "Parking FirmynThe Well Stacked Pizza Co.nNie Zastawia?!")
--setElementPosition(parking2, 2095.67, -1794.74, 13.39)
local zone = createColCuboid(-2276.08, 505.98, 34.02, 11, 11, 11)
local opistrain = "MoveLineTransport."

createBlipAttachedTo(parking, 46)

---createBlip(-2105.49, -1806.53, 13.55, 46,2,0,0,0,0,0,275)
-- local m1 = createMarker(-1922.67,573.14,34.45, "cylinder", 2.2, 96, 96, 96)
local tramwaje = createMarker(-2275.65, 521.40, 35.11-0.9, "cylinder", 1.5, 255, 0, 0)

--cre...
24. w urzędzie nie ma wybóru pracy u tunera
Tak, jak w temacie gdy wchodz?, do urz?du i do markeru Wyb?r pracy to nic mi si? nie wy?wietla mam paczk? PseudoLife...
25. Nie respi pojazdu w pracy
Siema nie respi pojazdu w pracy

SERVER:
[lua]Pojazdy = {
{-1851.09,-129.32,11.63,0.0,0.2,86.5},
{-1851.18,-134.53,11.63,0.1,359.9,87.2},
{-1851.25,-140.04,11.63,0.1,359.9,86.7},
{-1876.55,-149.54,11.63,0.0,0.0,358.9},
{-1882.07,-149.38,11.63,0.0,0.0,356.6},
}

for i,v in ipairs(Pojazdy) do
local Pojazd = createVehicle(609, v[1], v[2], v[3]+0.3, v[4], v[5], v[6])
setElementData(Pojazd, "pojazd_opis", "Za?adowane Meble : 0%")
setVehicleColor (Pojazd, 0, 255, 84 )
setVehicleHandling(Pojazd,"maxVelocity",100)
setElementData(Pojazd, "pojazdy_przebieg", math.random(500, 1000))
setElementData(Pojazd, "pojazdy_paliwo", 50)
setElementFrozen(Pojazd, true)
setVehicleEngineState(Pojazd, false)
end

addEventHandler("onVehicleEnter", resourceRoot, function(plr, seat)
if seat == 0 then
if getElementData(plr, "graczPraca") == false then
setElementData(plr, "graczPraca", true)
setElementFrozen(source, false)
outputChatBox("* Rozpocza?e? Prace Jako Kurier Mebli, Jed? Za?adowa? Meble!", plr, 255, 255, 255)
triggerClientEvent(plr, "kurier_praca", resourceRoot)
else
outputChatBox("* Posiadasz Ju? Aktywn? Prace!", plr, 255, 0, 0)
end
end
end)



function respawnVehicles()
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
if not getVehicleOccupant(v) then
...
26. Nie wiem jak zrobic w pracy kosiarek
Witam mam problem z tym , ?e jak zaczn? prace kosiarek to ?eby w tym miejscu gdzie jest blip na mapie pokazywal sie krzak i jak sie przejedzie przez to to on sie usuwa i pokazuje nastepny za pomoc daje :piwo:
27. Ulepszenie Auta w pracy
Witam wie kto? mo?e jak doda? ulepszenie auta do danej pracy chodzi, mi oto ?e

jak wchodze w marker pracy to chcia?bym ?eby pojazd dosta? ju? jakie? ulepszenie typu: Nitro,Spoiler itp


Za pomoc R* oraz :piwo:
28. TOP lista w pracy
B??d bad arguments #1 to 'concat' (table expected got nil)

praca.lua

function load_fabryka_table()
    
local q exports.MXL_dbb:mysql_query("select * from TABELA_users order by punkty_busy desc")
    
local ranking_table = {}

    for 
1,do
        
table.insert(ranking_tableq[i]["login"]..": "..q[i]["punkty_busy"].." punkt?w")
    
end

    
return ranking_table
end


job.lua

"Ranking pracy:n"..table.concat(details[13], "n"),
29. Pojazd w pracy
Cze?? mam problemik poniewa? robie prace Elektryka i chc? aby tworzy? si? pojazd pony i nas tam tepa?o a po zako?czeniu pracy si? niszczy? tutaj lua:
Kod:

ElektrykStart = createMarker(1352.30347, -1759.24646, 13.50781-0.9, "cylinder",2,255,255,0)
createBlipAttachedTo(ElektrykStart,46)

local skrzynki = {
{1554.68933, -1678.33997, 16.19531},
{1442.74133, -1582.64551, 13.54688},
{1322.10388, -1701.16809, 13.54688},
{1411.16040, -1775.11145, 14.38105},
{1372.21838, -1741.92639, 13.54688},
}

function jobStart()
if started then outputChatBox("Posiadasz aktywn? prac?!",255,0,0) return end
local los=math.random(1, #skrzynki)
rnd=skrzynki
m=createMarker(rnd[los][1],rnd[los][2],rnd[los][3]-0.9, 'cylinder', 1)
b=createBlipAttachedTo(m,41)
started=true
---------------------
addEventHandler("onClientMarkerHit", m, function()
destroyElement(m)
destroyElement(b)
started=false
kasa=math.random(5,30)
outputChatBox("Za naprawienie skrzyki elektrycznej otrzymujesz "..kasa.."$",0,255,0)
givePlayerMoney(kasa)
end)
---------------------
end
addEventHandler("onClientMarkerHit", ElektrykStart, jobStart)
30. RP w pracy
Witam, robie skrypt na prace, ktora ma wymagac RP. Skrypt jest oczywiscie pod OG-RPG. Ale niestety po wrzuceniu skryptu cos sie rozwalilo z systemem RP.
Przez co nie moge rozpoczac pracy. Dodam iz nawet na hudzie znikla ilosc RP, nie edyotowalem zapisu graczy ani MySql. Jedynie co zrobilem to przeczyscilem Mysql Blad jaki mi wyskakuje w konsoli:
[2018-03-24 11:07] ERROR: [Joby]/rpg_job_autobusy/server.lua:24: attempt to compare boolean with number
Kawalek kodu:
addEvent("lvl2"true)
addEventHandler("lvl2"root, function()
if 
getElementData(source,"player:autobusy") < 150 then 
outputChatBox
("#ff0000&#10006; #FFFFFFAby pracowac na 2 poziomie musisz zdobyc 150 punktow Reputacji",source255255255true)
return
end
if getElementData(source,"player:license:pjC") < 1 then 
outputChatBox
("#ff0000&#10006; #FFFFFFAby pracowac na 2 poziomie musisz posiadac Prawo Jazdy Kategorii: C.",source255255255true)
return
end

    local x
,y,getElementPosition(source)
    
local auto createVehicle(4311741.82,-1857.70,13.51,359.5,0.1,268.8)
    
setElementData(auto"vehicle:fuel"100)
    
setElementData(auto"vehicle:mileage"math.random(50000,80000))
    
setTimer(warpPedIntoVehicle,100,1,sourceauto)
    
outputChatBox("#00cc00&#10004; #FFFFFFRozpoczeles prace zajezdni na poziomie 2.",source255255255true)
end)
31. nie ma pracy tune w zatrudnianiu
to tak wchodze w urzad prace a tam tune nie ma w mysql probowalem dodac ale nwm jak do tego sie zabrac
32. Topka do pracy w GUI
Witam, chcia?bym zrobi? do systemu "Top 10" tak, aby nie by?o to wy?wietlane jako lat?j?cy napis, tylko dxDrawText.
Kod:

str
="(odswiezanie: 10 sekund)nRanking pracy kuriera:"
local t=createElement("text")
setElementData(t,"name",str)
setElementPosition(t,2151.39, -2247.3114.89+1.5)

function 
aktualizujText()
local q=exports["ogrpg-db"]:dbGet("select * from job_kurier_topka order by ilosc desc limit 10")
str="(odswiezanie: 10 sekund)nRanking pracy kuriera:"
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"].." oddane paczki"
else
str=""..str.."n"..iii..". "..v2["login2"].." - "..v["ilosc"].." oddane paczki"
end
end
end
setElementData
(t"name"str)
end
setTimer
(aktualizujText100000)
33. Nie moge rozpocząć pracy
..
34. Przenikanie w pracy
Ot?? prowadz? serwer gdzie jest ponad 80-90 graczy dziennie i ci?gle narzekaj? na to, ?e w pracach s? kolizje, na ParadiseRPG widzia?em, ?e by?o przenikanie i chcia?bym zrobi? co? takiego jak tam.
Za obja?nienie jak to zrobi? dam piwko i mo?e respekt.
35. Wypłata z pracy i punkty GP
Witam ot?? mam taki problem ze za jedno paczk? powinno mi dawa? 15 euro + 1 GP
i pieni?dze si? powinny odbiera? w urz?dzie a GP powinno dawa? odrazu a nie daje.
[b]Kawa?ek kodu(c)[/b]
[lua]
destroyElement(blip)
setElementFrozen(el, true)
setTimer(function()
setElementFrozen(el, false)
outputChatBox("[ Informacja ] Skrzynia dostarczona, swoje pieni?dze mo?esz odebra? w urzedzie.( +15 euro oraz 1 GP )")
destroyElement(skrzynia)
destroyElement(cel)
setPedAnimation(localPlayer, false)
toggleControl("sprint", true)
setElementData(el, "gracz_praca", false)
local pkt = getElementData(el, "szacunek")
local wyplata = getElementData(el,"gracz_wyplata")
setElementData(el,"gracz_wyplata", wyplata + 15)
setElementData(el, "szacunek", pkt + 1)
end, 9000, 1)
end)
else
outputChatBox(" Posiadasz aktywn? prac?.")
end
end)
[/lua]
[b]Kod na wyp?aty w urz?dzie(s)[/b]
[lua]
local wyplaty = createMarker(-169.84,-6694.25,14.24, "cylinder", 2.0, 255, 0, 0, 0)
setElementDimension(wyplaty, 0)
setElementInterior(wyplaty, 0)

function Wyplatyxd(source)
if getElementType(source) ~= "player" then return end
local pieniadze = getElementData(sourc...
36. Nie Zapisuje Punktów i nie daje ich w pracy
Wiec tak jak napisa??m w temacie daje sobie punkty przez komende to normalnie mi daje punkty ale jak wyjde z serwera to ich nie zapisuje jak np ide do pracy to kase daje mi ale punkt?w nie. Prosze o pomoc za pomoc R* :+: :piwo: //B??d?w w debugu nie wywala.


[b]Kod na Punkty(po stronie servera][/b]
[lua]
function odczyt ()
local konto = getAccountName(getAccountPlayer(source))
local data = getAccountData(konto, "Respekt")
if data then
setElementData(source, "Respekt", data)
else
setAccountData(konto, "Respekt", 0)
setElementData(source, "Respekt", 0)
end
end
addEventHandler ( 'onPlayerLogin', getRootElement (), odczyt)

function zapis ()
local konto = getAccountName(getAccountPlayer(source))
local data = getElementData(source, "Respekt")
if data then
setAccountData(konto, "Respekt", data)
end
end
addEventHandler("OnPlayerQuit",getRootElement(),zapis)

function addScore(points)
setElementData(konto, "Respekt", getElementData(konto, "Respekt") + points)
end

addEvent("addScore", true)
addEventHandler("addScore", getRootElement(), addScore)
---------dawanie score

addCommandHandler ( "dajpunkt",
function ( player, cmd, nick, kwota )


if nick and kwota then
local aplayer = getPlayerFromName ( nick )
if aplayer then
kwota = to...
37. Wybór pracy
Tak wi?c chcia?em si? zwolni? z Tunera, i tu nagle nic. ?adnego komunikatu wog?le si? nic nie pokazuje, chcia?bym to naprawi?. :P Prosz? o pomoc :)

[code]

-- Od?wie?anie tabeli


function getyesterday()
local realTime=getRealTime()
date=string.format("%04d-%02d-%02d", realTime.year+1900, realTime.month+1, realTime.monthday-1)
return date
end

function getday()
local realTime=getRealTime()
date=string.format("%04d-%02d-%02d", realTime.year+1900, realTime.month+1, realTime.monthday)
return date
end

function refreshing(client)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_office")
if result and #result > 0 then
triggerClientEvent(client, "jobs:refresh", resourceRoot, result)
end
end


setTimer(function()
local result=exports["ogrpg-db"]:pobierzTabeleWynikow("SELECT * FROM ogrpg_jobs")
if (result) then
for ii,vv in ipairs(result) do
--if vv["code"] ~= "SAPD" then
if vv["actived"] ~= getyesterday() and vv["actived"] ~= getday() then
local query=string.format("SELECT * FROM ogrpg_office WHERE code=%q", vv["code"])
local result2=exports["ogrpg-db"]:pobierzWyniki(query)
if (result2) then
local query2=string.format("UPDATE ogrpg_office SET spaces=%d WHERE code=%q", result2["spaces"]-1, vv["code"])
export...
38. blipy w pracy na radarze
Witam, mam problem z dodaniem blip?w do "missionPointsD" na radarze. Og?lnie to pr?bowa?em je zrobi? i odziwo mi si? uda?o lecz po wleceniu w markery one nie znika?y. dam czysty kod mo?e kto? z was by to wykona?. (pisalem w pro?bie o przerobienie skryptu ale nikt sie nie odzywa -,- )

[lua]
createBlip ( 1393.81, 1251.28, 10.82, 46, 2, 255, 0, 0, 255, 0, 400)
local missionTimer
local missionVehicle
local missionWysypiskaD = {
{1393.81, 1251.28, 10.82},
}
local missionPointsD = {


{1510.02, 1469.23, 183.85},
{1454.08, 1620.11, 183.85},
{1339.48, 1593.27, 183.85},
{1432.73, 1780.46, 71.95},
{1428.17, 1948.34, 62.25},
{1437.01, 2124.77, 42.10},
{1487.96, 2203.80, 69.20},
{1538.71, 2197.85, 69.20},
{1657.53, 2177.71, 69.20},


}
local countMarkers=#missionPointsD

for i,v in ipairs(missionWysypiskaD) do
local marker=createMarker(v[1], v[2], v[3]-1, "cylinder", 4, 0, 71, 255,100)
createPickup ( v[1], v[2], v[3]+1, 3, 1318 )
setElementData(marker,"wysypisko",true)
--createBlipAttachedTo(marker, 52)


local t=createElement("text")
setElementData(t,"name","Miejsce oddanianzebranych danych!")
setElementPosition(t, v[1], v[2], v[3])
end

function showMarker()
for i,rnd in ipairs(missionPointsD) do
markerr=createMarker(rnd[1], rnd[2], rnd[3], "arrow", 7, 0, 80, 180,255)



...
39. Zakączenie pracy po śmierci
Jak zrobi? by po ?mierci gracza praca by si? k?czy?a??? Bo teraz po ?mierci praca si? nie k?czy si?
40. Zakonczenei Pracy
Mam troche problem bo chce ze jak wyjde z auta to po np.10sek Auto znika i praca sie konczy.

I Auto normalnie znika itp jest i Powinna Sie praca konczyc Ale nie konczy sie


--Serwer
function respawnVehicles()
    for 
i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
        if 
not getVehicleOccupant(vthen
            respawnVehicle
(v)
            
setElementFrozen(vtrue)
            
setVehicleEngineState vfalse )
            
triggerClientEvent(plr"koniec"resourceRoot)
        
end
    end
end
setTimer
(respawnVehicles100000)


--Client


addEvent
("koniec"true)
addEventHandler("koniec"resourceRoot, function(localPlayer)
setElementData(localPlayer"gracz_praca8"false)
         
destroyElement(blip)

                
outputChatBox("#919191[#0053FFInformacja#919191] #ff0000Za D?ugo By?es/as Poza Pojazdem, Zakonczono Prace",255,255,255,true
                
destroyElement(cel)



end)



//Ten OutPutChatBox:
outputChatBox("#919191[#0053FFInformacja#919191] #ff0000Za D?ugo By?es/as Poza Pojazdem, Zakonczono Prace",255,255,255,true


Sie Pojawia