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

Wysłany: 2016-12-11, 14:09


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Mam problem z pracami ot?? jak zarabiam to dostaje pieni?dze ale jak wyjde z serwera to si? nie zapisuje pomo?e kto?? Wgrywa?em r??ne systemy save ale nie dzia?aj?. Dodam ?e prace s? z GM It's Your World
Kod:
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
local kasa = math.random(64,74)
showMarker()
playSoundFrontEnd(12)
triggerServerEvent("givePlayerMoney", localPlayer, kasa)
givePlayerMoney (50)
outputChatBox("Otrzymujesz "..kasa.." PLN za zidentyfikowanie punktu.")
end
end

Postaw piwo autorowi tego posta
 

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


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

to jest client side, podaj server

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-11, 17:00


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

addEventHandler("onMarkerHit", m1, function(el, md)
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end

if getElementData(el,"player:job") then return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
local x,y,z = getElementPosition(el)
local autbus = createVehicle(431,1181.83, -1800.05, 12.92+4)
setElementFrozen(el,true)
local linia = math.random(1,#linie)
setElementData(autbus, "vehicle:linia",linie[linia])
setElementData(autbus, "vehicle_job_owner", el)
setElementData(autbus, "vehicle:fuel", 100000)
setElementData(autbus, "vehicle:mileage", math.random(50000,80000))
setVehicleHandling(autbus, "maxVelocity", 80.0)
setElementData(el,"player:job",code)
setTimer(warpPedIntoVehicle,2000,1,el, autbus)
setTimer(setElementFrozen,2000,1,el, false)
triggerClientEvent(el, "STARTJobBus", resourceRoot, autbus,linie[linia])

vehs[el] = autbus
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)

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

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-11, 20:17


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

A sprawdza?e? czy w bankomacie nie masz bo ich prace by?y ?e dodawa?y kas? do banku w sensie nie kt?re :>

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-11, 20:18


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

W?a?nie do bankomatu nie idzie wi?c chcia?em zmieni? ?eby odrazu dawa?o ale chcia?bym zrobi? ?eby odrazu dawa?o bo tak lepiej :P

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 11:54


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

Dlatego ze givePlayerMoney nie dziala po stronie client, musisz trigerowac pieniadze do server side

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 12:15


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Loop, a jako? tak ?atwiej to wyt?umaczy? bo dopiero zaczynam w LUA i jeszcze nie wszysko ogarniam :/

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 15:25


Loop

Inspektor






Wiek: 27
Na forum: 4289 dni
Posty: 311
Nick w MP: Inspektor

Piwa: 201

Respekt: 130
Respekt: 130

addEvent("givePlayerMoney"true)
addEventHandler("givePlayerMoney",root, function(ile)
givePlayerMoney(source, (ile))
end)


Do strony servera dodaj.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-13, 16:44


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Do zamkni?cia
PS. Leci piwko + respekt :D

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Tagi: prace :: its :: your :: world
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