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

Wysłany: 2015-12-23, 12:29


GamerHD11







Wiek: 24
Na forum: 4401 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Witam mam taki problem jak wjad? w marker5 to nie znika mi poci?g ale robi si? dalsza cz??? skryptu, lecz mojemu koledze i innym kt?rzy pracuj? i jad? za mn? auto znika (Lecz oni nie wje?d?aj? jeszcze w marker). Tak samo jest w przypadku marker6.

Oto Kod:

Client:

function przeladuj2(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if auto then
destroyElement(marker5)
destroyElement(blip3)
triggerServerEvent("zaladunekPaliwa", localPlayer, localPlayer)
outputChatBox("Jed? na stacj? paliw, aby dostarczy? paliwo do dystrybutora.", 255, 255, 255)
marker6 = createMarker(23.25203, 1175.06689, 18.40798, "cylinder", 3, 0 ,255, 0, 200)
addEventHandler("onClientMarkerHit", marker6, addFuel)
blip4 = createBlip(23.25203, 1175.06689, 19.40798, 41)
end
end
end

function addFuel(hitElement)
auto = getPedOccupiedVehicle(localPlayer)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if auto then
tekst3 = guiCreateLabel(905, 580, 340, 138, "Roz?adowywanie Paliwa na stacj?. Prosz? czeka? 15 sekund.", false)
guiSetFont(tekst3, "default-bold-small")
guiLabelSetColor(tekst3, 0, 255, 0)
setElementFrozen(auto, true)
setTimer(function()
rnd = math.random(45, 65)
setElementFrozen(auto, false)
givePlayerMoney(rnd)
destroyElement(marker6)
destroyElement(blip4)
destroyElement(tekst3)
outputChatBox("Po zako?czonym kursie otrzyma?e? "..rnd.." $ oraz doda?e? do dystrybutora "..ropa.." L.", 255, 255, 255)
triggerServerEvent("endDestroy", localPlayer, localPlayer)
setElementData(localPlayer, "iloscropy", 0)
setElementData(localPlayer, "pracador", "Brak")
end, 15000, 1)
end
end
end


Server:

addEvent("zaladunekPaliwa", true)
addEventHandler("zaladunekPaliwa", getRootElement(), function(thePlayer)
destroyElement(pociag)
auto1 = createVehicle(573, 580.13721, 1218.68896, 11.71127)
setElementData(auto1, "fuel", 60)
setElementData(auto1, "przebieg", 0)
warpPedIntoVehicle(thePlayer, auto1)
end)

addEvent("endDestroy", true)
addEventHandler("endDestroy", getRootElement(), function(thePlayer)
destroyElement(auto1)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-30, 10:28


Kradus







Wiek: 28
Na forum: 4310 dni
Posty: 100
Nick w MP: Salldan

Piwa: 78

Respekt: 50

Nie wiem czy przypadkiem tutaj nie ma emm stworzenia poci?gu?
auto1 = createVehicle(573, 580.13721, 1218.68896, 11.71127)

destroyElement(auto1)


Auto jest ale w skrypcie nie widz? niczego co by by?o podpisane "pociag" a jest niszczone. Czyli masz
destroyElement(pociag)
ale gdzie on jest w skrypcie? Bo ja go nie widz? nigdzie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-30, 12:08


DamianGames







Wiek: 23
Na forum: 4087 dni
Posty: 75

Piwa: 524

Respekt: 31,5

Ostrzeżeń: 60%

Server side



addEvent("zaladunekPaliwa", true)
addEventHandler("zaladunekPaliwa", getRootElement(), function(thePlayer)
destroyElement(pociag)
pociag = createVehicle(573, 580.13721, 1218.68896, 11.71127)
setElementData(pociag, "fuel", 60)
setElementData(pociag, "przebieg", 0)
warpPedIntoVehicle(thePlayer, pociag)
end)

addEvent("endDestroy", true)
addEventHandler("endDestroy", getRootElement(), function(thePlayer)
destroyElement(auto1)
end)



Client side



function przeladuj2(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if auto then
destroyElement(marker5)
destroyElement(blip3)
triggerServerEvent("zaladunekPaliwa", localPlayer, localPlayer)
outputChatBox("Jed? na stacj? paliw, aby dostarczy? paliwo do dystrybutora.", 255, 255, 255)
marker6 = createMarker(23.25203, 1175.06689, 18.40798, "cylinder", 3, 0 ,255, 0, 200)
addEventHandler("onClientMarkerHit", marker6, addFuel)
blip4 = createBlip(23.25203, 1175.06689, 19.40798, 41)
end
end
end

function addFuel(hitElement)
auto = getPedOccupiedVehicle(localPlayer)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if pociag then
tekst3 = guiCreateLabel(905, 580, 340, 138, "Roz?adowywanie Paliwa na stacj?. Prosz? czeka? 15 sekund.", false)
guiSetFont(tekst3, "default-bold-small")
guiLabelSetColor(tekst3, 0, 255, 0)
setElementFrozen(pociag, true)
setTimer(function()
rnd = math.random(45, 65)
setElementFrozen(pociag, false)
givePlayerMoney(rnd)
destroyElement(marker6)
destroyElement(blip4)
destroyElement(tekst3)
outputChatBox("Po zako?czonym kursie otrzyma?e? "..rnd.." $ oraz doda?e? do dystrybutora "..ropa.." L.", 255, 255, 255)
triggerServerEvent("endDestroy", localPlayer, localPlayer)
setElementData(localPlayer, "iloscropy", 0)
setElementData(localPlayer, "pracador", "Brak")
end, 15000, 1)
end
end
end


POWINNO DZIA?A?



Postaw piwo autorowi tego posta
 

 
Tagi: bug :: destroyelement
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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