Wysłany: 2017-04-05, 17:43
Krzemo1234
Wiek: 26 Na forum: 3751 dni Posty: 387
Nick w MP: Krzemo
Piwa : 16
Witam mam skrypt na to ,?e jak nikogo nie ma w poj?dzie auto si? nie rozwala
i co? mi nie dzia??
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 )
Wysłany: 2017-04-05, 17:52
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
addEventHandler ( "onVehicleStartExit" , 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 )
Tagi: rozwalanie :: auta :: bez :: kierowcy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: