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

Wysłany: 2019-11-14, 21:38


KucharSolo







Wiek: 35
Na forum: 3439 dni
Posty: 94
Nick w MP: Kuchar

Piwa: 2

Respekt: 31

siema,mam paczke PSSM,i mam problem z interakcja pojazd?w.Mianowicie chodzi o odpalanie silnika,gdy wsi?d? do pojazdu silnik od razu sam si? w??cza,gdy wy??cz? poprzez interakcje i wyjd? z pojazdu to jest wy??czony ale gdy wchodz? automatycznie si? odpala.Jak zrobic aby po wejsciu do auta silnik sie nie w??cza? sam automatycznie tylko poprzez interakcje?dzieki za pomoc piwo i respekt leci.
addEvent("onInterakcjeWybierzAkcje"true)
addEventHandler("onInterakcjeWybierzAkcje"getRootElement(),
function(idvehicle)
local veh getPedOccupiedVehicle(source)
local recznySalon getElementData(veh,"veh:salon")
local recznyPraca getElementData(veh,"vehicle.praca")
    if veh then
        if getVehicleController(veh) == source then
            if id == 1 then
            triggerClientEvent source"startsilnika"source )
            setTimer(function()
            setVehicleEngineState(vehtrue)
            end,1000,1)
            elseif id == 2 then
            setVehicleEngineState(vehfalse)
            elseif id == 3 then
            setVehicleOverrideLights(veh2)
            elseif id == 4 then
            setVehicleOverrideLights(veh1)
            elseif id == 5 then
            setVehicleLocked(veh,false)
            elseif id == 6 then
            setVehicleLocked(veh,true)
            elseif id == 9 then
            setVehicleDoorOpenRatio(veh,0,1,2000)
            elseif id == 10 then
            setVehicleDoorOpenRatio(veh,0,0,2000)
            elseif id == 11 then
            setVehicleDoorOpenRatio(veh,1,1,2000)
            elseif id == 12 then
            setVehicleDoorOpenRatio(veh,1,0,2000)
            elseif id == 13 then
            setElementData(veh,"pasyzapiete",false)            
            elseif id == 14 then
            setElementData(veh,"pasyzapiete",true)
            elseif id == 15 then 
            setElementData(veh"vehicle:LPGWloczone"false)
            setElementData(veh"vehicle:BezynaWloczone"true)
            elseif id == 16 then
            setElementData(veh"vehicle:LPGWloczone"true)
            setElementData(veh"vehicle:BezynaWloczone"false)            
               elseif id == 7 then
            if recznySalon then 
                     exports.rpg_noti:createNotification(source"x""Interakcja nie dzia?a na pojazd z salonu!")
         return 
end
            if recznyPraca then 
                     outputChatBox("* Nie mo?esz spusci? r?cznego!",source,255,0,0) 
         return 
end
            setElementFrozen(vehfalse)
            elseif id == 8 then
local sx,sy,sz getElementVelocity(veh)
local kmhs math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
if kmhs 20 then
if getElementModel(source) == 574 then return end
            setElementFrozen(vehtrue)
            end
        end
    else
        if vehicle then
            if isElement(vehiclethen
                if isVehicleLocked(vehiclethen
                setVehicleLocked(vehiclefalse)
                else
                setVehicleLocked(vehiclefalse)
                end
            end
        end
    end
end
end)



addEventHandler "onPlayerVehicleExit"getRootElement(), function(theVehicleleftSeatjackerPlayer)
    if leftSeat == and not jackerPlayer then
      setVehicleLocked(theVehiclefalse)
      setElementData(theVehicle,"pasyzapiete",false)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-14, 23:29


NotPaladyn







Wiek: 23
Na forum: 2790 dni
Posty: 866
Nick w MP: NotPaladyn

Piwa: 3135

Respekt: 690
Respekt: 690Respekt: 690


   Vice Admin: Jeśli potrzebujesz pomocy w sprawach organizacyjnych lub technicznych - skontaktuj się ze mną.
Je?li ten kod jest po stronie servera to zamie? to:

addEventHandler "onPlayerVehicleExit"getRootElement(), function(theVehicleleftSeatjackerPlayer)
    if leftSeat == and not jackerPlayer then
      setVehicleLocked(theVehiclefalse)
      setElementData(theVehicle,"pasyzapiete",false)
    end
end)


Na:

addEventHandler "onPlayerVehicleExit"getRootElement(), function(theVehicleleftSeatjackerPlayer)
    if leftSeat == and not jackerPlayer then
      setVehicleLocked(theVehiclefalse)
      setVehicleEngineState(theVehiclefalse )
      setElementData(theVehicle,"pasyzapiete",false)
    end
end


Podpis

Zarejestrowany - 14.10.2018r.
Support-Team - 01.06.2019r. - 01.11.2019r.
Test-Mod - 01.11.2019r. - 31.12.2019r.
Moderator - 31.12.2019r. - 01.11.2020r.
Mod-Team - 01.11.2020r. - 03.05.2022r.
Vice Admin - 03.05.2022r. -



-------------------------------------------------------


Tworzę skrypty i modele na zamówienie
W razie pytań zapraszam do kontaktu

--------------Kontakt--------------
Discord: NotPaladyn#2943 / notpaladyn
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-15, 15:22


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

NotPaladyn, co je?li gracz uruchomi silnik i zostawi go w??czony? No chyba, ?e silnik automatycznie r?wnie? ga?nie kiedy kierowca wysi?dzie.

Mo?esz r?wnie? u?y? opcji 'Szukaj w plikach' funkcji 'setVehicleEngineState' i analizowa? wyniki.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
NotPaladyn
Wysłany: 2019-11-15, 15:45


KucharSolo







Wiek: 35
Na forum: 3439 dni
Posty: 94
Nick w MP: Kuchar

Piwa: 2

Respekt: 31

zmienilem i nic.Dalej jest tak samo ze jesli siedze w srodu i wylacze silnik to ga?nie,wyjde z auta wejde ponownie i silnik sie odpala sam.chce zablokowa? te automatyczne odpalanie zeby po wejsciu do auta trzeba bylo wlaczyc silnik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-15, 17:21


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

No to zr?b tak jak napisa?em:
musisz u?y? opcji 'Szukaj w plikach', szukaj 'setVehicleEngineState' i wklej zrzut ekranu wynik?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-15, 23:52


KucharSolo







Wiek: 35
Na forum: 3439 dni
Posty: 94
Nick w MP: Kuchar

Piwa: 2

Respekt: 31

Jest to tylko w tym skrypcie..
jest to dokladnie tu;
                 setVehicleEngineState(vehtrue)
            end,1000,1)
            elseif id == 2 then
            setVehicleEngineState(vehfalse)

 addEventHandler "onPlayerVehicleExit"getRootElement(), function(theVehicleleftSeatjackerPlayer)
    if leftSeat == and not jackerPlayer then
      setVehicleLocked(theVehiclefalse)
      setVehicleEngineState(theVehiclefalse )
      setElementData(theVehicle,"pasyzapiete",false)
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-16, 00:35


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Ale to masz szuka? w ca?ym gamemodzie, wszystkie skrypty.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-16, 02:05


KucharSolo







Wiek: 35
Na forum: 3439 dni
Posty: 94
Nick w MP: Kuchar

Piwa: 2

Respekt: 31

no nie ma,wgralem inna interakcje pojazdow aby przetestowac i tam wszystko dziala bez problemu a na tej nie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-16, 07:38


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? klient z tego skryptu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-16, 11:58


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3810 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

domy?lnie w gta przy wsiadaniu do auta w??cza si? silnik.

addEventHandler "onVehicleEnter"getRootElement(),function()
setVehicleEngineState(source,false)
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KucharSolo
Wysłany: 2019-11-16, 15:14


KucharSolo







Wiek: 35
Na forum: 3439 dni
Posty: 94
Nick w MP: Kuchar

Piwa: 2

Respekt: 31

"Pawel5321" napisał/a:

domy?lnie w gta przy wsiadaniu do auta w??cza si? silnik.

addEventHandler "onVehicleEnter"getRootElement(),function()
setVehicleEngineState(source,false)
end)


SUPER! o to w?a?nie chodzilo.Wielkie dzieki Ci.Stawiam piweczko i respekcik.Jeszcze raz wielke dzi?ki ziomek :D

Postaw piwo autorowi tego posta
 

 
Tagi: silnik :: sam :: sie :: odpala
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