Wysłany: 2019-03-26, 19:43
Bilbosz
Wiek: 28 Na forum: 2633 dni Posty: 5
Witam, do skryptu z prac? chcia?em doda? przenikanie aut. Jako, i? jestem zielony w LUA nie potrafi? sobie z tym poradzi?.
client:
Kod: addEvent('ghostmode',true)
addEventHandler("ghostmode", root, function(taxi)
for index,vehicle in ipairs(getElementsByType("vehicle")) do --LOOP through all Vehicles
setElementCollidableWith(vehicle, taxi, false) -- Set the Collison off with the Other vehicles.
end
end)
server:
Kod: function teamSet ( )
local team = getTeamFromName ( "Taxi Driver" )
if team then
setPlayerTeam ( source, team )
setPlayerNametagColor ( source, 0, 255, 0 )
setElementModel(source, 57)
taxi = createVehicle(420, 1777.3017578125, -1891.779296875, 13.157614707947) -- TWORZY AUTO
triggerClientEvent('ghostmode',source,taxi) -- FUNKCJA ODPOWIEDZIALNA ZA PRZENIKANIE AUT
triggerClientEvent('outputNotificacion',source,'Rozpoczynasz prac? jako taks?wkarz! Wsi?d? do taks?wki ',taxi)
else
local teamw = getTeamFromName ( "Taxi Driver" )
if teamw then
cancelEvent()
outputChatBox("You are already a Taxi driver!", source)
end
end
end
Chc?, aby po respie auta od razu dodawa?o mu przenikanie. Niestety kod wy?ej nie dzia?a. Dodam tylko, ?e jak u?yje funkcji
Kod: triggerClientEvent('ghostmode',source,taxi)
w Kod: przenikania dzia?a, ale dopiero po wej?ciu do auta a mi zale?y, ?eby skrypt wykonywa? si? od razu po respie auta.
Wysłany: 2019-03-26, 20:09
adaskOO
Ten który patrzy
Wiek: 24 Na forum: 3732 dni Posty: 249
Nick w MP: adaskOO
Piwa : 3168
A mo?e spr?buj pod eventem
Wysłany: 2019-03-26, 20:23
Bilbosz
Wiek: 28 Na forum: 2633 dni Posty: 5
Niestety, nadal kolizje s?
Wysłany: 2019-03-26, 20:56
Avenged
Młodszy Szkrypter
Wiek: 23 Na forum: 3510 dni Posty: 654
Nick w MP: Avenged
Piwa : 1570
addEvent ( 'ghostmode' , true )
addEventHandler ( "ghostmode" , root , function( taxi )
for index , vehicle in ipairs ( getElementsByType ( "vehicle" )) do -- LOOP through all Vehicles
setElementCollidableWith ( taxi , vehicle , false ) -- Set the Collison off with the Other vehicles .
end
end )
Clienta ?le masz argumenty - na odwr?t.
Więcej szczegółów
Wystawiono 1 piw(a):PiaTTeK
Wysłany: 2019-03-26, 21:10
Bilbosz
Wiek: 28 Na forum: 2633 dni Posty: 5
"Avenged" napisał/a :
addEvent ( 'ghostmode' , true )
addEventHandler ( "ghostmode" , root , function( taxi )
for index , vehicle in ipairs ( getElementsByType ( "vehicle" )) do -- LOOP through all Vehicles
setElementCollidableWith ( taxi , vehicle , false ) -- Set the Collison off with the Other vehicles .
end
end )
Clienta ?le masz argumenty - na odwr?t.
Zmieni?em i dalej to samo. Og?lnie przenikanie dzia?a jak pisa?em ale tylko gdy wywo?uje funkcje w evencie.
Tagi: przenikanie :: aut
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: