Wysłany: 2019-11-14, 21:38
KucharSolo
Wiek: 35 Na forum: 3439 dni Posty: 94
Nick w MP: Kuchar
Piwa : 2
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( id , vehicle )
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 ( veh , true )
end , 1000 , 1 )
elseif id == 2 then
setVehicleEngineState ( veh , false )
elseif id == 3 then
setVehicleOverrideLights ( veh , 2 )
elseif id == 4 then
setVehicleOverrideLights ( veh , 1 )
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 ( veh , false )
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 ( veh , true )
end
end
else
if vehicle then
if isElement ( vehicle ) then
if isVehicleLocked ( vehicle ) then
setVehicleLocked ( vehicle , false )
else
setVehicleLocked ( vehicle , false )
end
end
end
end
end
end )
addEventHandler ( "onPlayerVehicleExit" , getRootElement (), function( theVehicle , leftSeat , jackerPlayer )
if leftSeat == 0 and not jackerPlayer then
setVehicleLocked ( theVehicle , false )
setElementData ( theVehicle , "pasyzapiete" , false )
end
end )
Wysłany: 2019-11-14, 23:29
NotPaladyn
Wiek: 23 Na forum: 2790 dni Posty: 866
Nick w MP: NotPaladyn
Piwa : 3135
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( theVehicle , leftSeat , jackerPlayer )
if leftSeat == 0 and not jackerPlayer then
setVehicleLocked ( theVehicle , false )
setElementData ( theVehicle , "pasyzapiete" , false )
end
end )
Na:
addEventHandler ( "onPlayerVehicleExit" , getRootElement (), function( theVehicle , leftSeat , jackerPlayer )
if leftSeat == 0 and not jackerPlayer then
setVehicleLocked ( theVehicle , false )
setVehicleEngineState ( theVehicle , false )
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
Wysłany: 2019-11-15, 15:22
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
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.
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
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
Wysłany: 2019-11-15, 17:21
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
No to zr?b tak jak napisa?em:
musisz u?y? opcji 'Szukaj w plikach', szukaj 'setVehicleEngineState' i wklej zrzut ekranu wynik?w.
Wysłany: 2019-11-15, 23:52
KucharSolo
Wiek: 35 Na forum: 3439 dni Posty: 94
Nick w MP: Kuchar
Piwa : 2
Jest to tylko w tym skrypcie..
jest to dokladnie tu;
setVehicleEngineState ( veh , true )
end , 1000 , 1 )
elseif id == 2 then
setVehicleEngineState ( veh , false )
addEventHandler ( "onPlayerVehicleExit" , getRootElement (), function( theVehicle , leftSeat , jackerPlayer )
if leftSeat == 0 and not jackerPlayer then
setVehicleLocked ( theVehicle , false )
setVehicleEngineState ( theVehicle , false )
setElementData ( theVehicle , "pasyzapiete" , false )
end
end )
Wysłany: 2019-11-16, 00:35
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Ale to masz szuka? w ca?ym gamemodzie, wszystkie skrypty.
Wysłany: 2019-11-16, 02:05
KucharSolo
Wiek: 35 Na forum: 3439 dni Posty: 94
Nick w MP: Kuchar
Piwa : 2
no nie ma,wgralem inna interakcje pojazdow aby przetestowac i tam wszystko dziala bez problemu a na tej nie
Wysłany: 2019-11-16, 07:38
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Poka? klient z tego skryptu
Wysłany: 2019-11-16, 11:58
Pawel5321
Szkrypter
Wiek: 36 Na forum: 3810 dni Posty: 237
Nick w MP: Pawell
Piwa : 2315
domy?lnie w gta przy wsiadaniu do auta w??cza si? silnik.
addEventHandler ( "onVehicleEnter" , getRootElement (),function()
setVehicleEngineState ( source , false )
end )
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
"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
Tagi: silnik :: sam :: sie :: odpala
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: