Witam serdecznie pisz? do was z pro?b? o pomoc w skryptach Mam problem z wieloma skryptami w gm Ems a mianowicie w ka?dym w debugscript wy?wietla si? "es-wodne_oddychanie/s_water.lua:9: Bad argument @ 'setPedStat' [Expected element at argument 1, got nil]" lub DXdrawText do ka?dego pliku jest inny napis po @'
oraz na docherty s? straszne spadki fps prosz? o pomoc w nagrod? dam
to nie wina maap lecz skrypty es-pojazdy lecz nie wiem co powoduje takie lagi na docherty
local 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[i]
-- if occupant and (getElementType(occupant)=="player" or getElementType(occupant)=="ped") then
-- return false
-- end
-- end
-- return true
local occupant=getVehicleOccupant(veh, 0)
if occupant and isElement(occupant) then
if (getElementType(occupant)=="player") then
return false
end
end
return true
end
setTimer(function()
for i,v in ipairs(getElementsByType("vehicle")) do
--if getElementData(v, "dbid") then -- je?eli ma dzia?a? tylko na pojazdy prywatne to
if (pojazdPusty(v)) then
setVehicleDamageProof(v,true)
else
if not getElementData(source,"pojazdy:zniszczonyWrak") then setVehicleDamageProof(v,false) end
end
--end
end
end, 1000, 1)
addEventHandler ( "onVehicleEnter", root, function(plr,seat)
if seat~=0 then
return
end
if not getElementData(source,"pojazdy:zniszczonyWrak") then setVehicleDamageProof(source, false) end
end)
addEventHandler ( "onVehicleExit", root, function(plr,seat)
if seat~=0 then
return
end
-- if (pojazdPusty(source)) then
if source and isElement(source) then
if (not getVehicleController(source)) then
setVehicleDamageProof(source, true)
setVehicleOverrideLights(source, 1)
else
if getElementData(source,"pojazdy:zniszczonyWrak") then return end
setVehicleDamageProof(source, false)
end
end
end)
addEventHandler("onPlayerQuit", root,
function()
local veh=getPedOccupiedVehicle(source)
if not veh then
return
end
if getElementData(veh,"dbid") then
if (getPedOccupiedVehicleSeat(source)==0) then
setVehicleDamageProof(veh, true)
setVehicleEngineState(veh, false)
setElementFrozen(veh, true)
end
end
end
)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach