Wysłany: 2015-12-25, 21:07
Marcinos651
Wiek: 28 Na forum: 4480 dni Posty: 18
Nick w MP: Marcin651
Zrobi ktos tak zeby nie pisalo zamykanie pojazdu w budowie tylko zeby zamykalo i otwieralo ten pojazd
isBike = {[ 509 ]= true , [ 481 ]= true , [ 510 ]= true } -- rowery
addEvent ( "onChooseInteractionV1" , true )
addEventHandler ( "onChooseInteractionV1" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
local engine = getVehicleEngineState ( vehicle )
if engine == false then
setVehicleEngineState ( vehicle , true )
outputChatBox ( "* Uruchomi?e? silnik." , source )
else
if getElementData ( vehicle , "pojazd_paliwo" ) <= 0 then
outputChatBox ( "* Nie mo?na odpali? silnika, brak paliwa." , source )
return
end
if getElementData ( vehicle , "pojazd_przebieg" ) == 10000 then
outputChatBox ( "* Nie mo?na odpali? silnika, zbyt du?y przebieg." , source )
return
end
setVehicleEngineState ( vehicle , false )
outputChatBox ( "* Zgasi?e? silnik." , source )
end
end
end
end )
addEvent ( "onChooseInteractionV2" , true )
addEventHandler ( "onChooseInteractionV2" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
if getVehicleOverrideLights ( vehicle ) ~= 2 then
setVehicleOverrideLights ( vehicle , 2 )
outputChatBox ( "* Zapali?e? ?wiat?a" , source )
else
setVehicleOverrideLights ( vehicle , 1 )
outputChatBox ( "* Zgasi?e? ?wiat?a." , source )
end
end
end
end )
addEvent ( "onChooseInteractionV3" , true )
addEventHandler ( "onChooseInteractionV3" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
outputChatBox ( "* Zamykanie pojazdu w budowie" , source )
end
end
end )
addEvent ( "onChooseInteractionV4" , true )
addEventHandler ( "onChooseInteractionV4" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
--if not getElementData ( vehicle , "pojazd_zrespiony" ) then return end
if isBike [ getElementModel ( vehicle )] then return end
local sx , sy , sz = getElementVelocity ( vehicle )
local aspeed = ( sx ^ 2 + sy ^ 2 + sz ^ 2 )^( 0.5 )
local kmh = aspeed * 180
if kmh < 2 then
if isElementFrozen ( vehicle ) then
setElementFrozen ( vehicle , false )
outputChatBox ( "* Spu?ci?e? r?czny." , source )
else
setElementFrozen ( vehicle , true )
outputChatBox ( "* Zaci?gn??e? r?czny." , source )
end
end
end
end
end )
Wysłany: 2015-12-25, 23:04
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
Prosze funkcja do zamykania
Wysłany: 2015-12-25, 23:04
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
isBike = {[ 509 ]= true , [ 481 ]= true , [ 510 ]= true } -- rowery
addEvent ( "onChooseInteractionV1" , true )
addEventHandler ( "onChooseInteractionV1" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
local engine = getVehicleEngineState ( vehicle )
if engine == false then
setVehicleEngineState ( vehicle , true )
outputChatBox ( "* Uruchomi?e? silnik." , source )
else
if getElementData ( vehicle , "pojazd_paliwo" ) <= 0 then
outputChatBox ( "* Nie mo?na odpali? silnika, brak paliwa." , source )
return
end
if getElementData ( vehicle , "pojazd_przebieg" ) == 10000 then
outputChatBox ( "* Nie mo?na odpali? silnika, zbyt du?y przebieg." , source )
return
end
setVehicleEngineState ( vehicle , false )
outputChatBox ( "* Zgasi?e? silnik." , source )
end
end
end
end )
addEvent ( "onChooseInteractionV2" , true )
addEventHandler ( "onChooseInteractionV2" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
if getVehicleOverrideLights ( vehicle ) ~= 2 then
setVehicleOverrideLights ( vehicle , 2 )
outputChatBox ( "* Zapali?e? ?wiat?a" , source )
else
setVehicleOverrideLights ( vehicle , 1 )
outputChatBox ( "* Zgasi?e? ?wiat?a." , source )
end
end
end
end )
addEvent ( "onChooseInteractionV3" , true )
addEventHandler ( "onChooseInteractionV3" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
local status = isVehicleLocked ( vehicle )
setVehicleLocked ( vehicle , not status )
if status then
outputChatBox ( "* Odblokowa?e? pojazd" , source )
else
outputChatBox ( "* Zamkn??e? pojazd" , source )
end
end
end
end )
addEvent ( "onChooseInteractionV4" , true )
addEventHandler ( "onChooseInteractionV4" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
--if not getElementData ( vehicle , "pojazd_zrespiony" ) then return end
if isBike [ getElementModel ( vehicle )] then return end
local sx , sy , sz = getElementVelocity ( vehicle )
local aspeed = ( sx ^ 2 + sy ^ 2 + sz ^ 2 )^( 0.5 )
local kmh = aspeed * 180
if kmh < 2 then
if isElementFrozen ( vehicle ) then
setElementFrozen ( vehicle , false )
outputChatBox ( "* Spu?ci?e? r?czny." , source )
else
setElementFrozen ( vehicle , true )
outputChatBox ( "* Zaci?gn??e? r?czny." , source )
end
end
end
end
end )
Podpis
Jedyny kontakt ze mną to PW forum
Kod:
local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Wysłany: 2015-12-26, 14:30
Marcinos651
Wiek: 28 Na forum: 4480 dni Posty: 18
Nick w MP: Marcin651
Nie dzia?a
Pomoze ktos?
Wysłany: 2015-12-26, 15:50
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
addEvent ( "drzwi" , true )
addEventHandler ( "drzwi" , root , function()
local pojazd = getPedOccupiedVehicle ( source )
if pojazd then
local drzwi = isVehicleLocked ( pojazd )
if drzwi == true then
setVehicleLocked ( pojazd , false )
else
setVehicleLocked ( pojazd , true )
end
end
end )
Wysłany: 2015-12-26, 18:39
Marcinos651
Wiek: 28 Na forum: 4480 dni Posty: 18
Nick w MP: Marcin651
Nie dzia?a
Wysłany: 2016-01-05, 17:40
Emm
***** ***
Wiek: 32 Na forum: 3880 dni Posty: 3191
Nick w MP: Emm
Piwa : 6162
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
isBike = {[ 509 ]= true , [ 481 ]= true , [ 510 ]= true } -- rowery
addEvent ( "onChooseInteractionV1" , true )
addEventHandler ( "onChooseInteractionV1" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
local engine = getVehicleEngineState ( vehicle )
if engine == false then
setVehicleEngineState ( vehicle , true )
outputChatBox ( "* Uruchomi?e? silnik." , source )
else
if getElementData ( vehicle , "pojazd_paliwo" ) <= 0 then
outputChatBox ( "* Nie mo?na odpali? silnika, brak paliwa." , source )
return
end
if getElementData ( vehicle , "pojazd_przebieg" ) == 10000 then
outputChatBox ( "* Nie mo?na odpali? silnika, zbyt du?y przebieg." , source )
return
end
setVehicleEngineState ( vehicle , false )
outputChatBox ( "* Zgasi?e? silnik." , source )
end
end
end
end )
addEvent ( "onChooseInteractionV2" , true )
addEventHandler ( "onChooseInteractionV2" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
if getVehicleOverrideLights ( vehicle ) ~= 2 then
setVehicleOverrideLights ( vehicle , 2 )
outputChatBox ( "* Zapali?e? ?wiat?a" , source )
else
setVehicleOverrideLights ( vehicle , 1 )
outputChatBox ( "* Zgasi?e? ?wiat?a." , source )
end
end
end
end )
addEvent ( "onChooseInteractionV3" , true )
addEventHandler ( "onChooseInteractionV3" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
if isBike [ getElementModel ( vehicle )] then return end
setVehicleLocked ( vehicle , false )
outputChatBox ( "* Odblokowa?e? pojazd" , source )
else
setVehicleLocked ( vehicle , true )
outputChatBox ( "* Zamkn??e? pojazd" , source )
end
end
end
end )
addEvent ( "onChooseInteractionV4" , true )
addEventHandler ( "onChooseInteractionV4" , root , function()
local vehicle = getPedOccupiedVehicle ( source )
if vehicle then
if getPedOccupiedVehicleSeat ( source ) == 0 then
--if not getElementData ( vehicle , "pojazd_zrespiony" ) then return end
if isBike [ getElementModel ( vehicle )] then return end
local sx , sy , sz = getElementVelocity ( vehicle )
local aspeed = ( sx ^ 2 + sy ^ 2 + sz ^ 2 )^( 0.5 )
local kmh = aspeed * 180
if kmh < 2 then
if isElementFrozen ( vehicle ) then
setElementFrozen ( vehicle , false )
outputChatBox ( "* Spu?ci?e? r?czny." , source )
else
setElementFrozen ( vehicle , true )
outputChatBox ( "* Zaci?gn??e? r?czny." , source )
end
end
end
end
end )
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Tagi: edycja
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: