Wywala Ci jaki? b??d podczas odpalenia ca?ego skryptu z SAMC? by? mo?e jest co? co uniemo?liwia wystartowanie s_vehicles.lua. Tak?e prawdopodobne jest to i?, frakcja sapd zosta?a przerobiona na samc, przy tym bez zmian elementdaty i to powoduje problem.
zaraz dam kod kt?ry dzia?a tylko koordy musisz zmienic C:
(wystarczy?o zmienic nazwy z tych sapd na samc)
[ Dodano: 2019-04-30, 23:59 ]
function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable[property]
for i,v in pairs(asamc_ambulansy) do
local vehicle=createVehicle(v[7], v[1], v[2], v[3])
setVehicleColor(vehicle,255,255,255,255)
setElementRotation(vehicle, v[4], v[5], v[6])
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
local fast = getVehicleHandlingProperty(vehicle,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(vehicle,"maxVelocity")
local masa = getVehicleHandlingProperty(vehicle,"mass")
local masa2 = getVehicleHandlingProperty(vehicle,"turnMass")
local xd = getVehicleHandlingProperty(vehicle,"tractionMultiplier")
local coef = getVehicleHandlingProperty(vehicle,"dragCoeff")
local stdg = getVehicleHandlingProperty(vehicle,"steeringLock")
setVehicleHandling(vehicle,"engineAcceleration",fast+6.5)
setVehicleHandling(vehicle,"maxVelocity",maxfast+115)
setVehicleHandling(vehicle,"tractionMultiplier",xd+0.25)
setVehicleHandling(vehicle,"mass",masa+150+100+200+55)
setVehicleHandling(vehicle,"steeringLock",stdg+0.25)
setVehicleHandling(vehicle,"dragCoeff",coef-0.25)
setVehicleHandling(vehicle,"driveType", "awd")
local fast = getVehicleHandlingProperty(vehicle,"engineAcceleration")
local maxfast = getVehicleHandlingProperty(vehicle,"maxVelocity")
local masa = getVehicleHandlingProperty(vehicle,"mass")
local masa2 = getVehicleHandlingProperty(vehicle,"turnMass")
local xd = getVehicleHandlingProperty(vehicle,"tractionMultiplier")
local coef = getVehicleHandlingProperty(vehicle,"dragCoeff")
local stdg = getVehicleHandlingProperty(vehicle,"steeringLock")
setVehicleHandling(vehicle,"engineAcceleration",fast+6.5)
setVehicleHandling(vehicle,"maxVelocity",maxfast+115)
setVehicleHandling(vehicle,"tractionMultiplier",xd+0.25)
setVehicleHandling(vehicle,"mass",masa+150+100+200+55)
setVehicleHandling(vehicle,"steeringLock",stdg+0.25)
setVehicleHandling(vehicle,"dragCoeff",coef-0.25)
setVehicleHandling(vehicle,"driveType", "awd")
addEventHandler("onVehicleEnter", resourceRoot, function(plr,seat,jacked)
if seat == 0 then
setElementData(source,"use:player",true)
outputChatBox("* Wszedle?(a?) do pojazdu frakcyjnego, dbaj o niego i odstaw na miejsce.", plr)
outputChatBox("* Wszelkie zostawiania pojazd?w b?da karane banem.", plr)
end
end)
setTimer(function()
for i,vehicle in pairs(getElementsByType("vehicle", resourceRoot)) do
local x,y,z = getElementPosition(vehicle)
local r1,r2,r3 = getElementRotation(vehicle)
setVehicleRespawnPosition(vehicle,x,y,z,r1,r2,r3)
toggleVehicleRespawn(vehicle,true)
setVehicleIdleRespawnDelay(vehicle,3600000)
setVehicleHandling(vehicle, "driveType", "awd")
setElementData(vehicle,"vehicle:duty","SAMC")
end
end,1000,1)
local t=createElement('text')
setElementData(t,'name','Rozpocz?cie pracy')
setElementDimension(t, 0)
setElementInterior(t, 1)
setElementPosition(t,2496.96,-1652.64,81.90)
local licz = {}
function isPlayerInFaction(plr)
local sid=getElementData(plr,'player:sid')
if not sid then return end
local result=exports['pystories-db']:dbGet('SELECT 1 FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;', "SAMC", sid)
if result[1] then
return true
else
return false
end
end
addEventHandler('onMarkerHit', marker, function(el,md)
if isPlayerInFaction(el) then
if not getElementData(el,'player:faction') then
setElementModel(el,274)
exports['pystories-frakcja-ustawienia']:rozpocznijnaliczanie(el)
setElementData(el,'player:faction',"SAMC")
local rank = exports['pystories-frakcja-ustawienia']:getPlayerFactionRank(el,'SAMC')
setElementData(el,"player:rank",rank)
else
exports['pystories-frakcja-ustawienia']:zatrzymajnaliczanie(el)
takeWeapon(el,41)
setElementData(el, 'player:faction', false)
setElementData(el,"player:rank",false)
local skin=getElementData(el,"player:skin")
setElementModel(el, skin)
--setPlayerNametagColor(el,false)
end
else
outputChatBox('Nie jeste? zatrudniony jako SAMC.', el, 255, 0, 0)
end
end)
function naliczanie(el)
if isElement(el) then
local x = getElementData(el,"player:workinjob") or 0
setElementData(el,"player:workinjob",x+1)
else
if isTimer(licz[el]) then
killTimer(licz[el])
licz[el] = nil
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