Wysłany: 2015-12-10, 18:27
THEGizmo
Modeler/Uczeń Lua
Wiek: 27 Na forum: 4141 dni Posty: 255
Nick w MP: THEGizmo
Piwa : 3072
Witam mam problem z usuwaniem opisu pojazdu jak si? wypchnie auta puste to nie znika opis a jak wyjad? pojazdem to znika
za pomoc stawiam
local strefa = createColCuboid (- 1991.49 , 419.51 , 35.17 - 1 , 30 , 36.2 , 6 )
addEventHandler ( "onClientColShapeHit" , strefa , function( el , md )
if not md or el ~= localPlayer then return end
if wjazd then return end
wjazd = true
end )
addEventHandler ( "onClientColShapeLeave" , strefa , function( el , md )
if not md or el ~= localPlayer then return end
if not wjazd then return end
local veh = getPedOccupiedVehicle ( el )
if not veh then return end
setElementData ( veh , "pojazd_opis" , false )
end )
Podpis
Modeler Corporation Sp. Z.O.O
Wysłany: 2015-12-13, 10:28
krisu477
Wiek: 25 Na forum: 4837 dni Posty: 54
Nick w MP: Krisek
Piwa : 7
addEventHandler ( "onClientColShapeLeave" , strefa , function( el , md )
if not md or el ~= localPlayer then return end
if not wjazd then return end
local veh = getPedOccupiedVehicle ( el )
if not veh then return end
setElementData ( veh , "pojazd_opis" , false )
end )
Problem jest w tej funkcji. Chodzi o to, ?e gdy wypychasz samo auto, zmiennej el jest przypisywane to auto przez co pierwszy if wyklucza doko?czenie tej funkcji. Kolejnym problemem jest funkcja getPedOccupiedVehicle, kt?ra potrzebuje w argumencie peda, a dostaje to auto, kt?re wypychasz, przez co zwr?ci false i funkcja sko?czy si? przez ostatniego if'a.
Tagi: usuwanie :: napisu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: