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

Wysłany: 2022-02-13, 15:40


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 4128 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 244

Respekt: 60


addCommandHandler("auto", function(plr, cmd, id)
if getElementData(plr, "user:duty") >2 then
if not id then 
outputChatBox("U?yj /auto id", plr, 255, 255, 255, true)

 return end
local dim = getElementDimension(plr)
local x,y,z = getElementPosition(plr)
local r1,r2,r3 = getElementRotation(plr)
local x, y, z = getElementPosition(plr)
 if getPedOccupiedVehicle(plr) then
outputChatBox("Nie mo?esz podmienia? aut",plr)
else
local veh = createVehicle(id, x, y, z, r1, r2, r3)
setElementDimension(veh, dim)
setElementPosition(plr,x, y, z+1.5)
setVehiclePlateText(veh, "RESPIONY") 
setElementData(veh, "veh:bak",100) 
setElementData(veh, "veh:pojemno??","2") 
setElementData(veh, "veh:mk1") 
setVehicleOverrideLights(veh, 2)
addVehicleUpgrade(veh, 1080)
setVehicleColor(veh, 255,255,255)
if seat ~= 0 then return end
destroyElement(source)
addEventHandler("onVehicleExit", veh, function(plr,seat)
end)
end
end
end)

kto? wyt?umaczy mi dlaczego po wyjsciu nie usuwa sie? czy mo?e czego? nie widze?

[ Dodano: 2022-02-13, 16:05 ]
@lock

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-02-22, 09:08


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3



addCommandHandler("auto", function(plr, cmd, id)


if getElementData(plr, "user:duty") >2 then


if not id then 


outputChatBox("U?yj /auto id", plr, 255, 255, 255, true)





 return end


local dim = getElementDimension(plr)


local x,y,z = getElementPosition(plr)


local r1,r2,r3 = getElementRotation(plr)


local x, y, z = getElementPosition(plr)


 if getPedOccupiedVehicle(plr) then


outputChatBox("Nie mo?esz podmienia? aut",plr)


else


local veh = createVehicle(id, x, y, z, r1, r2, r3)


setElementDimension(veh, dim)


setElementPosition(plr,x, y, z+1.5)


setVehiclePlateText(veh, "RESPIONY") 


setElementData(veh, "veh:bak",100) 


setElementData(veh, "veh:pojemno??","2") 


setElementData(veh, "veh:mk1") 


setVehicleOverrideLights(veh, 2)


addVehicleUpgrade(veh, 1080)


setVehicleColor(veh, 255,255,255)





addEventHandler("onVehicleExit", veh, function(plr,seat)
    if seat ~= 0 then return end


    destroyElement(source)

end)


end


end


end)

Spr?buj tak, nie dzia?a?o ci to poniewa? samo usuwanie pojazdu czyli destroyElement wstawia?e? nad funkcj? wysiadania.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-02-22, 17:07


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

[clo]

Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: pojazdu
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