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

Wysłany: 2019-07-26, 13:01


AsterBonzo

Otwórz ogień






Wiek: 21
Na forum: 3109 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 61

Respekt: 35,8

Witam pr?buje zmieni? hadnling pojazd?w o danym id modelu czyli 402
pr?bowa?em co? takiego:

        if getElementModel(veh) == 402 then
                local acceleration = getVehicleHandling(veh).engineAcceleration
        local velocity = getVehicleHandling(veh).maxVelocity
        setVehicleHandling(veh, "engineAcceleration", nil)
        setVehicleHandling(veh, "maxVelocity", nil)
        setVehicleHandling(veh, "engineAcceleration", acceleration+4.0)
        setVehicleHandling(veh, "maxVelocity", velocity+75)
        end


ale nie dzia?a nie wiem jak to zrobi? :C prosze o jak najszybsz? pomoc. Daje piwo :D :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-26, 13:44


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W jaki spos?b wykonujesz ten warunek?
W evencie? Wklejaj ca?y kod, nie b?dziemy si? domy?la?.
Zmienna pojazdu jest odpowiednio zdefiniowana? Tego te? nie wiemy.
No i czy wyst?puj? jakie? b??dy DB3.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-26, 16:50


AsterBonzo

Otwórz ogień






Wiek: 21
Na forum: 3109 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 61

Respekt: 35,8

local veh = getPedOccupiedVehicle(localPlayer)
mam jeszcze to nic wi?cej

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-26, 17:23


Query

SyndicateMTA






Wiek: 24
Na forum: 3213 dni
Posty: 319
Nick w MP: Query

Piwa: 5238

Respekt: 141
Respekt: 141

dodaj event

addEventHandler('onClientVehicleEnter',root,function()
local veh = getPedOccupiedVehicle(localPlayer)
 if getElementModel(veh) == 402 then
                local acceleration = getVehicleHandling(veh).engineAcceleration
        local velocity = getVehicleHandling(veh).maxVelocity
        setVehicleHandling(veh, "engineAcceleration", nil)
        setVehicleHandling(veh, "maxVelocity", nil)
        setVehicleHandling(veh, "engineAcceleration", acceleration+4.0)
        setVehicleHandling(veh, "maxVelocity", velocity+75)
        end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-26, 21:34


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Masz tutaj poprawiony kod:

addEventHandler("onClientVehicleEnter", getRootElement(), function()
        if getElementModel(source) == 402 then
                local acceleration = getVehicleHandling(source).engineAcceleration
                local velocity = getVehicleHandling(source).maxVelocity
                setVehicleHandling(source, "engineAcceleration", nil)
                setVehicleHandling(source, "maxVelocity", nil)
                setVehicleHandling(source, "engineAcceleration", acceleration+4.0)
                setVehicleHandling(source, "maxVelocity", velocity+75)
        end
end)


Postaw piwo autorowi tego posta
 

 
Tagi: custom :: 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 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