Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: attachelement
1. attachElement
Czesc, jak zrobic zeby przedmiot by? x+2 od pojazdu a nie od gracza ?


function attach(source,commandName)
        
local x,y,z = getElementPosition(source)
        
local r1,r2,r3 = getElementRotation(source)
      
local pojazd = createVehicle(411 ,x+2, y, z, r1, r2, r3) 
      
local przedmiot = createObject(1222,x+2, y, z)
      
attachElements (pojazd, przedmiot)
end
addCommandHandler 
("test", attach)
2. attachElement
B??d w db3:
WARNING: p_policjaGUIscript.lua:6: Bad arguments @ 'attachElements' [Expected element at argument 2, got string 'Cholewka']

Kod:

wszyscyMarker 
= createMarker(-2098.64258, 55.98772, 35.32031, "cylinder", 1, 0, 0, 255)

addEventHandler("onResourceStart", getRootElement( ), function()
for 
k,v in ipairs ( getElementsByType ( "player" )) do
    
attachElements(wszyscyMarker, getPlayerName( v ), 0, 0, 0 )
end
end
)
3. AttachElement
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 )