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

Wysłany: 2016-12-23, 18:31


lolekpl1234







Wiek: 25
Na forum: 3778 dni
Posty: 11
Nick w MP: DallaS.



Respekt: 45,3

mam problem z zapisem pieni?dzy, gdy zarabiam w pracy tramwaj dostaje pieni?dze lecz w panelu admina pisze ?e mam 0 $. I dlatego nie mog? kupi? pojazdu w salonie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-23, 23:11


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Zapewne w pracy zamiast pieni?dzy nadaje element dat? pieni?dzy zamie? to na givePlayerMoney

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-23, 23:16


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4048 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

Hazmudex, Triger zapewne a nie element data :P

Podaj kod :)

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-24, 10:17


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

"Barcioo" napisał/a:

Hazmudex, Triger zapewne a nie element data :P

Podaj kod :)
co triger ma do pieni?dzy skoro skrypt niby daje to musi nadawa? element dat? pieni?dzy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-24, 11:53


lolekpl1234







Wiek: 25
Na forum: 3778 dni
Posty: 11
Nick w MP: DallaS.



Respekt: 45,3

ju? podaje

S:
Kod:

ocal m1 = createMarker(-2269.42,533.11,35.02, "cylinder", 2, 0, 107, 99)
vehs = {}


function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end

addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "zrespilGracz") then
outputChatBox("praca w trakcie poprawek", el)
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end

local x,y,z = getElementPosition(el)
local bus = createVehicle(449, x,y,z, 180, 0.0, 0.4)

setElementData(bus, "zrespilGracz", el)
setElementData(bus, "pojazd_paliwo", 50)
setElementData(bus, "pojazd_przebieg", 100)


setVehicleHandling(bus, "maxVelocity", 0.1)
setVehicleHandling(bus, "engineAcceleration", 2 )
setVehicleHandling(bus, "ABS", true )


warpPedIntoVehicle(el, bus)
removePreviousVehicles(el)
triggerClientEvent(el, "STARTJobBus", resourceRoot, bus)

vehs[el] = bus
end)

addEvent("STOPJobBus", true)
addEventHandler("STOPJobBus", resourceRoot, function()
local pojazd = getPedOccupiedVehicle(localPlayer)
if pojazd then
destroyElement(pojazd)
end
end)

addEvent("destroyVeh", true)
addEventHandler("destroyVeh", getRootElement(),
function()
if vehs[source] then
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)


function givePlayerMoney_server(plr, ile)
if plr and tonumber(ile) then
givePlayerMoney(plr, ile)
else
return
end
end
addEvent("givePlayerMoney_server", true)
addEventHandler("givePlayerMoney_server", root, givePlayerMoney_server)



C:
Kod:

local districtsBus = {
{-2267.09, 513.41, 35.21},
{-2361.05, 508.25, 29.70},
{-2334.35, 446.11, 33.93},
{-2251.87, 324.60, 35.32},
{-2252.09, 137.86, 35.32},
{-2255.90, -53.92, 35.32},
{-2179.74, -70.35, 35.32},
{-2157.58, 29.73, 35.32},
{-2008.12, 32.28, 32.92},
{-2006.04, 152.42, 27.70},
{-2003.16, 327.24, 35.20},
{-2000.66, 582.50, 35.20},
{-1866.77, 602.79, 35.20},
{-1711.04, 640.27, 24.82},
{-1658.49, 728.29, 17.35},
{-1542.51, 753.95, 7.20},
{-1554.45, 849.46, 7.20},
{-1737.17, 849.34, 24.89},
{-1941.91, 849.34, 40.29},
{-1906.05, 920.55, 35.20},
{-1671.73, 920.66, 24.82},
{-1568.30, 1005.91, 7.20},
{-1619.79, 1233.35, 7.20},
{-1880.92, 1348.59, 7.20},
{-2094.87, 1274.71, 15.28},
{-2265.25, 1182.31, 55.78},
{-2265.34, 928.57, 66.66},
{-2265.42, 724.64, 49.49},
{-2265.30, 548.17, 35.22},
}

local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus

function finishJob()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end

if jobTarget and isElement(jobTarget) then
destroyElement(jobTarget)
jobTarget = nil
jobTarget = 0

end

triggerServerEvent("destroyVeh", localPlayer)

end


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)
outputChatBox("* Zako?czy?e?/a? prac?.")
else
showMarker()
playSoundFrontEnd(12)
playSoundFrontEnd(12)
givePlayerMoney(500)
triggerServerEvent("givePlayerMoney_server", localPlayer, 500)
outputChatBox("Brawo, zarobi?es 500 $ za przejechany punkt.")
end
end

function showMarker()
if jobMarker and isElement(jobMarker) then
destroyElement(jobMarker)
jobMarker = nil
end

jobTarget = jobTarget + 1
jobMarker = createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint", 4, 0, 0, 255)

if districtsBus[jobTarget+1] then
ile = districtsBus[jobTarget+1]
setMarkerTarget(jobMarker, ile[1], ile[2], ile[3])
end

addEventHandler("onClientMarkerHit", jobMarker, busDriver)
end

addEvent("STARTJobBus", true)
addEventHandler("STARTJobBus", resourceRoot, function(veh)
outputChatBox("* Rozpocz??e?/a? prac?.")
jobVehicle = veh
jobTarget = 0
showMarker()
end)

addEventHandler("onClientResourceStop", resourceRoot, function()
if jobVehicle and getElementData(localPlayer, "gracz_praca") then
setElementData(localPlayer, "gracz_praca", false)
end
end)


addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
if seat == 0 then
if plr == localPlayer then
finishJob()
outputChatBox("* Zako?czy?e? prac?")
end
end
end)


Komentarz luki123luki123 dodany 2016-12-25, 11:25W dziale lua stosujemy znaczniki lua: [.lua]kod[./lua] Bez kropek
Postaw piwo autorowi tego posta
 

 
Tagi: zapis :: pieniędzy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » zapis pieniędzy 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