Wysłany: 2020-04-03, 16:52
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
hey mam problem z zdefiniowaniem go?cia w aucie kto? pomo?e?
oto kod
s-side
function pomocnik ()
setTimer (function( thePlayer )
veh = getPedOccupiedVehicle ( thePlayer ) -- wy ? wietla sie ten error co w temacie
if veh then
if getElementData ( veh , "zarejestrony" ) == 1 then
triggerClientEvent ( thePlayer , "STARTJobBus" , resourceRoot , veh )
end
end
end , 5000 , 0 )
end
addEventHandler ( "onResourceStart" , getRootElement (), pomocnik )
Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Wysłany: 2020-04-03, 16:55
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Pytanie sk?d wzi??e? zmienn? 'thePlayer' w funkcji timera.
W evencie onResourceStart musisz u?y? p?tli i funkcji
Przyk?ad:
function pomocnik ()
for _ , pojazd in ipairs ( getElementsByType ( "player" )) do
local kierowca = getVehicleController ( pojazd )
outputChatBox ( "Kierowca pojazdu to " .. getPlayerName ( kierowca ) .. "." )
end
end
addEventHandler ( "onResourceStart" , getRootElement (), pomocnik )
Więcej szczegółów
Wystawiono 1 piw(a):MartinPanZycia
Wysłany: 2020-04-03, 18:12
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
Wilq ,
error
Bad argument @ 'getVehicleController' [ Expected vehicle at argument 1 , got player ]
Bad argument @ 'getPlayerName' [ Expected element at argument 1 , got boolean ]
attempt to concatenate a boolean value
u?y?em kodu 1:1 nic nie zmienia?em
Wysłany: 2020-04-03, 18:18
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Zamy?li?em si?:
function pomocnik ()
for _ , pojazd in ipairs ( getElementsByType ( "vehicle" )) do
local kierowca = getVehicleController ( pojazd )
outputChatBox ( "Kierowca pojazdu to " .. getPlayerName ( kierowca ) .. "." )
end
end
addEventHandler ( "onResourceStart" , getRootElement (), pomocnik )
Więcej szczegółów
Wystawiono 1 piw(a):MartinPanZycia
Wysłany: 2020-04-03, 22:37
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
Wilq , dzi?kuj? bardzo nigdy nie korzysta?em z getElementsByType ale dzi?ki tobie pozna?em kolejny spos?b na uczenie si? lua
Tagi: bad :: argument :: getpedoccupiedvehicle :: [expected :: ped :: argu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: