Wysłany: 2018-07-01, 21:06
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Cze??, posiadam skrypt na community-dmvehicle
I auta graczom wybuchaj? jak sie pali, jak to zablokowa??
function pojazdPusty ( veh )
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" ) 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 getElementData ( source , "damageproof" ) then setVehicleDamageProof ( source , true ) return end
setVehicleDamageProof ( source , false )
end )
addEventHandler ( "onVehicleExit" , root , function()
if ( pojazdPusty ( source )) then
setVehicleDamageProof ( source , true )
else
if getElementData ( source , "damageproof" ) then setVehicleDamageProof ( source , true ) return end
setVehicleDamageProof ( source , false )
end
end )
Wysłany: 2018-07-01, 21:13
Query
SyndicateMTA
Wiek: 24 Na forum: 3071 dni Posty: 319
Nick w MP: Query
Piwa : 5257
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 )
polecam ten kod, wzi??em go z its v1 powinien dzia?a? je?eli pomog?em postaw piwko !
Tagi: auta :: graczom :: wybuchają :: dmvehicles)
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: