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

Wysłany: 2016-02-04, 17:53


DaxRel69







Wiek: 30
Na forum: 4107 dni
Posty: 171
Nick w MP: DaxRel

Piwa: 4368

Respekt: 71,5

Ostrzeżeń: 60%
Witam mam problem stworzy?em prace i nie daje mi hajsu.

tu po stronie Servera
Kod:

local m1 = createMarker(-2021.1474609375, -96.630859375, 35.1640625, "cylinder", 4.0, 255, 0, 0)
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(400, x,y,z,-1996.697265625, -95.982421875, 35.614765167236)

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

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)


a Tu Clienta
Kod:

local districtsBus = {
{
-2004.89453125, -69.4912109375, 34.776847839355},
{-2004.509765625, 87.2861328125, 27.210205078125},
{-2005.1318359375, 191.1005859375, 27.206296920776},
{-2001.4443359375, 318.09765625, 34.682788848877},
{-1999.939453125, 471.01953125, 34.68286895752},
{-2071.75390625, 506.8623046875, 34.620975494385},
{-2122.7568359375, 506.5380859375, 34.620933532715},
{-2146.4794921875, 482.470703125, 34.62084197998},
{-2149.2724609375, 363.02734375, 34.839111328125},
{-2203.06640625, 323.5322265625, 34.777160644531},
{-2254.57421875, 309.3173828125, 34.787921905518},
{-2254.390625, 229.06640625, 34.831298828125},
{-2253.78125, 111.734375, 34.776958465576},
{-2258.03125, -4.8271484375, 34.777114868164},
{-2272.09375, -68.2578125, 34.769542694092},
{-2361.173828125, -68.0390625, 34.778797149658},
{-2372.80859375, -106.875, 34.839111328125},
{-2329.201171875, -193.990234375, 34.775260925293},
{-2275.1806640625, -192.98828125, 34.777370452881},
{-2168.8583984375, -175.677734375, 34.77855682373},
{-2165.5380859375, -78.6474609375, 34.775604248047},
{-2095.546875, -70.970703125, 34.838829040527},

}

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? kosiarek!")
else
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, 10, 0)
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? kosiarek!")
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)

Za Pomoc Daje Piwko i Repke.

Jak mo?ecie Dajcie mi gotowca.
Dzi?kuje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-04, 18:01


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Dodaj to na s-side


addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney"getRootElement(),function(money)
givePlayerMoney(sourcetonumber(money))
end)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-04, 19:22


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Strona server'a

addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney"getRootElement(),function(kwota)
givePlayerMoney(sourcetonumber(kwota))
end)

local m1 createMarker(-2021.1474609375, -96.63085937535.1640625"cylinder"4.025500)
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(elmd)
if getElementData(el"zrespilGracz"then
outputChatBox("praca w trakcie poprawek"el)
return
end

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

local x,y,getElementPosition(el)
local bus createVehicle(400x,y,z,-1996.697265625, -95.98242187535.614765167236)

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

warpPedIntoVehicle(elbus)
removePreviousVehicles(el)
triggerClientEvent(el"STARTJobBus"resourceRootbus)

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[sourcethen
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)



Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 18:22


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Tu nic nie zmieniasz ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 18:41


DaxRel69







Wiek: 30
Na forum: 4107 dni
Posty: 171
Nick w MP: DaxRel

Piwa: 4368

Respekt: 71,5

Ostrzeżeń: 60%
Ale mi nie daje Kasy

[ Dodano: 2016-02-05, 18:44 ]
Naprawi?em b??d
Z pomoc? wasz? dzi?kuje wam serdecznie :) da?em ju? piwko i repke

Do zamkni?cia!!!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-05, 18:44


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Na stronie serwera robisz :

addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney"root, function(amount)
 if tonumber(amount) >= 0 then
   givePlayerMoney(sourceamount)
 end
end)


na stronie klienta uzywasz :

triggerServerEvent("givePlayerMoney", localPlayer, integer)

tego triggera uzywasz tam gdzie ma dac kase.

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: wypłaca
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