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

Wysłany: 2021-04-28, 12:08


Nieznany2105







Wiek: 42
Na forum: 1864 dni
Posty: 2



Respekt: 50

Witam, ma kto? skrypta czy kod na zmiane handlingu w aucie? Nie chodzi mi o Handling edior pod b tylko ?e jak gracz kupi sobie auto to ?eby ju? ten handling dzia?a?. I ?ebym m?g? go sobie w kodzie zmienia?. Wiem ?e jest funkcja ale nie wiem jak jej dobrze u?y? bo mi nie dzia?a?a. Z g?ry Dzi?kuje, za pomoc dam Zimne :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-28, 12:38


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3101

Respekt: 640,5
Respekt: 640,5Respekt: 640,5


Więcej informacji znajdziesz w Wikipedii MTA:

setModelHandling


lub


Więcej informacji znajdziesz w Wikipedii MTA:

setVehicleHandling


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-28, 12:45


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
w kodzie gdzie respia sie pojazdy dodaj setVehicleHandling domyslnie w ogrpg to ogrpg-vehicles

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-28, 12:50


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

TheSebaPL, napisa?, ?e zna funkcj? ale mu nie dzia?a wi?c :


podaje PRZYK?AD, nie gotowiec :

Kod:

addCommandHandler("zmiana",function(plr)
local veh=getPedOccupiedVehicle(plr)
local hand=getVehicleHandling(veh)
setVehicleHandling(veh,"mass",hand["mass"]+100)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-28, 14:10


Nieznany2105







Wiek: 42
Na forum: 1864 dni
Posty: 2



Respekt: 50

I mam to tak o poprostu dopisac funkcje setVehicleHandling i b?dzie dzia?a?o? I czy musze na ka?de auto tak skopiowac? tu mam kod ja to ?eby sie pojazd zrespi?, jak to nie to todajcie znac to ca?y kod wy?le.
Kod:

addEventHandler("onColShapeHit", mdestroy, function(el,md)
if getElementType(el) == "player" then
local veh=getPedOccupiedVehicle(el)
if not veh then return end
if getVehicleController(veh) ~= el then return end
local id=getElementData(veh,"vehicle:id")
if not id then return end
if isTimer(timeroddania) then return end
setElementFrozen(veh,true)
outputChatBox("* Trwa zapisywanie pojazdu...", el)
toggleControl(el,"enter_exit",false)
timeroddania=setTimer(function()
setElementFrozen(veh,false)
local id=getElementData(veh,"vehicle:id")
if not id then return end
exports["pystories-vehicles"]:onSaveVehicle(veh)
destroyElement(veh)
exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1 WHERE id=?", id)
toggleControl(el,"enter_exit",true)
outputChatBox("* Pomy?lnie zapisano pojazd.", el)
end, 3000, 1)
elseif getElementType(el) == "vehicle" then
local peds= getVehicleOccupants(el)
if #peds > 0 then return end
local id=getElementData(el,"vehicle:id")
if not id then return end
if isTimer(timeroddania) then return end
timeroddania=setTimer(function()
setElementFrozen(el,false)
local id=getElementData(el,"vehicle:id")
if not id then return end
exports["pystories-vehicles"]:onSaveVehicle(el)
destroyElement(el)
exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET parking=1 WHERE id=?", id)
outputChatBox("* Pomy?lnie zapisano pojazd.", el, 255, 255 ,255 ,true)
end, 3000, 1)
setElementFrozen(el,true)
setVehicleLocked(el,true)
end
end)

addEvent("onParkingVehicleSpawn", true)
addEventHandler("onParkingVehicleSpawn", root, function(id)
if not id then return end
local spawn=exports["pystories-vehicles"]:onRespawnVehicles(_,id,{-1959.97, 617.08, 35.37, 1.1, 0.0, 179.1})
if spawn then
--addEventHandler("onClientRender",root,render1)
outputChatBox("* Pomy?lnie wyci?gni?to pojazd z przechowalni.",el)
end
end)


[ Dodano: 2021-04-28, 14:10 ]
m?g?by kto? dla przyk?adu dopisa??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-28, 15:02


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Prawdopodobnie twoim elementem pojazdu jest "spawn", podepnij kod kt?ry ci dalem i masz, my tu pomagamy - musisz si? sam wysili?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-09-03, 14:36


_jvneczek







Wiek: 22
Na forum: 4326 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

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

Czy problem zosta? rozwi?zany?

Postaw piwo autorowi tego posta
 

 
Tagi: handling :: jak :: ustawic
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