Wysłany: 2015-11-09, 19:31
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Witam nie dziala mi destroy auta jak sie z auta wysiadzie
marker = createMarker (- 2477.85 , 741.61 , 34.0 , "cylinder" , 3.0 , 0 , 255 , 255 , 255 )
function zresp ( player )
local auto = createVehicle ( 552 ,- 2473.05 , 740.76 , 34.73 , 359.7 , 360.0 , 179.4 )
setElementData ( auto , "pojazd_paliwo" , 50 )
setElementData ( auto , "pojazd_opis" , "Praca dorywcza - ?atanie dziur " )
setVehiclePlateText ( auto , "ZRD" )
warpPedIntoVehicle ( player , auto , 0 )
outputChatBox ( " " , player , 0 , 200 , 0 )
outputChatBox ( "Praca dorywcza - ?atanie dziur " , player , 0 , 200 , 0 )
outputChatBox ( " " , player , 0 , 200 , 0 )
end
addEventHandler ( "onMarkerHit" , marker , zresp )
local punkty = {
{- 2337.45 , 725.73 , 43.49 },
{- 2149.48 , 654.08 , 51.84 },
{- 1999.69 , 514.99 , 34.59 },
{- 1893.74 , 800.24 , 37.61 },
{- 1789.41 , 978.51 , 24.32 },
{- 1776.95 , 1267.21 , 10.43 },
{- 2169.30 , 1277.51 , 27.65 },
{- 2269.48 , 1066.80 , 81.08 },
{- 2255.72 , 340.48 , 33.47 },
}
function markery ( player )
local pkt = punkty [ math . random ( 1 , #punkty)]
marker = createMarker ( pkt [ 1 ], pkt [ 2 ], pkt [ 3 ], "checkpoint" , 2.0 , 123 , 225 , 56 , 150 , player )
blip = createBlipAttachedTo ( marker , 11 , 2 , 255 , 0 , 0 , 255 , 0 , 99999.0 , player )
end
addEventHandler ( "onMarkerHit" , marker , markery )
function destroyauto ( player , seat )
if seat == 1 then
outputChatBox ( "Zakonczyles prace." , player )
destroyElement ( auto )
end
end
addEventHandler ( "onVehicleExit" , destroyauto )
local money = math . random ( 5 , 15 )
I co dalej jak juz to naprawie to co dalej robic jak robic ze jak wjedziesz to respi sie nowy marker itd...
Wysłany: 2015-11-09, 21:01
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
Wysłany: 2015-11-09, 21:27
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
jg aviva, onVehicleExit przyjmuje jako ?r?d?o pojazd z kt?rego wysiadamy, tak wi?c po co to getPedOccupiedVehicle?
[ Komentarz dodany przez: DestroY : 2015-11-09, 21:29 ]
Poza tym, seat 1 odpowiada za pozycj? pasa?era, nie kierowcy...
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-11-09, 21:33
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
Wysłany: 2015-11-09, 21:45
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Zrobilem takie cos i nic
function usun_pojazd ( plr , seat )
if seat == 0 then
if ( getElementModel ( plr ) == 552 ) then
auto = getPedOccupiedVehicle ( plr )
outputChatBox ( "Sko?czy?e? prac?" , plr )
destroyElement ( auto )
end
end
end
addEventHandler ( "onVehicleStartExit" , auto (), usun_pojazd )
[ Dodano : 2015-11-09, 21:59 ]
function usun_pojazd ( plr , seat )
if seat == 0 then
auto = getPedOccupiedVehicle ( plr )
outputChatBox ( "Sko?czy?e? prac?" , plr )
destroyElement ( auto )
end
end
addEventHandler ( "onClientVehicleExit" , getRootElement (), usun_pojazd )
poprawka xd
Wysłany: 2015-11-09, 22:12
jg2aviva1
Rusek :D
Wiek: 25 Na forum: 4134 dni Posty: 445
Nick w MP: _Wolfenstei[N]^.^
Piwa : 1033
spr?buj to:
function usun_pojazd ( player , seat )
if seat == 0 then
auto = getPedOccupiedVehicle ( player )
kupa = getElementData ( auto , "pojazd_wsiadaj" )
if kupa then
outputChatBox ( "Sko?czy?e? prac?" , player )
destroyElement ( auto )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , getRootElement (), usun_pojazd )
i przy dawaniu pojazdu nadaj mu t? dat?. Powinno dzia?a?
[ Dodano : 2015-11-09, 22:12 ]
spr?buj to:
function usun_pojazd ( player , seat )
if seat == 0 then
auto = getPedOccupiedVehicle ( player )
kupa = getElementData ( auto , "pojazd_wsiadaj" )
if kupa then
outputChatBox ( "Sko?czy?e? prac?" , player )
destroyElement ( auto )
else return end
end
end
addEventHandler ( "onVehicleStartExit" , getRootElement (), usun_pojazd )
i przy dawaniu pojazdu nadaj mu t? dat?. Powinno dzia?a?
Podpis
GTAO Member: 2015-08-23, 14:26
Wysłany: 2015-11-10, 15:41
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4329 dni Posty: 698
Piwa : 2080
Dzieki dziala. Do zamkniecia masz pifo
Tagi: destroy :: dalsze :: czesci :: pracy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: