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

Wysłany: 2014-06-14, 11:27


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
Witam mam taki kodzik - Element tworzy si? na aucie lecz auto tak jakby si? freezuje co jeszcze musze doda? aby auto mog?o jecha? z tym elementem ?

Kod:

local vehicle = getPedOccupiedVehicle(getLocalPlayer())
local x, y, z = getElementPosition ( vehicle )
local theObject = createObject ( 1454, x + 2, y + 2, z, 0, 0, 0, true )
attachElements ( vehicle, theObject, 0, 0, 0 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 11:55


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

RezoT, attachElementToElement.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 12:20


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
Nadal nie dzia?a, auto tak jak by si? freezuje i nie jedzie

Podpis
:) :)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 12:43


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

RezoT, ko?a si? kr?c? ?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 13:07


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

RezoT, obiekt tworzy si? nad pojazdem czy w nim ?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 14:27


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
Ok zrobi??m xddd Da??m poprostu na 1 vehicle a potem obiekt a powinno by? odwrtotnie ;D

[ Dodano: 2014-06-14, 14:56 ]
ale teraz m?g?by? zrobi? mi to po stronie serva ? aby obiekt tworzy? si? po stronie serva aby ka?dy go widzia? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 16:22


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
function cos()
local vehicle = getPedOccupiedVehicle(getLocalPlayer())
local x, y, z = getElementPosition ( vehicle )
local theObject = createObject ( 1454, x + 2, y + 2, z, 0, 0, 0, true )
attachElementToElement ( theObject, vehicle, 0, 0, 0 )
end
addEventHandler("onClientMakrerHit", cos123, cos)

[ Dodano: 2014-06-14, 20:23 ]
e a jak teraz ten obiekt usunac ?? probowalem takigo kodu:

local vehicle = getPedOccupiedVehicle(getLocalPlayer())
detachElements ( theObject1, vehicle )
detachElements ( theObject, vehicle )
destroyElement ( theObject1 )
destroyElement ( theObject )

ale to juz jest na inny marker zrobione

Podpis
:) :)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 20:56


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

RezoT, nie musisz dawa? detach, starczy samo destroy.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 20:56


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
ale i tak nie dzia?a

Podpis
:) :)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 20:57


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

sprawd? db3.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 21:02


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
bad Argument z destroyElement...

Podpis
:) :)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 21:04


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

destroyElement theObject1 


wywal to. Nie widz? zdefiniowanej zmiennej theObject1

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 21:06


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
to mam w nowym kodzie nowy obiekt theObject1

Podpis
:) :)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-14, 21:16


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

no wi?c poka? mi go.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-15, 10:39


RezoT







Wiek: 30
Na forum: 4416 dni
Posty: 126
Nick w MP: RezoT

Piwa: 306

Respekt: 51

Ostrzeżeń: 40%
Kod:

function niejadek ()
if isElementWithinMarker(getLocalPlayer(), praca3) then
if getElementData (getLocalPlayer(), "praca3") == true then
if isPedInVehicle (getLocalPlayer()) then
local v=getPedOccupiedVehicle(getLocalPlayer())
local m=getElementModel(v)
if (m==578) then
outputChatBox ( "Zaladowales Towar", getLocalPlayer(), 0, 0, 205 )
setElementData(getLocalPlayer(), "dostawa", true )
local x, y, z = getElementPosition ( v )
local theObject = createObject ( 3374, x + 2, y + 2, z + 2.5, 0, 0, 0, true )
local theObject1 = createObject ( 3374, x + 2, y + 2, z + 2.5, 0, 0, 0, true )
attachElementToElement( theObject, v, 0, -3, 1.3 )
attachElementToElement( theObject1, v, 0, 0.2, 1.3 )
else
outputChatBox ( " ", getLocalPlayer(), 0, 0, 205 )
end
end
end
end
end
addCommandHandler("zaladuj", niejadek)

addEventHandler("onClientMarkerHit", dostawa,
function(player)
if ( player == localPlayer ) then
if getElementData (getLocalPlayer(), "dostawa") == true then
if isPedInVehicle (getLocalPlayer()) then
local v=getPedOccupiedVehicle(getLocalPlayer())
local m=getElementModel(v)
if (m==578) then
detachElements ( theObject1, v )
detachElements ( theObject, v )
destroyElement ( theObject1 )
destroyElement ( theObject )
outputChatBox ( "Skonczyles prace", getLocalPlayer(), 0, 0, 205 )
end
end
end
end
end
)


Postaw piwo autorowi tego posta
 

 
Tagi: attachelement
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