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

Wysłany: 2020-12-07, 13:10


ReD637







Wiek: 32
Na forum: 2015 dni
Posty: 15
Nick w MP: Boris Popow

Piwa: 1

Respekt: 50

Siemano, pomo?e mi kto? w handlingach? Poka?e jak to napisa?/wgra?/zmodernizowa?? Tak, widzia?em ju? sporo temat?w o handlingach lecz nieogarniam tego.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-07, 13:43


_jvneczek







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

Piwa: 3949

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

Jest tego pe?no, powsta? nie dawno identyczny temat.
https://gtao.pl/wzor-na-handling-vt137564.htm#847382

Przyk?ad z wiki:

function vhandling theVehicle )
    if getElementModel(theVehicle) == 411 then -------------- vehicle Id
        setVehicleHandling(theVehicle"mass"300.0)
        setVehicleHandling(theVehicle"turnMass"200)
        setVehicleHandling(theVehicle"dragCoeff"4.0 )
        setVehicleHandling(theVehicle"centerOfMass", { 0.0,0.08,-0.09 } )
        setVehicleHandling(theVehicle"percentSubmerged"103)
        setVehicleHandling(theVehicle"tractionMultiplier"1.8)
        setVehicleHandling(theVehicle"tractionLoss"1.0)
        setVehicleHandling(theVehicle"tractionBias"0.48)
        setVehicleHandling(theVehicle"numberOfGears"5)
        setVehicleHandling(theVehicle"maxVelocity"300.0)
        setVehicleHandling(theVehicle"engineAcceleration"90.0 )
        setVehicleHandling(theVehicle"engineInertia"5.0)
        setVehicleHandling(theVehicle"driveType""rwd")
        setVehicleHandling(theVehicle"engineType""petrol")
        setVehicleHandling(theVehicle"brakeDeceleration"20.0)
        setVehicleHandling(theVehicle"brakeBias"0.60)
        -----abs----
        setVehicleHandling(theVehicle"steeringLock",  35.0 )
        setVehicleHandling(theVehicle"suspensionForceLevel"0.85)
        setVehicleHandling(theVehicle"suspensionDamping"0.15 )
        setVehicleHandling(theVehicle"suspensionHighSpeedDamping"0.0)
        setVehicleHandling(theVehicle"suspensionUpperLimit"0.15 )
        setVehicleHandling(theVehicle"suspensionLowerLimit", -0.16)
        setVehicleHandling(theVehicle"suspensionFrontRearBias"0.5 )
        setVehicleHandling(theVehicle"suspensionAntiDiveMultiplier"0.0)
        setVehicleHandling(theVehicle"seatOffsetDistance"0.0)
        setVehicleHandling(theVehicle"collisionDamageMultiplier"0.00)
        --setVehicleHandling(theVehicle"monetary",  10000This one is disabled for now
        setVehicleHandling(theVehicle"modelFlags"1002000)
        setVehicleHandling(theVehicle"handlingFlags"1000002)
        --setVehicleHandling(theVehicle"headLight"3This one is disabled for now
        --setVehicleHandling(theVehicle"tailLight"2This one is disabled for now
        --setVehicleHandling(theVehicle"animGroup"4This one is disabled for now
    end
end
addEventHandler "onPlayerVehicleEnter"getRootElement(), vhandling )

Aczkolwiek lepiej b?dzie to zrobi? z zastosowaniem tabeli, podpi?? pod tabele i najwygodniej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-07, 14:18


ReD637







Wiek: 32
Na forum: 2015 dni
Posty: 15
Nick w MP: Boris Popow

Piwa: 1

Respekt: 50

[quote="satan_"]Jest tego pe?no, powsta? nie dawno identyczny temat.
[url]https://gtao.pl/wzor-na-handling-vt137564.htm#847382[/url]

Przyk?ad z wiki:
[lua]
function vhandling ( theVehicle )
if getElementModel(theVehicle) == 411 then -------------- vehicle Id
setVehicleHandling(theVehicle, "mass", 300.0)
setVehicleHandling(theVehicle, "turnMass", 200)
setVehicleHandling(theVehicle, "dragCoeff", 4.0 )
setVehicleHandling(theVehicle, "centerOfMass", { 0.0,0.08,-0.09 } )
setVehicleHandling(theVehicle, "percentSubmerged", 103)
setVehicleHandling(theVehicle, "tractionMultiplier", 1.8)
setVehicleHandling(theVehicle, "tractionLoss", 1.0)
setVehicleHandling(theVehicle, "tractionBias", 0.48)
setVehicleHandling(theVehicle, "numberOfGears", 5)
setVehicleHandling(theVehicle, "maxVelocity", 300.0)
setVehicleHandling(theVehicle, "engineAcceleration", 90.0 )
setVehicleHandling(theVehicle, "engineInertia", 5.0)
setVehicleHandling(theVehicle, "driveType", "rwd")
setVehicleHandling(theVehicle, "engineType", "petrol")
setVehicleHandling(theVehicle, "brakeDeceleration", 20.0)
setVehicleHandling(theVehicle, "brakeBias", 0.60)
-----abs----
setVehicleHandling(theVehicle, "steeringLock", 35.0 )
setVehicleHandling(theVehicle, "suspensionForceLevel", 0.85)
setVehicleHandling(theVehicle, "suspensionDamping", 0.15 )
setVehicleHandling(theVehicle, "suspensionHighSpeedDamping", 0.0)
setVehicleHandling(theVehicle, "suspensionUpperLimit", 0.15 )
setVehicleHandling(theVehicle, "suspensionLowerLimit", -0.16)
setVehicleHandling(theVehicle, "suspensionFrontRearBias", 0.5 )
setVehicleHandling(theVehicle, "suspensionAntiDiveMultiplier", 0.0)
setVehicleHandling(theVehicle, "seatOffsetDistance", 0.0)
setVehicleHandling(theVehicle, "collisionDamageMultiplier", 0.00)
--setVehicleHandling(theVehicle, "monetary", 10000) This one is disabled for now
setVehicleHandling(theVehicle, "modelFlags", 1002000)
setVehicleHandling(theVehicle, "handlingFlags", 1000002)
--setVehicleHandling(theVehicle, "headLight", 3) This one is disabled for now
--setVehicleHandling(theVehicle, "tailLight", 2) This one is disabled for now
--setVehicleHandling(theVehicle, "animGroup", 4) This one is disabled for now
end
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), vhandling )
[/lua]
Aczkolwiek lepiej b?dzie to zrobi? z zastosowaniem tabeli, podpi?? pod tabele i najwygodniej.[/quote]

Chcia? bys mi w tym pom?c? Ewentualnie pokaza? jak to zrobi??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-07, 14:19


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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

Trzymaj:


function handling() 
local max=280 --vmax 
local moc=23 --acceleration 
local promien=35 -- skr?tno??)
local skret=-- przyczepno?? 
for k,v in ipairs (getElementsByType("vehicle")) do 
if getElementModel(v) == 405 then --ID auta
setVehicleHandling(v,"maxVelocity"maxsetVehicleHandling(v,"engineAcceleration",mocsetVehicleHandling(v,"steeringLock",promiensetVehicleHandling(v,"tractionMultiplier",skretend 
end 
end 
addEventHandler("onVehicleEnter",root,handling 


Nie jest to m?j kod.
Ale masz tutaj kr?tszy i jest mniej bawienia si?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-07, 14:31


ReD637







Wiek: 32
Na forum: 2015 dni
Posty: 15
Nick w MP: Boris Popow

Piwa: 1

Respekt: 50

[quote="TheSebaPL"]Trzymaj:

[lua]
function handling()
local max=280 --vmax
local moc=23 --acceleration
local promien=35 -- skr?tno??)
local skret=1 -- przyczepno??
for k,v in ipairs (getElementsByType("vehicle")) do
if getElementModel(v) == 405 then --ID auta
setVehicleHandling(v,"maxVelocity", max)
setVehicleHandling(v,"engineAcceleration",moc)
setVehicleHandling(v,"steeringLock",promien)
setVehicleHandling(v,"tractionMultiplier",skret)
end
end
end
addEventHandler("onVehicleEnter",root,handling ) [/lua]

[b]Nie jest to m?j kod.[/b]
Ale masz tutaj kr?tszy i jest mniej bawienia si?.[/quote]


Dobra, a ten kod tak jak rozumiem to musze stworzyc nowy plik przy podmiance?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-12-07, 14:58


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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

ReD637,

W tej linijce zmieniasz ID pojazdu

if getElementModel(v) == 405 then --ID auta


Tutaj masz spis ID wszystkich pojazd?w:

https://wiki.multitheftauto.com/wiki/PL/Vehicle_IDs

A reszt? ustawiasz sam

Ja polecam modloader ale dla pocz?tkuj?cych jest lepszy w?a?nie taki kod

Tak?e lepiej jest zrobi? skrypt czyli

meta:

<meta>

<script src="handling.lua" type="server" />

</meta>


No i tworzysz plik o nazwie handling format .lua wklejasz kod kt?ry i poda?em i robisz sam dalej.

Postaw piwo autorowi tego posta
 

 
Tagi: handlingi
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Handlingi 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