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

Wysłany: 2019-11-22, 01:06


Frixen







Wiek: 28
Na forum: 2851 dni
Posty: 61
Nick w MP: Frixenek

Piwa: 1040

Respekt: 30,5

Nie dzia?a handling aut mam wszystko ustawione i nie dzia?a kto pomo?e piwko/respekt daje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-22, 10:40


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wrzu? kod i b??dy db3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-23, 09:45


Frixen







Wiek: 28
Na forum: 2851 dni
Posty: 61
Nick w MP: Frixenek

Piwa: 1040

Respekt: 30,5

--[[addEventHandler("onVehicleEnter", resourceRoot, function(plr,seat,jacked)
veh = getPedOccupiedVehicle(plr)
if getVehicleName(veh) == "579" then
local fast = getVehicleHandlingProperty(veh,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(veh,"maxVelocity")
local masa = getVehicleHandlingProperty(veh,"mass")
local masa2 = getVehicleHandlingProperty(veh,"turnMass")
local xd = getVehicleHandlingProperty(veh,"tractionMultiplier")
local coef = getVehicleHandlingProperty(veh,"dragCoeff")
setVehicleHandling(veh,"engineAcceleration",fast+1300)
setVehicleHandling(veh, "maxVelocity",maxfast+10300)
end
end)]]--

[ Dodano: 2019-11-23, 09:45 ]
a sk?d wzi??? ten b??d db3

[ Dodano: 2019-11-23, 10:02 ]
nie ma zadnego b??du

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-23, 10:39


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Kod nie b?dzie dzia?a? bo jest zakomentowany (https://docs.coronalabs.com/guide/start/introLua/index.html).

BTW. Nie musisz tam pobiera? oddzielnie pojazdu, w kt?rym siedzi kierowca, poniewa? ten pojazd jest domy?lnie definiowany jako ?r?d?o eventu - 'source'. I w?asnie 'source' mo?esz u?y? zamiast 'veh'.

No i kod nie b?dzie dzia?a? dlatego, ?e pobierasz nazw? pojazdu i por?wnujesz j? z modelem pojazdu.
Zamiast

Więcej informacji znajdziesz w Wikipedii MTA:

getVehicleName

u?yj

Więcej informacji znajdziesz w Wikipedii MTA:

getElementModel

i usu? te cudzys?owia (getElementModel zwraca liczb?, nie tekst).

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-25, 00:03


Frixen







Wiek: 28
Na forum: 2851 dni
Posty: 61
Nick w MP: Frixenek

Piwa: 1040

Respekt: 30,5

Nie dzia?a o tak nie ma ?adnego erroru auto nie je?dzi np ustawi?em +100 I rozpedzanie 500 o tak nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-25, 00:43


USUNIETY
[Usunięty]









[lua]function getVehicleHandlingProperty(element, property)
if isElement(element) and getElementType(element) == "vehicle" and type(property) == "string" then -- Make sure there's a valid vehicle and a property string
local handlingTable = getVehicleHandling(element) -- Get the handling as table and save as handlingTable
local value = handlingTable[property] -- Get the value from the table
if value then -- If there's a value (valid property)
return value -- Return it
end
end
return false -- Not an element, not a vehicle or no valid property string. Return failure
end

addEventHandler("onVehicleEnter", getRootElement(), function(plr,seat,jacked)
if getElementModel(source) == 549 then
local fast = getVehicleHandlingProperty(source,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(source,"maxVelocity")
local masa = getVehicleHandlingProperty(source,"mass")
local masa2 = getVehicleHandlingProperty(source,"turnMass")
local xd = getVehicleHandlingProperty(source,"tractionMultiplier")
local coef = getVehicleHandlingProperty(source,"dragCoeff")
setVehicleHandling(source,"engineAcceleration",fast+1300)
setVehicleHandling(source, "maxVelocity",maxfast+10300)
end
end)[/lua]

 

 
Tagi: handlingi :: nie :: dziala
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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