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

Wysłany: 2020-05-16, 07:44


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

Witam, mam pytanie odno?nie handlingu na serwerze mta. Wgra?em na sw?j serwer podmiank? cabbie (peugeot 406 z TAXI) i hedit zmieni?em handling po czym wyeksportowa?em to do pliku handling.cfg. Moje pytanie jest nast?puj?ce w jaki spos?b przypisa? ten handling na sta?e dla tego pojazdu ? B?dzie to 1 zrespione cabbie u?ywane we frakcij TSA przez lidera.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 10:46


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Dla wszystkich pojazd?w od pocz?tku:

Więcej informacji znajdziesz w Wikipedii MTA:

setModelHandling


Dla jednego pojazdu:

Więcej informacji znajdziesz w Wikipedii MTA:

setVehicleHandling


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 11:40


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

@Wilq ale gdzie doda? funkcj? setvehiclehandling? Zapisa? j? w lua ? czy jak . Bo czyta?em o tej funkcji ale nie wiem jak j? przykleic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 11:47


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Funkcje u?ywasz w pliku skryptu o formacie LUA.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 18:18


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

meta client czy serwer powinna by? ?

wrzuci?em jako vmax.lua ale cabbie dalej jedzie max 127 km co zrobi?em ?le ?

Kod:

function vhandling ( )
for _,v in pairs(getElementsByType("vehicle")) do
if getElementModel(v) == 438 then -------------- vehicle Id
setVehicleHandling (v, "mass", 1750)
setVehicleHandling(v, "turnMass", 4351.7)
setVehicleHandling(v, "dragCoeff", 2.9 )
setVehicleHandling(v, "centerOfMass", { 0.0,0.1,-0.15 } )
setVehicleHandling(v, "percentSubmerged", 75)
setVehicleHandling(v, "tractionMultiplier", 0.75)
setVehicleHandling(v, "tractionLoss", 0.85)
setVehicleHandling(v, "tractionBias", 0.51)
setVehicleHandling(v, "numberOfGears", 5)
setVehicleHandling(v, "maxVelocity", 320.0)
setVehicleHandling(v, "engineAcceleration", 35.0 )
setVehicleHandling(v, "engineInertia", 6.0)
setVehicleHandling(v, "driveType", "fwd")
setVehicleHandling(v, "engineType", "petrol")
setVehicleHandling(v, "brakeDeceleration", 7.0)
setVehicleHandling(v, "brakeBias", 0.44)
-----abs----
setVehicleHandling(v, "steeringLock", 40.0 )
setVehicleHandling(v, "suspensionForceLevel", 0.70)
setVehicleHandling(v, "suspensionDamping", 0.06 )
setVehicleHandling(v, "suspensionHighSpeedDamping", 2.0)
setVehicleHandling(v, "suspensionUpperLimit", 0.25 )
setVehicleHandling(v, "suspensionLowerLimit", -0.30)
setVehicleHandling(v, "suspensionFrontRearBias", 0.5 )
setVehicleHandling(v, "suspensionAntiDiveMultiplier", 0.5)
setVehicleHandling(v, "seatOffsetDistance", 0.2)
setVehicleHandling(v, "collisionDamageMultiplier", 0.4)
--setVehicleHandling(v, "monetary", 10000) This one is disabled for now
setVehicleHandling(v, "modelFlags", 0)
setVehicleHandling(v, "handlingFlags", 5C00003)
--setVehicleHandling(v, "headLight", 3) This one is disabled for now
--setVehicleHandling(v, "tailLight", 2) This one is disabled for now
--setVehicleHandling(v, "animGroup", 4) This one is disabled for now
end
end
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), vhandling )






Kod:

<meta>
<script src="vmax.lua" type="server" />
</meta>


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 23:06


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Zapytam ciebie tak samo jak innych - dlaczego bierzesz si? za serwer skoro nie masz poj?cia o tym?

Co do tematu - chcesz na sta?e przypisa? jaki? handling do danego auta tak?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 23:55


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

"Shuffle" napisał/a:

Zapytam ciebie tak samo jak innych - dlaczego bierzesz si? za serwer skoro nie masz poj?cia o tym?

Co do tematu - chcesz na sta?e przypisa? jaki? handling do danego auta tak?



Bior? si? bo chce si? nauczy? to po pierwsze a po drugie tak do tego 1 konkretnego autka chce przypisa? na sta?e, w hedit jak zaczytam leci 285 a nie u?miecha mi si? za ka?dym wej?ciem na serwer w??cza? tego

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 00:12


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Nie musisz, zr?b co? na wz?r tego

addEventHandler("onPlayerVehicleEnter",root,function(veh)
    if getElementModel(veh)==ID_POJAZDU then
        --tu ustawianie handlingu przez setVehicleHandling
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 01:28


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

Kod:

addEventHandler("onPlayerVehicleEnter",root,function(veh)
if getElementModel(veh)==438 then
setVehicleHandling (v, "mass", 1750)
setVehicleHandling(v, "turnMass", 4351.7)
setVehicleHandling(v, "dragCoeff", 2.9 )
setVehicleHandling(v, "centerOfMass", { 0.0,0.1,-0.15 } )
setVehicleHandling(v, "percentSubmerged", 75)
setVehicleHandling(v, "tractionMultiplier", 0.75)
setVehicleHandling(v, "tractionLoss", 0.85)
setVehicleHandling(v, "tractionBias", 0.51)
setVehicleHandling(v, "numberOfGears", 5)
setVehicleHandling(v, "maxVelocity", 320.0)
setVehicleHandling(v, "engineAcceleration", 35.0 )
setVehicleHandling(v, "engineInertia", 6.0)
setVehicleHandling(v, "driveType", "fwd")
setVehicleHandling(v, "engineType", "petrol")
setVehicleHandling(v, "brakeDeceleration", 7.0)
setVehicleHandling(v, "brakeBias", 0.44)
-----abs----
setVehicleHandling(v, "steeringLock", 40.0 )
setVehicleHandling(v, "suspensionForceLevel", 0.70)
setVehicleHandling(v, "suspensionDamping", 0.06 )
setVehicleHandling(v, "suspensionHighSpeedDamping", 2.0)
setVehicleHandling(v, "suspensionUpperLimit", 0.25 )
setVehicleHandling(v, "suspensionLowerLimit", -0.30)
setVehicleHandling(v, "suspensionFrontRearBias", 0.5 )
setVehicleHandling(v, "suspensionAntiDiveMultiplier", 0.5)
setVehicleHandling(v, "seatOffsetDistance", 0.2)
setVehicleHandling(v, "collisionDamageMultiplier", 0.4)
setVehicleHandling(v, "modelFlags", 0)
setVehicleHandling(v, "handlingFlags", 5C00003)
end
end
end)


dalej nie dzia?a, chyba ?e ?le wyedytowa?em kod

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 08:42


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Od teraz pojazd masz pod zmienn? 'veh', dlaczego u?ywasz 'v'?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 17:05


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

"Wilq" napisał/a:

Od teraz pojazd masz pod zmienn? 'veh', dlaczego u?ywasz 'v'?


Fakt nie zwr?ci?em uwagi :)
edit

poprawi?em zmienn? ale nadal nie dzia?a :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 19:05


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

B??dy /debugscript 3? Masz o jednego enda za du?o.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 20:58


kretogamerpl







Wiek: 29
Na forum: 2220 dni
Posty: 11



Respekt: 50

"Wilq" napisał/a:

B??dy /debugscript 3? Masz o jednego enda za du?o.





setVehicleHandling(veh, "handlingFlags", 5C00003) tutaj - error mailformed number near ' 5C00003'

oraz usun??em tego "enda)"

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 23:55


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

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

Nie jest to m?j kod ale wklej to powinno dzia?a?:

Kod:

function NAZWA AUTA()
local max= USTAW --vmax
local moc=USTAW --acceleration
local promien=USTAW -- skr?tno??)
local skret=1.5 -- przyczepno?? dobrze jest taka
for k,v in ipairs (getElementsByType("vehicle")) do
if getElementModel(v) == ID AUTA then
setVehicleHandling(v,"maxVelocity", max)
setVehicleHandling(v,"engineAcceleration",moc)
setVehicleHandling(v,"steeringLock",promien)
setVehicleHandling(v,"tractionMultiplier",skret)
end
end
end
addEventHandler("onVehicleEnter",root,NAZWA AUTA )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-18, 08:12


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

To usu? linijk??z "handlingFlags" skoro nawet nie znasz jej dzia?ania.

Postaw piwo autorowi tego posta
 

 
Tagi: handling
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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