Wysłany: 2017-01-20, 08:22
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
local function pojazdPusty ( veh )
if not veh then return end
local occupants = getVehicleOccupants ( veh )
local seats = getVehicleMaxPassengers ( veh )
if ( not seats ) then return true end
for i = 0 , seats do
local occupant = occupants [ seat ]
if occupant and ( getElementType ( occupant )== "player" or getElementType ( occupant )== "ped" ) and getPedOccupiedVehicleSeat ( occupant ) == i then
return false
end
end
return true
end
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
if ( pojazdPusty ( v )) then
setVehicleDamageProof ( v , true )
else
if getElementData ( v , "damageproof" ) then setVehicleDamageProof ( v , true ) return end
setVehicleDamageProof ( v , false )
end
end
addEventHandler ( "onVehicleEnter" , root , function()
if source then
if getElementData ( source , "damageproof" ) then setVehicleDamageProof ( source , true ) return end
setVehicleDamageProof ( source , false )
end
end )
addEventHandler ( "onVehicleExit" , root , function()
if source then
if ( pojazdPusty ( source )) then
setVehicleDamageProof ( source , true )
else
if getElementData ( source , "damageproof" ) then setVehicleDamageProof ( source , true ) return end
setVehicleDamageProof ( source , false )
end
end
end )
Chcia?em, ?eby samochody si? nie pali?y, nie wybucha?y, ale teraz wcale si? nie psuj?.. Za pomoc stawiam .
Wysłany: 2017-01-20, 12:35
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
local function pojazdPusty ( veh )
if not veh then return end
local occupants = getVehicleOccupants ( veh )
local seats = getVehicleMaxPassengers ( veh )
if ( not seats ) then return true end
for i = 0 , seats do
local occupant = occupants [ seat ]
if occupant and ( getElementType ( occupant )== "player" or getElementType ( occupant )== "ped" ) and getPedOccupiedVehicleSeat ( occupant ) == i then
return false
end
end
return true
end
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
if ( pojazdPusty ( v )) then
setVehicleDamageProof ( v , true )
else
if getElementData ( v , "damageproof" ) then setVehicleDamageProof ( v , true ) return end
setVehicleDamageProof ( v , false )
end
end
addEventHandler ( "onVehicleEnter" , root , function()
if source then
if getElementData ( source , "damageproof" ) then setVehicleDamageProof ( source , true ) return end
healt = getElementHealth ( source )
if healt < 300 then
setElementHealth ( source , 301 )
end
end )
addEventHandler ( "onVehicleExit" , root , function()
if source then
if ( pojazdPusty ( source )) then
setVehicleDamageProof ( source , true )
else
if getElementData ( source , "damageproof" ) then setVehicleDamageProof ( source , true ) return end
setVehicleDamageProof ( source , false )
end
end
end )
end )
robione na szybko w szkole, nie sprawdzone.
Podpis
"amited" napisał/a :
Wysłany: 2017-01-20, 12:48
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
Samochody niszcz? si?, ale wybuchaj?
Wysłany: 2017-01-20, 12:56
Pawel5321
Szkrypter
Wiek: 36 Na forum: 3809 dni Posty: 237
Nick w MP: Pawell
Piwa : 2315
function handleVehicleDamage ( attacker , weapon , loss , x , y , z , tyre )
if getElementHealth ( source )< 350 or loss > getElementHealth ( source )- 300 then
cancelEvent ()
end
end
addEventHandler ( "onClientVehicleDamage" , root , handleVehicleDamage )
cside
Wysłany: 2017-01-22, 10:22
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
Pawel5321 , Dzi?ki, dziaa. Masz ode mnie piwo
[ Dodano : 2017-01-22, 10:22 ]
dzia?a*
Tagi: samochody :: się :: nie :: psują
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: