Wysłany: 2014-06-14, 11:27
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
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 )
Wysłany: 2014-06-14, 11:55
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
RezoT , attachElementToElement.
Wysłany: 2014-06-14, 12:20
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
Nadal nie dzia?a, auto tak jak by si? freezuje i nie jedzie
Wysłany: 2014-06-14, 12:43
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wysłany: 2014-06-14, 13:07
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
RezoT , obiekt tworzy si? nad pojazdem czy w nim ?
Wysłany: 2014-06-14, 14:27
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
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? ?
Wysłany: 2014-06-14, 16:22
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
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
Wysłany: 2014-06-14, 20:56
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
RezoT , nie musisz dawa? detach, starczy samo destroy.
Wysłany: 2014-06-14, 20:56
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
Wysłany: 2014-06-14, 20:57
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wysłany: 2014-06-14, 21:02
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
bad Argument z destroyElement...
Wysłany: 2014-06-14, 21:04
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
destroyElement ( theObject1 )
wywal to. Nie widz? zdefiniowanej zmiennej theObject1
Wysłany: 2014-06-14, 21:06
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
to mam w nowym kodzie nowy obiekt theObject1
Wysłany: 2014-06-14, 21:16
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wysłany: 2014-06-15, 10:39
RezoT
Wiek: 30 Na forum: 4416 dni Posty: 126
Nick w MP: RezoT
Piwa : 306
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
)
Tagi: attachelement
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: